use of com.examples.with.different.packagename.generic.GuavaExample4 in project evosuite by EvoSuite.
the class TestGenericAccessibleObject method testGenericMethodFromReturnValueTypeVariable2.
@Test
public void testGenericMethodFromReturnValueTypeVariable2() throws SecurityException, NoSuchMethodException, ConstructionFailedException {
Class<?> targetClass = com.examples.with.different.packagename.generic.GuavaExample4.class;
Method targetMethod = targetClass.getMethod("create", new Class<?>[] {});
GenericMethod genericMethod = new GenericMethod(targetMethod, targetClass);
GenericClass iterableIntegerClass = new GenericClass(new TypeToken<com.examples.with.different.packagename.generic.GuavaExample4<java.lang.Iterable<Integer>>>() {
}.getType());
GenericMethod instantiatedMethod = genericMethod.getGenericInstantiationFromReturnValue(iterableIntegerClass);
System.out.println(instantiatedMethod.getGeneratedClass().toString());
Assert.assertEquals(instantiatedMethod.getGeneratedClass().getRawClass(), GuavaExample4.class);
}
Aggregations