diff --git a/src/test/java/inferWildcards/TestInferWildcards.java b/src/test/java/inferWildcards/TestInferWildcards.java deleted file mode 100644 index dcfd17b4..00000000 --- a/src/test/java/inferWildcards/TestInferWildcards.java +++ /dev/null @@ -1,69 +0,0 @@ -package inferWildcards; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Map; - -import javax.tools.JavaCompiler; -import javax.tools.JavaFileObject; -import javax.tools.StandardJavaFileManager; -import javax.tools.ToolProvider; - -import org.junit.Before; -import org.junit.Test; - -import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.Tree; -import com.sun.source.util.JavacTask; - -import de.dhbwstuttgart.inferWildcards.InferWildcardsVisitor; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; - -public class TestInferWildcards -{ - - private JavaCompiler compiler; - private StandardJavaFileManager fileManager; - - @Before - public void setup () { - compiler = ToolProvider.getSystemJavaCompiler(); - fileManager = compiler.getStandardFileManager(null, null, null); - } - - private Iterable parse (File[] files) throws IOException { - Iterable compilationUnits1 = fileManager - .getJavaFileObjectsFromFiles(Arrays.asList(files)); - JavacTask task = (JavacTask) compiler.getTask(null, fileManager, null, null, null, compilationUnits1); - return task.parse(); - } - - @Test - public void test () throws Exception { - String resourcePath = System.getProperty("user.dir") + "/src/test/resources/inferWildcards"; - File[] files1 = { new File(resourcePath + "/TestClassWildcards.java") }; - - Iterable iterable = parse(files1); - for (CompilationUnitTree t : iterable) { - System.out.println("unit: " + t.toString()); - - testUnit(t); - } - } - - @SuppressWarnings("rawtypes") - private void testUnit (CompilationUnitTree t) { - InferWildcardsVisitor inferWildcardsVisitor = new InferWildcardsVisitor(); - t.accept(inferWildcardsVisitor, null); - - // Generated Constraints - ConstraintSet constraintSet = inferWildcardsVisitor.getConstraintSet(); - System.out.println("Constraints: " + constraintSet); - - // Generated TPH - Map placeholderMapping = inferWildcardsVisitor.getPlaceholderMapping(); - System.out.println("Placeholder: " + placeholderMapping.toString()); - } -}