diff --git a/test/bytecode/Op2Test.java b/test/bytecode/OLTest.java similarity index 93% rename from test/bytecode/Op2Test.java rename to test/bytecode/OLTest.java index 54ba34e4..ff91073e 100644 --- a/test/bytecode/Op2Test.java +++ b/test/bytecode/OLTest.java @@ -11,7 +11,7 @@ import org.junit.Test; import de.dhbwstuttgart.core.JavaTXCompiler; -public class Op2Test { +public class OLTest { private static String path; private static File fileToTest; private static JavaTXCompiler compiler; @@ -22,13 +22,13 @@ public class Op2Test { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Op2.jav"; + path = System.getProperty("user.dir")+"/test/bytecode/javFiles/OL.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); compiler.generateBytecode(); pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); - classToTest = loader.loadClass("Op2"); + classToTest = loader.loadClass("OL"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); } @Test diff --git a/test/bytecode/javFiles/OL.jav b/test/bytecode/javFiles/OL.jav new file mode 100644 index 00000000..493c2499 --- /dev/null +++ b/test/bytecode/javFiles/OL.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; +import java.lang.Boolean; + +class OL { + + m(Integer x) { return x + x; } + + m(Boolean x) {return x || x; } +} \ No newline at end of file diff --git a/test/bytecode/javFiles/Op.jav b/test/bytecode/javFiles/Op.jav index 4aa039d5..76e11802 100644 --- a/test/bytecode/javFiles/Op.jav +++ b/test/bytecode/javFiles/Op.jav @@ -32,18 +32,18 @@ public class Op { // return c; // } -// subInt(Integer a, Integer b) { -// Integer c = a-b; -// return c; -// } -// subLong(Long a, Long b) { -// Long c = a-b; -// return c; -// } -// subFloat(Float a, Float b) { -// Float c = a-b; -// return c; -// } + subInt(Integer a, Integer b) { + Integer c = a-b; + return c; + } + subLong(Long a, Long b) { + Long c = a-b; + return c; + } + subFloat(Float a, Float b) { + Float c = a-b; + return c; + } // subDouble(Double a, Double b) { // Double c = a-b; // return c;