use of org.springframework.core.MethodParameter in project spring-framework by spring-projects.
the class TypeDescriptorTests method nestedMethodParameterTypeNotNestable.
@Test
public void nestedMethodParameterTypeNotNestable() throws Exception {
TypeDescriptor t1 = TypeDescriptor.nested(new MethodParameter(getClass().getMethod("test5", String.class), 0), 2);
assertNull(t1);
}
use of org.springframework.core.MethodParameter in project spring-framework by spring-projects.
the class TypeDescriptorTests method nestedNotParameterized.
@Test
public void nestedNotParameterized() throws Exception {
TypeDescriptor t1 = TypeDescriptor.nested(new MethodParameter(getClass().getMethod("test6", List.class), 0), 1);
assertEquals(List.class, t1.getType());
assertEquals("java.util.List<?>", t1.toString());
TypeDescriptor t2 = TypeDescriptor.nested(new MethodParameter(getClass().getMethod("test6", List.class), 0), 2);
assertNull(t2);
}
use of org.springframework.core.MethodParameter in project spring-framework by spring-projects.
the class TypeDescriptorTests method nestedMethodParameterTypeMapTwoLevels.
@Test
public void nestedMethodParameterTypeMapTwoLevels() throws Exception {
TypeDescriptor t1 = TypeDescriptor.nested(new MethodParameter(getClass().getMethod("test4", List.class), 0), 2);
assertEquals(String.class, t1.getType());
}
use of org.springframework.core.MethodParameter in project spring-framework by spring-projects.
the class TypeDescriptorTests method parameterScalar.
@Test
public void parameterScalar() throws Exception {
TypeDescriptor desc = new TypeDescriptor(new MethodParameter(getClass().getMethod("testParameterScalar", String.class), 0));
assertEquals(String.class, desc.getType());
assertEquals(String.class, desc.getObjectType());
assertEquals("java.lang.String", desc.getName());
assertEquals("java.lang.String", desc.toString());
assertTrue(!desc.isPrimitive());
assertEquals(0, desc.getAnnotations().length);
assertFalse(desc.isCollection());
assertFalse(desc.isArray());
assertFalse(desc.isMap());
}
use of org.springframework.core.MethodParameter in project spring-framework by spring-projects.
the class TypeDescriptorTests method parameterListNoParamTypes.
@Test
public void parameterListNoParamTypes() throws Exception {
MethodParameter methodParameter = new MethodParameter(getClass().getMethod("testParameterListNoParamTypes", List.class), 0);
TypeDescriptor desc = new TypeDescriptor(methodParameter);
assertEquals(List.class, desc.getType());
assertEquals(List.class, desc.getObjectType());
assertEquals("java.util.List", desc.getName());
assertEquals("java.util.List<?>", desc.toString());
assertTrue(!desc.isPrimitive());
assertEquals(0, desc.getAnnotations().length);
assertTrue(desc.isCollection());
assertFalse(desc.isArray());
assertNull(desc.getElementTypeDescriptor());
assertFalse(desc.isMap());
}
Aggregations