2015-11-07 15:21:17 +00:00
|
|
|
package unify;
|
|
|
|
|
2015-11-07 19:37:29 +00:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2015-11-07 15:21:17 +00:00
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
2015-12-26 23:29:23 +00:00
|
|
|
import de.dhbwstuttgart.typeinference.unify.model.MPair;
|
2016-03-13 22:01:28 +00:00
|
|
|
import de.dhbwstuttgart.typeinference.unify.model.MPair.PairOperator;
|
2015-12-26 23:29:23 +00:00
|
|
|
import de.dhbwstuttgart.typeinference.unify.model.Type;
|
2015-11-07 15:21:17 +00:00
|
|
|
|
|
|
|
public class FiniteClosureTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testGreater() {
|
|
|
|
IFiniteClosure fc = new FiniteClosureBuilder().getCollectionExample();
|
|
|
|
TypeFactory tf = new TypeFactory();
|
2015-11-07 19:37:29 +00:00
|
|
|
|
2015-11-07 15:21:17 +00:00
|
|
|
System.out.println("\n\n----- Greater Test -----");
|
|
|
|
System.out.println("Greater(LinkedList<T>) = " + fc.greater(tf.getSimpleType("LinkedList", "T")));
|
|
|
|
System.out.println("Greater(TreeSet<T>) = " + fc.greater(tf.getSimpleType("TreeSet", "T")));
|
|
|
|
System.out.println("Greater(Collection) = " + fc.greater(tf.getSimpleType("Collection")));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testGrArg() {
|
|
|
|
IFiniteClosure fc = new FiniteClosureBuilder().getCollectionExample();
|
|
|
|
TypeFactory tf = new TypeFactory();
|
|
|
|
|
|
|
|
System.out.println("\n\n----- GrArg Test -----");
|
|
|
|
System.out.println("GrArg(List<T>) = " + fc.grArg(tf.getSimpleType("List", "T")));
|
|
|
|
System.out.println("GrArg(? extends List<T>) = " + fc.grArg(tf.getExtendsType(tf.getSimpleType("List", "T"))));
|
|
|
|
System.out.println("GrArg(? super List<T>) = " + fc.grArg(tf.getSuperType(tf.getSimpleType("List", "T"))));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testSmaller() {
|
|
|
|
IFiniteClosure fc = new FiniteClosureBuilder().getCollectionExample();
|
|
|
|
TypeFactory tf = new TypeFactory();
|
|
|
|
|
|
|
|
System.out.println("\n\n----- Smaller Test -----");
|
|
|
|
System.out.println("Smaller(List<T>) = " + fc.smaller(tf.getSimpleType("List", "T")));
|
|
|
|
System.out.println("Smaller(TreeSet<T>) = " + fc.smaller(tf.getSimpleType("TreeSet", "T")));
|
|
|
|
System.out.println("Smaller(Collection) = " + fc.smaller(tf.getSimpleType("Collection")));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testSmArg() {
|
|
|
|
IFiniteClosure fc = new FiniteClosureBuilder().getCollectionExample();
|
|
|
|
TypeFactory tf = new TypeFactory();
|
|
|
|
|
|
|
|
System.out.println("\n\n----- SmArg Test -----");
|
|
|
|
System.out.println("SmArg(List<T>) = " + fc.smArg(tf.getSimpleType("List", "T")));
|
|
|
|
System.out.println("SmArg(? extends List<T>) = " + fc.smArg(tf.getExtendsType(tf.getSimpleType("List", "T"))));
|
|
|
|
System.out.println("SmArg(? super List<T>) = " + fc.smArg(tf.getSuperType(tf.getSimpleType("List", "T"))));
|
|
|
|
}
|
2016-03-13 22:01:28 +00:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testGetGenericType() {
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
}
|
2015-11-07 15:21:17 +00:00
|
|
|
}
|