renamed: test/java/bytecode/FunOLTest.java -> test/java/bytecode/OLFunTest.java

new file:   test/resources/bytecode/javFiles/OLFun.jav
This commit is contained in:
Martin Plümicke 2019-05-14 20:30:32 +02:00
parent bd0517ae29
commit 212144db86
2 changed files with 20 additions and 3 deletions

View File

@ -12,7 +12,7 @@ import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FunOLTest {
public class OLFunTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
@ -23,13 +23,13 @@ public class FunOLTest {
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/FunOL.jav";
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/OLFun.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("FunOL");
classToTest = loader.loadClass("OLFun");
/*
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();

View File

@ -0,0 +1,17 @@
import java.lang.String;
import java.lang.Integer;
import java.lang.Double;
import java.util.Vector;
import java.lang.Boolean;
public class OLFun {
//f = x -> {return x + x;};
m(f, x) {
x = f.apply(x+x);
}
}