From 212144db86de6bbb0b4e0d6e740ad79f6538230f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Tue, 14 May 2019 20:30:32 +0200 Subject: [PATCH] renamed: test/java/bytecode/FunOLTest.java -> test/java/bytecode/OLFunTest.java new file: test/resources/bytecode/javFiles/OLFun.jav --- .../bytecode/{FunOLTest.java => OLFunTest.java} | 6 +++--- src/test/resources/bytecode/javFiles/OLFun.jav | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) rename src/test/java/bytecode/{FunOLTest.java => OLFunTest.java} (94%) create mode 100644 src/test/resources/bytecode/javFiles/OLFun.jav diff --git a/src/test/java/bytecode/FunOLTest.java b/src/test/java/bytecode/OLFunTest.java similarity index 94% rename from src/test/java/bytecode/FunOLTest.java rename to src/test/java/bytecode/OLFunTest.java index e46f074a..1277cdde 100644 --- a/src/test/java/bytecode/FunOLTest.java +++ b/src/test/java/bytecode/OLFunTest.java @@ -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(); diff --git a/src/test/resources/bytecode/javFiles/OLFun.jav b/src/test/resources/bytecode/javFiles/OLFun.jav new file mode 100644 index 00000000..e780a06f --- /dev/null +++ b/src/test/resources/bytecode/javFiles/OLFun.jav @@ -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); + } +} \ No newline at end of file