diff --git a/src/test/java/inferWildcards/TestInferWildcardsFields.java b/src/test/java/inferWildcards/TestInferWildcardsFields.java index 1c395566..8bdaf148 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsFields.java +++ b/src/test/java/inferWildcards/TestInferWildcardsFields.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Set; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -17,6 +18,7 @@ import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; import de.dhbwstuttgart.inferWildcards.TypePlaceholderReplaceUtils; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.constraints.Constraint; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; @@ -69,6 +71,13 @@ public class TestInferWildcardsFields ConstraintSet generateConstraints = ConstraintsGenerationUtils.generateConstraints(tphMap); System.out.println(generateConstraints); + + int size = 0; + for (Set> l : generateConstraints.getOderConstraints()) + for (Constraint c : l) + size += c.size(); + + assertThat("Number of Generated Constraints", tphMap.size() * 3, CoreMatchers.is(size)); } @Test diff --git a/src/test/java/inferWildcards/TestInferWildcardsMap.java b/src/test/java/inferWildcards/TestInferWildcardsMap.java index eab2a972..261b4e18 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsMap.java +++ b/src/test/java/inferWildcards/TestInferWildcardsMap.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Set; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -17,6 +18,7 @@ import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; import de.dhbwstuttgart.inferWildcards.TypePlaceholderReplaceUtils; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.constraints.Constraint; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; @@ -69,6 +71,13 @@ public class TestInferWildcardsMap ConstraintSet generateConstraints = ConstraintsGenerationUtils.generateConstraints(tphMap); System.out.println(generateConstraints); + + int size = 0; + for (Set> l : generateConstraints.getOderConstraints()) + for (Constraint c : l) + size += c.size(); + + assertThat("Number of Generated Constraints", tphMap.size() * 3, CoreMatchers.is(size)); } @Test diff --git a/src/test/java/inferWildcards/TestInferWildcardsMapNested.java b/src/test/java/inferWildcards/TestInferWildcardsMapNested.java index c772082c..cb51959c 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsMapNested.java +++ b/src/test/java/inferWildcards/TestInferWildcardsMapNested.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Set; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -17,6 +18,7 @@ import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; import de.dhbwstuttgart.inferWildcards.TypePlaceholderReplaceUtils; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.constraints.Constraint; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; @@ -69,6 +71,13 @@ public class TestInferWildcardsMapNested ConstraintSet generateConstraints = ConstraintsGenerationUtils.generateConstraints(tphMap); System.out.println(generateConstraints); + + int size = 0; + for (Set> l : generateConstraints.getOderConstraints()) + for (Constraint c : l) + size += c.size(); + + assertThat("Number of Generated Constraints", tphMap.size() * 3, CoreMatchers.is(size)); } @Test diff --git a/src/test/java/inferWildcards/TestInferWildcardsNested.java b/src/test/java/inferWildcards/TestInferWildcardsNested.java index 7a7ff548..6ee64b7a 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsNested.java +++ b/src/test/java/inferWildcards/TestInferWildcardsNested.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Set; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -17,6 +18,7 @@ import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; import de.dhbwstuttgart.inferWildcards.TypePlaceholderReplaceUtils; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.constraints.Constraint; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; @@ -69,6 +71,13 @@ public class TestInferWildcardsNested ConstraintSet generateConstraints = ConstraintsGenerationUtils.generateConstraints(tphMap); System.out.println(generateConstraints); + + int size = 0; + for (Set> l : generateConstraints.getOderConstraints()) + for (Constraint c : l) + size += c.size(); + + assertThat("Number of Generated Constraints", tphMap.size() * 3, CoreMatchers.is(size)); } @Test diff --git a/src/test/java/inferWildcards/TestInferWildcardsSingle.java b/src/test/java/inferWildcards/TestInferWildcardsSingle.java index 097106c6..09fdbedb 100644 --- a/src/test/java/inferWildcards/TestInferWildcardsSingle.java +++ b/src/test/java/inferWildcards/TestInferWildcardsSingle.java @@ -6,6 +6,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Set; import org.hamcrest.CoreMatchers; import org.junit.Before; @@ -17,6 +18,7 @@ import de.dhbwstuttgart.inferWildcards.JavaTXCompilerWildcards; import de.dhbwstuttgart.inferWildcards.TypePlaceholderReplaceUtils; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; +import de.dhbwstuttgart.typeinference.constraints.Constraint; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.Pair; import de.dhbwstuttgart.typeinference.result.ResultSet; @@ -69,6 +71,13 @@ public class TestInferWildcardsSingle ConstraintSet generateConstraints = ConstraintsGenerationUtils.generateConstraints(tphMap); System.out.println(generateConstraints); + + int size = 0; + for (Set> l : generateConstraints.getOderConstraints()) + for (Constraint c : l) + size += c.size(); + + assertThat("Number of Generated Constraints", tphMap.size() * 3, CoreMatchers.is(size)); } @Test