use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.
the class TestGenericClass method testWildcardIntegerBoundaries.
@Test
public void testWildcardIntegerBoundaries() {
WildcardType objectType = new WildcardTypeImpl(new Type[] { Integer.class }, new Type[] {});
GenericClass integerClass = new GenericClass(Integer.class);
GenericClass comparableClass = new GenericClass(Comparable.class);
GenericClass dateClass = new GenericClass(java.util.Date.class);
GenericClass sqlDateClass = new GenericClass(java.sql.Date.class);
Assert.assertTrue(integerClass.satisfiesBoundaries(objectType));
Assert.assertFalse(comparableClass.satisfiesBoundaries(objectType));
Assert.assertFalse(dateClass.satisfiesBoundaries(objectType));
Assert.assertFalse(sqlDateClass.satisfiesBoundaries(objectType));
}
use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.
the class TestGenericClass method testWildcardNumberBoundaries.
@Test
public void testWildcardNumberBoundaries() {
WildcardType objectType = new WildcardTypeImpl(new Type[] { Number.class }, new Type[] {});
GenericClass integerClass = new GenericClass(Integer.class);
GenericClass comparableClass = new GenericClass(Comparable.class);
GenericClass dateClass = new GenericClass(java.util.Date.class);
GenericClass sqlDateClass = new GenericClass(java.sql.Date.class);
Assert.assertTrue(integerClass.satisfiesBoundaries(objectType));
Assert.assertFalse(comparableClass.satisfiesBoundaries(objectType));
Assert.assertFalse(dateClass.satisfiesBoundaries(objectType));
Assert.assertFalse(sqlDateClass.satisfiesBoundaries(objectType));
}
use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.
the class TestGenericClass method testWildcardInvalidBoundaries.
@Test
public void testWildcardInvalidBoundaries() {
WildcardType objectType = new WildcardTypeImpl(new Type[] { Number.class }, new Type[] { java.util.Date.class });
GenericClass integerClass = new GenericClass(Integer.class);
GenericClass comparableClass = new GenericClass(Comparable.class);
GenericClass dateClass = new GenericClass(java.util.Date.class);
GenericClass sqlDateClass = new GenericClass(java.sql.Date.class);
Assert.assertFalse(integerClass.satisfiesBoundaries(objectType));
Assert.assertFalse(comparableClass.satisfiesBoundaries(objectType));
Assert.assertFalse(dateClass.satisfiesBoundaries(objectType));
Assert.assertFalse(sqlDateClass.satisfiesBoundaries(objectType));
}
use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.
the class TestGenericClass method testWildcardDateSuperBoundaries.
@Test
public void testWildcardDateSuperBoundaries() {
WildcardType objectType = new WildcardTypeImpl(new Type[] { Object.class }, new Type[] { java.util.Date.class });
GenericClass integerClass = new GenericClass(Integer.class);
GenericClass comparableClass = new GenericClass(Comparable.class);
GenericClass dateClass = new GenericClass(java.util.Date.class);
GenericClass sqlDateClass = new GenericClass(java.sql.Date.class);
Assert.assertFalse(integerClass.satisfiesBoundaries(objectType));
Assert.assertFalse(comparableClass.satisfiesBoundaries(objectType));
Assert.assertTrue(dateClass.satisfiesBoundaries(objectType));
Assert.assertFalse(sqlDateClass.satisfiesBoundaries(objectType));
}
use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.
the class TestGenericClass method testWildcardComparableBoundaries.
@Test
public void testWildcardComparableBoundaries() {
WildcardType objectType = new WildcardTypeImpl(new Type[] { Comparable.class }, new Type[] {});
GenericClass integerClass = new GenericClass(Integer.class);
GenericClass comparableClass = new GenericClass(Comparable.class);
GenericClass dateClass = new GenericClass(java.util.Date.class);
GenericClass sqlDateClass = new GenericClass(java.sql.Date.class);
Assert.assertTrue(integerClass.satisfiesBoundaries(objectType));
Assert.assertTrue(comparableClass.satisfiesBoundaries(objectType));
Assert.assertTrue(dateClass.satisfiesBoundaries(objectType));
Assert.assertTrue(sqlDateClass.satisfiesBoundaries(objectType));
}
Aggregations