diff --git a/src/test/java/inferWildcards/TestInferWildcardsFields.java b/src/test/java/inferWildcards/TestInferWildcardsFields.java index 51467c03..1bb2fca7 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsFields.java +++ b/src/test/java/inferWildcards/TestInferWildcardsFields.java @@ -14,7 +14,6 @@ import org.hamcrest.CoreMatchers; import org.junit.Before; import org.junit.Test; -import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.inferWildcards.ConstraintsGenerationUtils; import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; @@ -125,8 +124,6 @@ public class TestInferWildcardsFields System.out.println(typeInference); - List expectedTypeInferResult = generateExpectedTypeInferResult(wildcardsCompiler); - assertThat("Type Inference Results containing the correct Wildcard results", typeInference, CoreMatchers.anything()); } @@ -134,16 +131,8 @@ public class TestInferWildcardsFields @Test public void testGenrationBytecode () throws ClassNotFoundException, IOException { JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); - wildcardsCompiler.getTphMap(); - List typeinferenceResult = generateExpectedTypeInferResult(wildcardsCompiler); - - List simplifyResultsForAllSourceFiles = wildcardsCompiler - .getGeneratedGenericResultsForAllSourceFiles( - typeinferenceResult); - - wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC"), typeinferenceResult, - simplifyResultsForAllSourceFiles); + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); assertThat("Generation Succeeded", null, CoreMatchers.anything()); } diff --git a/src/test/java/inferWildcards/TestInferWildcardsMap.java b/src/test/java/inferWildcards/TestInferWildcardsMap.java index 497e75c6..27d21198 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsMap.java +++ b/src/test/java/inferWildcards/TestInferWildcardsMap.java @@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet; public class TestInferWildcardsMap { - private String resourcePath; + private String resourceFilePath; + private String resourceDirPath; @Before public void setup () { - resourcePath = System.getProperty("user.dir") - + "/src/test/resources/inferWildcards/TestClassWildcardsMap.java"; + resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; + resourceFilePath = resourceDirPath + "/TestClassWildcardsMap.java"; } private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompiler(files1); } private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompilerWildcards(files1); } @@ -99,5 +100,17 @@ public class TestInferWildcardsMap List typeInference = wildcardsCompiler.typeInference(); System.out.println(typeInference); + + assertThat("Type Inference Results containing the correct Wildcard results", typeInference, + CoreMatchers.anything()); + } + + @Test + public void testGenrationBytecode () throws ClassNotFoundException, IOException { + JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); + + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); + + assertThat("Generation Succeeded", null, CoreMatchers.anything()); } } diff --git a/src/test/java/inferWildcards/TestInferWildcardsMapNested.java b/src/test/java/inferWildcards/TestInferWildcardsMapNested.java index 5f99c5ce..d884c828 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsMapNested.java +++ b/src/test/java/inferWildcards/TestInferWildcardsMapNested.java @@ -26,21 +26,23 @@ import de.dhbwstuttgart.typeinference.result.ResultSet; public class TestInferWildcardsMapNested { - private String resourcePath; + private String resourceFilePath; + private String resourceDirPath; @Before public void setup () { - resourcePath = System.getProperty("user.dir") - + "/src/test/resources/inferWildcards/TestClassWildcardsMapNested.java"; + resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; + resourceFilePath = resourceDirPath + "/TestClassWildcardsMapNested.java"; } + private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompiler(files1); } private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompilerWildcards(files1); } @@ -99,5 +101,17 @@ public class TestInferWildcardsMapNested List typeInference = wildcardsCompiler.typeInference(); System.out.println(typeInference); + + assertThat("Type Inference Results containing the correct Wildcard results", typeInference, + CoreMatchers.anything()); + } + + @Test + public void testGenrationBytecode () throws ClassNotFoundException, IOException { + JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); + + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); + + assertThat("Generation Succeeded", null, CoreMatchers.anything()); } } diff --git a/src/test/java/inferWildcards/TestInferWildcardsNested.java b/src/test/java/inferWildcards/TestInferWildcardsNested.java index 1b0ab1f5..5f936c08 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsNested.java +++ b/src/test/java/inferWildcards/TestInferWildcardsNested.java @@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet; public class TestInferWildcardsNested { - private String resourcePath; + private String resourceFilePath; + private String resourceDirPath; @Before public void setup () { - resourcePath = System.getProperty("user.dir") - + "/src/test/resources/inferWildcards/TestClassWildcardsNested.java"; + resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; + resourceFilePath = resourceDirPath + "/TestClassWildcardsNested.java"; } private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompiler(files1); } private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompilerWildcards(files1); } @@ -99,5 +100,18 @@ public class TestInferWildcardsNested List typeInference = wildcardsCompiler.typeInference(); System.out.println(typeInference); + + assertThat("Type Inference Results containing the correct Wildcard results", typeInference, + CoreMatchers.anything()); } + + @Test + public void testGenrationBytecode () throws ClassNotFoundException, IOException { + JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); + + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); + + assertThat("Generation Succeeded", null, CoreMatchers.anything()); + } + } diff --git a/src/test/java/inferWildcards/TestInferWildcardsParamType.java b/src/test/java/inferWildcards/TestInferWildcardsParamType.java index 17c3cbd6..fc28ec7d 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsParamType.java +++ b/src/test/java/inferWildcards/TestInferWildcardsParamType.java @@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet; public class TestInferWildcardsParamType { - private String resourcePath; + private String resourceFilePath; + private String resourceDirPath; @Before public void setup () { - resourcePath = System.getProperty("user.dir") - + "/src/test/resources/inferWildcards/TestClassWildcardsParamType.java"; + resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; + resourceFilePath = resourceDirPath + "/TestClassWildcardsParamType.java"; } private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompiler(files1); } private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompilerWildcards(files1); } @@ -99,5 +100,17 @@ public class TestInferWildcardsParamType List typeInference = wildcardsCompiler.typeInference(); System.out.println(typeInference); + + assertThat("Type Inference Results containing the correct Wildcard results", typeInference, + CoreMatchers.anything()); + } + + @Test + public void testGenrationBytecode () throws ClassNotFoundException, IOException { + JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); + + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); + + assertThat("Generation Succeeded", null, CoreMatchers.anything()); } } diff --git a/src/test/java/inferWildcards/TestInferWildcardsSingle.java b/src/test/java/inferWildcards/TestInferWildcardsSingle.java index 0d871de7..11cc9b27 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsSingle.java +++ b/src/test/java/inferWildcards/TestInferWildcardsSingle.java @@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet; public class TestInferWildcardsSingle { - private String resourcePath; + private String resourceFilePath; + private String resourceDirPath; @Before public void setup () { - resourcePath = System.getProperty("user.dir") - + "/src/test/resources/inferWildcards/TestClassWildcardsSingle.java"; + resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; + resourceFilePath = resourceDirPath + "/TestClassWildcardsSingle.java"; } private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompiler(files1); } private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException { - File[] files1 = { new File(resourcePath) }; + File[] files1 = { new File(resourceFilePath) }; return new JavaTXCompilerWildcards(files1); } @@ -99,5 +100,17 @@ public class TestInferWildcardsSingle List typeInference = wildcardsCompiler.typeInference(); System.out.println(typeInference); + + assertThat("Type Inference Results containing the correct Wildcard results", typeInference, + CoreMatchers.anything()); + } + + @Test + public void testGenrationBytecode () throws ClassNotFoundException, IOException { + JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler(); + + wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC")); + + assertThat("Generation Succeeded", null, CoreMatchers.anything()); } }