forked from JavaTX/JavaCompilerCore
OL Test eingefügt
This commit is contained in:
parent
32ab198f9e
commit
52a96d7253
@ -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
|
9
test/bytecode/javFiles/OL.jav
Normal file
9
test/bytecode/javFiles/OL.jav
Normal file
@ -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; }
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user