forked from JavaTX/JavaCompilerCore
modified: src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
equals korrigiert modified: src/test/java/insertGenerics/TestGGFinder.java modified: src/test/java/insertGenerics/TestLocalVarLambda.java modified: src/test/java/insertGenerics/TestMutualRecursion.java modified: src/test/java/insertGenerics/TestTPHsAndGenerics.java modified: src/test/java/insertGenerics/TestTwoArgs.java modified: src/test/java/insertGenerics/TestTwoCalls.java modified: src/test/java/insertGenerics/TestVector.java List -> Set vollendet
This commit is contained in:
parent
d276c7c044
commit
86603ae343
@ -58,7 +58,9 @@ public class TPHConstraint {
|
|||||||
public boolean equals (Object o) {
|
public boolean equals (Object o) {
|
||||||
if (o instanceof TPHConstraint) {
|
if (o instanceof TPHConstraint) {
|
||||||
TPHConstraint o_tphcons = (TPHConstraint)o;
|
TPHConstraint o_tphcons = (TPHConstraint)o;
|
||||||
return (left+right).equals(o_tphcons.getLeft()+o_tphcons.getRight());
|
return (this.left.equals(o_tphcons.getLeft())
|
||||||
|
&& this.right.equals(o_tphcons.getRight())
|
||||||
|
&& this.rel.equals(o_tphcons.rel));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -56,16 +56,16 @@ public class TestGGFinder {
|
|||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
classConstraintsTest.add(new ClassConstraint("S", "java/lang/Object", Relation.EXTENDS));
|
classConstraintsTest.add(new ClassConstraint("S", "java/lang/Object", Relation.EXTENDS));
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("P", "AC", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("P", "AC", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AC", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AC", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ACid(TPH P)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ACid(TPH P)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("T", "S", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("T", "S", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH SsetA(TPH T)", lmc);
|
methodConstraintsWithPositionTest.put("TPH SsetA(TPH T)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AC", "Y", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AC", "Y", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("Z", "P", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("Z", "P", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("P", "AC", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("P", "AC", Relation.EXTENDS));
|
||||||
@ -78,7 +78,10 @@ public class TestGGFinder {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
|
@ -55,12 +55,12 @@ public class TestLocalVarLambda {
|
|||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
|
|
||||||
FamilyOfGeneratedGenerics fogg = compiler.fogg;
|
FamilyOfGeneratedGenerics fogg = compiler.fogg;
|
||||||
|
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
|
|
||||||
if (fogg.allConstraints.contains((new MethodConstraint("O", "ALU", Relation.EXTENDS)))) {
|
if (fogg.allConstraints.contains((new MethodConstraint("O", "ALU", Relation.EXTENDS)))) {
|
||||||
lmc.add(new MethodConstraint("O", "ALU", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("O", "ALU", Relation.EXTENDS));
|
||||||
@ -79,7 +79,10 @@ public class TestLocalVarLambda {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
|
@ -49,18 +49,19 @@ public class TestMutualRecursion {
|
|||||||
|
|
||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
classConstraintsTest.add(new ClassConstraint("N", "java/lang/Object", Relation.EXTENDS));
|
||||||
List<MethodConstraint> lmc;
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
lmc = new ArrayList<>();
|
Set<MethodConstraint> lmc;
|
||||||
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("P", "Q", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("P", "Q", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("Q", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("Q", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ALid(TPH P)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ALid(TPH P)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("Z", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("Z", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ALm(TPH ALTPH Z)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ALm(TPH ALTPH Z)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AG", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AG", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AH", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AH", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AL", "java/lang/Object", Relation.EXTENDS));
|
||||||
@ -72,7 +73,10 @@ public class TestMutualRecursion {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
|
@ -56,12 +56,12 @@ public class TestTPHsAndGenerics {
|
|||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
|
|
||||||
FamilyOfGeneratedGenerics fogg = compiler.fogg;
|
FamilyOfGeneratedGenerics fogg = compiler.fogg;
|
||||||
|
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
|
|
||||||
if (fogg.allConstraints.contains((new MethodConstraint("DZP", "ETW", Relation.EXTENDS)))) {
|
if (fogg.allConstraints.contains((new MethodConstraint("DZP", "ETW", Relation.EXTENDS)))) {
|
||||||
classConstraintsTest.add(new ClassConstraint("UD", "DZP", Relation.EXTENDS));
|
classConstraintsTest.add(new ClassConstraint("UD", "DZP", Relation.EXTENDS));
|
||||||
@ -74,10 +74,10 @@ public class TestTPHsAndGenerics {
|
|||||||
lmc.add(new MethodConstraint("AE", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AE", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ABm(TPH ABTPH AD)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ABm(TPH ABTPH AD)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("V", "UD", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("V", "UD", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ETWid2(TPH V)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ETWid2(TPH V)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc);
|
methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc);
|
||||||
}
|
}
|
||||||
@ -92,10 +92,10 @@ public class TestTPHsAndGenerics {
|
|||||||
lmc.add(new MethodConstraint("AE", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AE", "java/lang/Object", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ABm(TPH ABTPH AD)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ABm(TPH ABTPH AD)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("V", "ETW", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("V", "ETW", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ETWid2(TPH V)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ETWid2(TPH V)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc);
|
methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc);
|
||||||
}
|
}
|
||||||
@ -105,7 +105,10 @@ public class TestTPHsAndGenerics {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
|
@ -61,20 +61,20 @@ public class TestTwoArgs {
|
|||||||
classConstraintsTest.add(new ClassConstraint("P", "AL", Relation.EXTENDS));
|
classConstraintsTest.add(new ClassConstraint("P", "AL", Relation.EXTENDS));
|
||||||
classConstraintsTest.add(new ClassConstraint("AL", "AF", Relation.EXTENDS));
|
classConstraintsTest.add(new ClassConstraint("AL", "AF", Relation.EXTENDS));
|
||||||
classConstraintsTest.add(new ClassConstraint("AF", "java/lang/Object", Relation.EXTENDS));
|
classConstraintsTest.add(new ClassConstraint("AF", "java/lang/Object", Relation.EXTENDS));
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("P", "AL", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("P", "AL", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH ALid(TPH P)", lmc);
|
methodConstraintsWithPositionTest.put("TPH ALid(TPH P)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AL", "AF", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AL", "AF", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("Z", "P", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("Z", "P", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("P", "AL", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("P", "AL", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH AFm(TPH AFTPH Z)", lmc);
|
methodConstraintsWithPositionTest.put("TPH AFm(TPH AFTPH Z)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("T", "AP", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("T", "AP", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH APsetA(TPH T)", lmc);
|
methodConstraintsWithPositionTest.put("TPH APsetA(TPH T)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("AG", "P", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AG", "P", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("AH", "T", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("AH", "T", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("T", "AP", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("T", "AP", Relation.EXTENDS));
|
||||||
@ -86,7 +86,10 @@ public class TestTwoArgs {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
|
@ -55,13 +55,13 @@ public class TestTwoCalls {
|
|||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("O", "R", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("O", "R", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("R", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("R", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH Rid(TPH O)", lmc);
|
methodConstraintsWithPositionTest.put("TPH Rid(TPH O)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("T", "O", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("T", "O", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("O", "R", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("O", "R", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("R", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("R", "java/lang/Object", Relation.EXTENDS));
|
||||||
@ -73,7 +73,11 @@ public class TestTwoCalls {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
|
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
classToTest = loader.loadClass(className);
|
classToTest = loader.loadClass(className);
|
||||||
|
@ -55,14 +55,14 @@ public class TestVector {
|
|||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(results);
|
||||||
|
|
||||||
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
List<ClassConstraint> classConstraintsTest = new ArrayList<>();
|
||||||
HashMap<String, List<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionTest = new HashMap<>();
|
||||||
List<MethodConstraint> lmc;
|
Set<MethodConstraint> lmc;
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("T", "W", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("T", "W", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("W", "ZU", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("W", "ZU", Relation.EXTENDS));
|
||||||
lmc.add(new MethodConstraint("ZU", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("ZU", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("voidm(java/util/Vectorjava/util/Vector)", lmc);
|
methodConstraintsWithPositionTest.put("voidm(java/util/Vectorjava/util/Vector)", lmc);
|
||||||
lmc = new ArrayList<>();
|
lmc = new HashSet<>();
|
||||||
lmc.add(new MethodConstraint("W", "java/lang/Object", Relation.EXTENDS));
|
lmc.add(new MethodConstraint("W", "java/lang/Object", Relation.EXTENDS));
|
||||||
methodConstraintsWithPositionTest.put("TPH Wid(TPH W)", lmc);
|
methodConstraintsWithPositionTest.put("TPH Wid(TPH W)", lmc);
|
||||||
|
|
||||||
@ -72,7 +72,10 @@ public class TestVector {
|
|||||||
|
|
||||||
assertEquals(expectedClassCons, computedClassCons);
|
assertEquals(expectedClassCons, computedClassCons);
|
||||||
|
|
||||||
assertEquals(methodConstraintsWithPositionTest, fogg.methodConstraintsWithPosition);
|
HashMap<String, Set<MethodConstraint>> methodConstraintsWithPositionComputed = new HashMap<>();
|
||||||
|
fogg.methodConstraintsWithPosition.forEach((s, l) -> methodConstraintsWithPositionComputed.put(s,new HashSet<>(l)));
|
||||||
|
|
||||||
|
assertEquals(methodConstraintsWithPositionTest, methodConstraintsWithPositionComputed);
|
||||||
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile), results, simplifyResultsForAllSourceFiles);
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
classToTest = loader.loadClass(className);
|
classToTest = loader.loadClass(className);
|
||||||
|
Loading…
Reference in New Issue
Block a user