From cbe77d37222d6e06c029b4a6501e80bdd6c94810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Fri, 28 Dec 2018 23:39:59 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java In Zeile 833 catch Exception durch catch Throwable ersetzt, da der UnsupportedClassVersionError geworfen wurde modified: src/test/java/bytecode/FacTest.java modified: src/test/java/bytecode/FacultyTest.java modified: src/test/java/bytecode/FieldTest.java modified: src/test/java/bytecode/FieldTph.java modified: src/test/java/bytecode/FieldTph2Test.java modified: src/test/java/bytecode/FunOLTest.java modified: src/test/java/bytecode/GenTest.java modified: src/test/java/bytecode/GreaterEqualTest.java modified: src/test/java/bytecode/GreaterThanTest.java modified: src/test/java/bytecode/LambdaCapturetest.java modified: src/test/java/bytecode/LambdaTest.java modified: src/test/java/bytecode/LambdaVoidTest.java modified: src/test/java/bytecode/LessEqualTest.java modified: src/test/java/bytecode/LessThanTest.java modified: src/test/java/bytecode/MatrixOpTest.java modified: src/test/java/bytecode/MergeTest.java modified: src/test/java/bytecode/OLTest.java modified: src/test/java/bytecode/OpTest.java modified: src/test/java/bytecode/OverloadingSortingTest.java modified: src/test/java/bytecode/OverloadingTest.java modified: src/test/java/bytecode/PlusTest.java modified: src/test/java/bytecode/PostIncTest.java modified: src/test/java/bytecode/PreIncTest.java modified: src/test/java/bytecode/RelOpsTest.java modified: src/test/java/bytecode/SortingTest.java modified: src/test/java/bytecode/SubMatTest.java modified: src/test/java/bytecode/Tph2Test.java modified: src/test/java/bytecode/Tph3Test.java modified: src/test/java/bytecode/Tph5Test.java modified: src/test/java/bytecode/TphTest.java modified: src/test/java/bytecode/WhileTest.java modified: src/test/java/bytecode/YTest.java Pfade angepasst --- .../java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java | 3 ++- src/test/java/bytecode/FacTest.java | 4 ++-- src/test/java/bytecode/FacultyTest.java | 6 +++--- src/test/java/bytecode/FieldTest.java | 6 +++--- src/test/java/bytecode/FieldTph.java | 6 +++--- src/test/java/bytecode/FieldTph2Test.java | 6 +++--- src/test/java/bytecode/FunOLTest.java | 6 +++--- src/test/java/bytecode/GenTest.java | 4 ++-- src/test/java/bytecode/GreaterEqualTest.java | 4 ++-- src/test/java/bytecode/GreaterThanTest.java | 4 ++-- src/test/java/bytecode/LambdaCapturetest.java | 6 +++--- src/test/java/bytecode/LambdaTest.java | 6 +++--- src/test/java/bytecode/LambdaVoidTest.java | 6 +++--- src/test/java/bytecode/LessEqualTest.java | 4 ++-- src/test/java/bytecode/LessThanTest.java | 4 ++-- src/test/java/bytecode/MatrixOpTest.java | 4 ++-- src/test/java/bytecode/MergeTest.java | 4 ++-- src/test/java/bytecode/OLTest.java | 4 ++-- src/test/java/bytecode/OpTest.java | 4 ++-- src/test/java/bytecode/OverloadingSortingTest.java | 4 ++-- src/test/java/bytecode/OverloadingTest.java | 4 ++-- src/test/java/bytecode/PlusTest.java | 4 ++-- src/test/java/bytecode/PostIncTest.java | 4 ++-- src/test/java/bytecode/PreIncTest.java | 4 ++-- src/test/java/bytecode/RelOpsTest.java | 4 ++-- src/test/java/bytecode/SortingTest.java | 6 +++--- src/test/java/bytecode/SubMatTest.java | 4 ++-- src/test/java/bytecode/Tph2Test.java | 4 ++-- src/test/java/bytecode/Tph3Test.java | 4 ++-- src/test/java/bytecode/Tph5Test.java | 4 ++-- src/test/java/bytecode/TphTest.java | 4 ++-- src/test/java/bytecode/WhileTest.java | 4 ++-- src/test/java/bytecode/YTest.java | 6 +++--- 33 files changed, 76 insertions(+), 75 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index 6fc80347..750dd9bf 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -829,7 +829,8 @@ public class BytecodeGenMethod implements StatementVisitor { System.out.println(methods[i]); } methodRefl = getMethod(methodCall.name,methodCall.arglist.getArguments().size(),methCallType, typesOfParams,methods); - }catch (Exception e2) { + } + catch (Throwable e2) { //do nothing } } diff --git a/src/test/java/bytecode/FacTest.java b/src/test/java/bytecode/FacTest.java index 387d7387..fcc45ee2 100644 --- a/src/test/java/bytecode/FacTest.java +++ b/src/test/java/bytecode/FacTest.java @@ -24,10 +24,10 @@ public class FacTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Fac.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Fac.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Fac"); diff --git a/src/test/java/bytecode/FacultyTest.java b/src/test/java/bytecode/FacultyTest.java index c347456a..dd7bb51e 100644 --- a/src/test/java/bytecode/FacultyTest.java +++ b/src/test/java/bytecode/FacultyTest.java @@ -24,11 +24,11 @@ public class FacultyTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Faculty.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Faculty.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("Faculty"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/FieldTest.java b/src/test/java/bytecode/FieldTest.java index a5528b00..ed1a562f 100644 --- a/src/test/java/bytecode/FieldTest.java +++ b/src/test/java/bytecode/FieldTest.java @@ -24,11 +24,11 @@ public class FieldTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Field.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Field.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("Field"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/FieldTph.java b/src/test/java/bytecode/FieldTph.java index 3edb43d1..65c7f291 100644 --- a/src/test/java/bytecode/FieldTph.java +++ b/src/test/java/bytecode/FieldTph.java @@ -24,11 +24,11 @@ public class FieldTph { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/FieldTph.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/FieldTph.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("FieldTph"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/FieldTph2Test.java b/src/test/java/bytecode/FieldTph2Test.java index 2ed19d33..f2b4d413 100644 --- a/src/test/java/bytecode/FieldTph2Test.java +++ b/src/test/java/bytecode/FieldTph2Test.java @@ -25,11 +25,11 @@ public class FieldTph2Test { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/FieldTph2.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/FieldTph2.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("FieldTph2"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/FunOLTest.java b/src/test/java/bytecode/FunOLTest.java index 55aba31c..e46f074a 100644 --- a/src/test/java/bytecode/FunOLTest.java +++ b/src/test/java/bytecode/FunOLTest.java @@ -23,11 +23,11 @@ public class FunOLTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/FunOL.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/FunOL.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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"); /* diff --git a/src/test/java/bytecode/GenTest.java b/src/test/java/bytecode/GenTest.java index 3ed2f3c3..09d283a3 100644 --- a/src/test/java/bytecode/GenTest.java +++ b/src/test/java/bytecode/GenTest.java @@ -20,10 +20,10 @@ public class GenTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Gen.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Gen.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); } diff --git a/src/test/java/bytecode/GreaterEqualTest.java b/src/test/java/bytecode/GreaterEqualTest.java index b60c446c..890dea9e 100644 --- a/src/test/java/bytecode/GreaterEqualTest.java +++ b/src/test/java/bytecode/GreaterEqualTest.java @@ -25,10 +25,10 @@ public class GreaterEqualTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/GreaterEqual.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/GreaterEqual.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); classToTest = loader.loadClass("GreaterEqual"); diff --git a/src/test/java/bytecode/GreaterThanTest.java b/src/test/java/bytecode/GreaterThanTest.java index 1a460a8c..472daa49 100644 --- a/src/test/java/bytecode/GreaterThanTest.java +++ b/src/test/java/bytecode/GreaterThanTest.java @@ -25,10 +25,10 @@ public class GreaterThanTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/GreaterThan.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/GreaterThan.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)}); classToTest = loader.loadClass("GreaterThan"); diff --git a/src/test/java/bytecode/LambdaCapturetest.java b/src/test/java/bytecode/LambdaCapturetest.java index 438c2315..24baaf7a 100644 --- a/src/test/java/bytecode/LambdaCapturetest.java +++ b/src/test/java/bytecode/LambdaCapturetest.java @@ -30,11 +30,11 @@ public class LambdaCapturetest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/LambdaCapture.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/LambdaCapture.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("LambdaCapture"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/LambdaTest.java b/src/test/java/bytecode/LambdaTest.java index d2e69249..5428b333 100644 --- a/src/test/java/bytecode/LambdaTest.java +++ b/src/test/java/bytecode/LambdaTest.java @@ -23,11 +23,11 @@ public class LambdaTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Lambda.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("Lambda"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/LambdaVoidTest.java b/src/test/java/bytecode/LambdaVoidTest.java index ea83dbe0..1a737bd3 100644 --- a/src/test/java/bytecode/LambdaVoidTest.java +++ b/src/test/java/bytecode/LambdaVoidTest.java @@ -23,11 +23,11 @@ public class LambdaVoidTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Lambda.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Lambda.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("Lambda"); instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); diff --git a/src/test/java/bytecode/LessEqualTest.java b/src/test/java/bytecode/LessEqualTest.java index dc439af9..2e39e072 100644 --- a/src/test/java/bytecode/LessEqualTest.java +++ b/src/test/java/bytecode/LessEqualTest.java @@ -25,10 +25,10 @@ public class LessEqualTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/LessEqual.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/LessEqual.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("LessEqual"); diff --git a/src/test/java/bytecode/LessThanTest.java b/src/test/java/bytecode/LessThanTest.java index 99eba80c..98830542 100644 --- a/src/test/java/bytecode/LessThanTest.java +++ b/src/test/java/bytecode/LessThanTest.java @@ -25,10 +25,10 @@ public class LessThanTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/LessThan.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/LessThan.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("LessThan"); diff --git a/src/test/java/bytecode/MatrixOpTest.java b/src/test/java/bytecode/MatrixOpTest.java index 178aa43e..11018701 100644 --- a/src/test/java/bytecode/MatrixOpTest.java +++ b/src/test/java/bytecode/MatrixOpTest.java @@ -28,10 +28,10 @@ public class MatrixOpTest { @Test public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/MatrixOP.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/MatrixOP.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("MatrixOP"); diff --git a/src/test/java/bytecode/MergeTest.java b/src/test/java/bytecode/MergeTest.java index 9f3943ca..d259ee2c 100644 --- a/src/test/java/bytecode/MergeTest.java +++ b/src/test/java/bytecode/MergeTest.java @@ -24,10 +24,10 @@ public class MergeTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Merge.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Merge.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); + compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"); // pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; // loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); // classToTest = loader.loadClass("Merge"); diff --git a/src/test/java/bytecode/OLTest.java b/src/test/java/bytecode/OLTest.java index d6ab4dd1..e438e7f9 100644 --- a/src/test/java/bytecode/OLTest.java +++ b/src/test/java/bytecode/OLTest.java @@ -26,10 +26,10 @@ public class OLTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/OL.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/OL.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("OL"); diff --git a/src/test/java/bytecode/OpTest.java b/src/test/java/bytecode/OpTest.java index 3909f0cd..eeef179b 100644 --- a/src/test/java/bytecode/OpTest.java +++ b/src/test/java/bytecode/OpTest.java @@ -25,10 +25,10 @@ public class OpTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Op.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Op.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Op"); diff --git a/src/test/java/bytecode/OverloadingSortingTest.java b/src/test/java/bytecode/OverloadingSortingTest.java index c6df11cd..bb174d7d 100644 --- a/src/test/java/bytecode/OverloadingSortingTest.java +++ b/src/test/java/bytecode/OverloadingSortingTest.java @@ -26,10 +26,10 @@ public class OverloadingSortingTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Sorting.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Sorting.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); // loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); // classToTest = loader.loadClass("Sorting"); diff --git a/src/test/java/bytecode/OverloadingTest.java b/src/test/java/bytecode/OverloadingTest.java index 6b4bf8eb..4645110e 100644 --- a/src/test/java/bytecode/OverloadingTest.java +++ b/src/test/java/bytecode/OverloadingTest.java @@ -27,10 +27,10 @@ public class OverloadingTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Overloading.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Overloading.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Overloading"); diff --git a/src/test/java/bytecode/PlusTest.java b/src/test/java/bytecode/PlusTest.java index 85f05b75..ac20360f 100644 --- a/src/test/java/bytecode/PlusTest.java +++ b/src/test/java/bytecode/PlusTest.java @@ -24,10 +24,10 @@ public class PlusTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Plus.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Plus.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Plus"); diff --git a/src/test/java/bytecode/PostIncTest.java b/src/test/java/bytecode/PostIncTest.java index 6c3ebc33..902fe221 100644 --- a/src/test/java/bytecode/PostIncTest.java +++ b/src/test/java/bytecode/PostIncTest.java @@ -24,10 +24,10 @@ public class PostIncTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/PostIncDec.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/PostIncDec.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("PostIncDec"); diff --git a/src/test/java/bytecode/PreIncTest.java b/src/test/java/bytecode/PreIncTest.java index 29feac33..ac4e2b55 100644 --- a/src/test/java/bytecode/PreIncTest.java +++ b/src/test/java/bytecode/PreIncTest.java @@ -24,10 +24,10 @@ public class PreIncTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/PreInc.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/PreInc.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://" + pathToClassFile)}); classToTest = loader.loadClass("PreInc"); diff --git a/src/test/java/bytecode/RelOpsTest.java b/src/test/java/bytecode/RelOpsTest.java index 1bdf1a1d..9ffeeca2 100644 --- a/src/test/java/bytecode/RelOpsTest.java +++ b/src/test/java/bytecode/RelOpsTest.java @@ -24,10 +24,10 @@ public class RelOpsTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/RelOps.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/RelOps.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("RelOps"); diff --git a/src/test/java/bytecode/SortingTest.java b/src/test/java/bytecode/SortingTest.java index 2704fc68..4b8abb61 100644 --- a/src/test/java/bytecode/SortingTest.java +++ b/src/test/java/bytecode/SortingTest.java @@ -23,11 +23,11 @@ public class SortingTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Sorting.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Sorting.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + 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("Sorting"); /* diff --git a/src/test/java/bytecode/SubMatTest.java b/src/test/java/bytecode/SubMatTest.java index 8818bd40..000f7569 100644 --- a/src/test/java/bytecode/SubMatTest.java +++ b/src/test/java/bytecode/SubMatTest.java @@ -17,10 +17,10 @@ public class SubMatTest { @Test public void test() throws ClassNotFoundException, IOException { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/SubMatrix.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/SubMatrix.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); } diff --git a/src/test/java/bytecode/Tph2Test.java b/src/test/java/bytecode/Tph2Test.java index f267f45a..ad9c06f0 100644 --- a/src/test/java/bytecode/Tph2Test.java +++ b/src/test/java/bytecode/Tph2Test.java @@ -24,10 +24,10 @@ public class Tph2Test { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph2.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Tph2.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Tph2"); diff --git a/src/test/java/bytecode/Tph3Test.java b/src/test/java/bytecode/Tph3Test.java index 58bc9e64..bc680e7e 100644 --- a/src/test/java/bytecode/Tph3Test.java +++ b/src/test/java/bytecode/Tph3Test.java @@ -21,10 +21,10 @@ public class Tph3Test { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph3.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Tph3.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); } diff --git a/src/test/java/bytecode/Tph5Test.java b/src/test/java/bytecode/Tph5Test.java index 4107cca2..78b2c400 100644 --- a/src/test/java/bytecode/Tph5Test.java +++ b/src/test/java/bytecode/Tph5Test.java @@ -24,10 +24,10 @@ public class Tph5Test { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph5.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Tph5.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Tph5"); diff --git a/src/test/java/bytecode/TphTest.java b/src/test/java/bytecode/TphTest.java index 3f0a7bb3..45bb698a 100644 --- a/src/test/java/bytecode/TphTest.java +++ b/src/test/java/bytecode/TphTest.java @@ -24,10 +24,10 @@ public class TphTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Tph.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Tph.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("Tph"); diff --git a/src/test/java/bytecode/WhileTest.java b/src/test/java/bytecode/WhileTest.java index 67c80c19..f18577d7 100644 --- a/src/test/java/bytecode/WhileTest.java +++ b/src/test/java/bytecode/WhileTest.java @@ -24,10 +24,10 @@ public class WhileTest { @BeforeClass public static void setUpBeforeClass() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/While.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/While.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); - pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; + pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/"; compiler.generateBytecode(pathToClassFile); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTest = loader.loadClass("While"); diff --git a/src/test/java/bytecode/YTest.java b/src/test/java/bytecode/YTest.java index 1c4f13a6..524170eb 100644 --- a/src/test/java/bytecode/YTest.java +++ b/src/test/java/bytecode/YTest.java @@ -23,11 +23,11 @@ public class YTest { @Test public void generateBC() throws Exception { - path = System.getProperty("user.dir")+"/test/bytecode/javFiles/Y.jav"; + path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/Y.jav"; fileToTest = new File(path); // compiler = new JavaTXCompiler(fileToTest); -// compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/"); -// pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; +// 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("Y"); /*