Search in sources :

Example 11 with WildcardTypeImpl

use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.

the class TestGenericClass method testWildcardObjectBoundaries.

@Test
public void testWildcardObjectBoundaries() {
    WildcardType objectType = new WildcardTypeImpl(new Type[] { Object.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));
}
Also used : WildcardType(java.lang.reflect.WildcardType) WildcardTypeImpl(org.evosuite.utils.generic.WildcardTypeImpl) GenericClass(org.evosuite.utils.generic.GenericClass) Test(org.junit.Test)

Example 12 with WildcardTypeImpl

use of org.evosuite.utils.generic.WildcardTypeImpl in project evosuite by EvoSuite.

the class TestGenericClass method testWildcardSqlDateBoundaries.

@Test
public void testWildcardSqlDateBoundaries() {
    WildcardType objectType = new WildcardTypeImpl(new Type[] { java.sql.Date.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.assertFalse(integerClass.satisfiesBoundaries(objectType));
    Assert.assertFalse(comparableClass.satisfiesBoundaries(objectType));
    Assert.assertFalse(dateClass.satisfiesBoundaries(objectType));
    Assert.assertTrue(sqlDateClass.satisfiesBoundaries(objectType));
}
Also used : WildcardType(java.lang.reflect.WildcardType) WildcardTypeImpl(org.evosuite.utils.generic.WildcardTypeImpl) GenericClass(org.evosuite.utils.generic.GenericClass) Test(org.junit.Test)

Aggregations

WildcardTypeImpl (org.evosuite.utils.generic.WildcardTypeImpl)12 Test (org.junit.Test)12 WildcardType (java.lang.reflect.WildcardType)10 GenericClass (org.evosuite.utils.generic.GenericClass)10 AbstractEnumInInnerClass (com.examples.with.different.packagename.AbstractEnumInInnerClass)2 EnumInInnerClass (com.examples.with.different.packagename.EnumInInnerClass)2 Method (java.lang.reflect.Method)2 Type (java.lang.reflect.Type)2 GenericConstructor (org.evosuite.utils.generic.GenericConstructor)2 GenericMethod (org.evosuite.utils.generic.GenericMethod)2