forked from JavaTX/JavaCompilerCore
Add generate BC Code Test
This commit is contained in:
parent
fd7628cb40
commit
a7b9c2a4ee
@ -14,7 +14,6 @@ import org.hamcrest.CoreMatchers;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
|
|
||||||
import de.dhbwstuttgart.core.JavaTXCompiler;
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
import de.dhbwstuttgart.inferWildcards.ConstraintsGenerationUtils;
|
import de.dhbwstuttgart.inferWildcards.ConstraintsGenerationUtils;
|
||||||
import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards;
|
import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards;
|
||||||
@ -125,8 +124,6 @@ public class TestInferWildcardsFields
|
|||||||
|
|
||||||
System.out.println(typeInference);
|
System.out.println(typeInference);
|
||||||
|
|
||||||
List<ResultSet> expectedTypeInferResult = generateExpectedTypeInferResult(wildcardsCompiler);
|
|
||||||
|
|
||||||
assertThat("Type Inference Results containing the correct Wildcard results", typeInference,
|
assertThat("Type Inference Results containing the correct Wildcard results", typeInference,
|
||||||
CoreMatchers.anything());
|
CoreMatchers.anything());
|
||||||
}
|
}
|
||||||
@ -134,16 +131,8 @@ public class TestInferWildcardsFields
|
|||||||
@Test
|
@Test
|
||||||
public void testGenrationBytecode () throws ClassNotFoundException, IOException {
|
public void testGenrationBytecode () throws ClassNotFoundException, IOException {
|
||||||
JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler();
|
JavaTXCompilerWildcards wildcardsCompiler = getWildcardsCompiler();
|
||||||
wildcardsCompiler.getTphMap();
|
|
||||||
|
|
||||||
List<ResultSet> typeinferenceResult = generateExpectedTypeInferResult(wildcardsCompiler);
|
wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC"));
|
||||||
|
|
||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = wildcardsCompiler
|
|
||||||
.getGeneratedGenericResultsForAllSourceFiles(
|
|
||||||
typeinferenceResult);
|
|
||||||
|
|
||||||
wildcardsCompiler.generateBytecode(new File(resourceDirPath + "/generatedBC"), typeinferenceResult,
|
|
||||||
simplifyResultsForAllSourceFiles);
|
|
||||||
|
|
||||||
assertThat("Generation Succeeded", null, CoreMatchers.anything());
|
assertThat("Generation Succeeded", null, CoreMatchers.anything());
|
||||||
}
|
}
|
||||||
|
@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet;
|
|||||||
public class TestInferWildcardsMap
|
public class TestInferWildcardsMap
|
||||||
{
|
{
|
||||||
|
|
||||||
private String resourcePath;
|
private String resourceFilePath;
|
||||||
|
private String resourceDirPath;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup () {
|
public void setup () {
|
||||||
resourcePath = System.getProperty("user.dir")
|
resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards";
|
||||||
+ "/src/test/resources/inferWildcards/TestClassWildcardsMap.java";
|
resourceFilePath = resourceDirPath + "/TestClassWildcardsMap.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompiler(files1);
|
return new JavaTXCompiler(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompilerWildcards(files1);
|
return new JavaTXCompilerWildcards(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +100,17 @@ public class TestInferWildcardsMap
|
|||||||
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
||||||
|
|
||||||
System.out.println(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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,21 +26,23 @@ import de.dhbwstuttgart.typeinference.result.ResultSet;
|
|||||||
public class TestInferWildcardsMapNested
|
public class TestInferWildcardsMapNested
|
||||||
{
|
{
|
||||||
|
|
||||||
private String resourcePath;
|
private String resourceFilePath;
|
||||||
|
private String resourceDirPath;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup () {
|
public void setup () {
|
||||||
resourcePath = System.getProperty("user.dir")
|
resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards";
|
||||||
+ "/src/test/resources/inferWildcards/TestClassWildcardsMapNested.java";
|
resourceFilePath = resourceDirPath + "/TestClassWildcardsMapNested.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompiler(files1);
|
return new JavaTXCompiler(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompilerWildcards(files1);
|
return new JavaTXCompilerWildcards(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +101,17 @@ public class TestInferWildcardsMapNested
|
|||||||
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
||||||
|
|
||||||
System.out.println(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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet;
|
|||||||
public class TestInferWildcardsNested
|
public class TestInferWildcardsNested
|
||||||
{
|
{
|
||||||
|
|
||||||
private String resourcePath;
|
private String resourceFilePath;
|
||||||
|
private String resourceDirPath;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup () {
|
public void setup () {
|
||||||
resourcePath = System.getProperty("user.dir")
|
resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards";
|
||||||
+ "/src/test/resources/inferWildcards/TestClassWildcardsNested.java";
|
resourceFilePath = resourceDirPath + "/TestClassWildcardsNested.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompiler(files1);
|
return new JavaTXCompiler(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompilerWildcards(files1);
|
return new JavaTXCompilerWildcards(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +100,18 @@ public class TestInferWildcardsNested
|
|||||||
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
||||||
|
|
||||||
System.out.println(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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet;
|
|||||||
public class TestInferWildcardsParamType
|
public class TestInferWildcardsParamType
|
||||||
{
|
{
|
||||||
|
|
||||||
private String resourcePath;
|
private String resourceFilePath;
|
||||||
|
private String resourceDirPath;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup () {
|
public void setup () {
|
||||||
resourcePath = System.getProperty("user.dir")
|
resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards";
|
||||||
+ "/src/test/resources/inferWildcards/TestClassWildcardsParamType.java";
|
resourceFilePath = resourceDirPath + "/TestClassWildcardsParamType.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompiler(files1);
|
return new JavaTXCompiler(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompilerWildcards(files1);
|
return new JavaTXCompilerWildcards(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +100,17 @@ public class TestInferWildcardsParamType
|
|||||||
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
||||||
|
|
||||||
System.out.println(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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,21 +26,22 @@ import de.dhbwstuttgart.typeinference.result.ResultSet;
|
|||||||
public class TestInferWildcardsSingle
|
public class TestInferWildcardsSingle
|
||||||
{
|
{
|
||||||
|
|
||||||
private String resourcePath;
|
private String resourceFilePath;
|
||||||
|
private String resourceDirPath;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup () {
|
public void setup () {
|
||||||
resourcePath = System.getProperty("user.dir")
|
resourceDirPath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards";
|
||||||
+ "/src/test/resources/inferWildcards/TestClassWildcardsSingle.java";
|
resourceFilePath = resourceDirPath + "/TestClassWildcardsSingle.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompiler getStandardCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompiler(files1);
|
return new JavaTXCompiler(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
private JavaTXCompilerWildcards getWildcardsCompiler () throws ClassNotFoundException, IOException {
|
||||||
File[] files1 = { new File(resourcePath) };
|
File[] files1 = { new File(resourceFilePath) };
|
||||||
return new JavaTXCompilerWildcards(files1);
|
return new JavaTXCompilerWildcards(files1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,5 +100,17 @@ public class TestInferWildcardsSingle
|
|||||||
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
List<ResultSet> typeInference = wildcardsCompiler.typeInference();
|
||||||
|
|
||||||
System.out.println(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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user