本文整理汇总了Java中org.apache.ibatis.reflection.typeparam.Level1Mapper类的典型用法代码示例。如果您正苦于以下问题:Java Level1Mapper类的具体用法?Java Level1Mapper怎么用?Java Level1Mapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Level1Mapper类属于org.apache.ibatis.reflection.typeparam包,在下文中一共展示了Level1Mapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReturn_SimpleVoid
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleVoid() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectVoid", Integer.class);
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertEquals(void.class, result);
}
示例2: testReturn_SimplePrimitive
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimplePrimitive() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectPrimitive", int.class);
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertEquals(double.class, result);
}
示例3: testReturn_SimpleClass
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleClass() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelect");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertEquals(Double.class, result);
}
示例4: testReturn_SimpleList
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleList() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectList");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof ParameterizedType);
ParameterizedType paramType = (ParameterizedType) result;
assertEquals(List.class, paramType.getRawType());
assertEquals(1, paramType.getActualTypeArguments().length);
assertEquals(Double.class, paramType.getActualTypeArguments()[0]);
}
示例5: testReturn_SimpleMap
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleMap() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectMap");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof ParameterizedType);
ParameterizedType paramType = (ParameterizedType) result;
assertEquals(Map.class, paramType.getRawType());
assertEquals(2, paramType.getActualTypeArguments().length);
assertEquals(Integer.class, paramType.getActualTypeArguments()[0]);
assertEquals(Double.class, paramType.getActualTypeArguments()[1]);
}
示例6: testReturn_SimpleWildcard
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleWildcard() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectWildcard");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof ParameterizedType);
ParameterizedType paramType = (ParameterizedType) result;
assertEquals(List.class, paramType.getRawType());
assertEquals(1, paramType.getActualTypeArguments().length);
assertTrue(paramType.getActualTypeArguments()[0] instanceof WildcardType);
WildcardType wildcard = (WildcardType) paramType.getActualTypeArguments()[0];
assertEquals(String.class, wildcard.getUpperBounds()[0]);
}
示例7: testReturn_SimpleArray
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleArray() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectArray");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof Class);
Class<?> resultClass = (Class<?>) result;
assertTrue(resultClass.isArray());
assertEquals(String.class, resultClass.getComponentType());
}
示例8: testReturn_SimpleArrayOfArray
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleArrayOfArray() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectArrayOfArray");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof Class);
Class<?> resultClass = (Class<?>) result;
assertTrue(resultClass.isArray());
assertTrue(resultClass.getComponentType().isArray());
assertEquals(String.class, resultClass.getComponentType().getComponentType());
}
示例9: testReturn_SimpleTypeVar
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_SimpleTypeVar() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectTypeVar");
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertEquals(Object.class, result);
}
示例10: testReturn_Lv1Class
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv1Class() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("select", Object.class);
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertEquals(String.class, result);
}
示例11: testReturn_Lv1List
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv1List() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("selectList", Object.class, Object.class);
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof ParameterizedType);
ParameterizedType type = (ParameterizedType) result;
assertEquals(List.class, type.getRawType());
assertEquals(1, type.getActualTypeArguments().length);
assertEquals(String.class, type.getActualTypeArguments()[0]);
}
示例12: testReturn_Lv1Array
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testReturn_Lv1Array() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("selectArray", List[].class);
Type result = TypeParameterResolver.resolveReturnType(method, clazz);
assertTrue(result instanceof Class);
Class<?> resultClass = (Class<?>) result;
assertTrue(resultClass.isArray());
assertEquals(String.class, resultClass.getComponentType());
}
示例13: testParam_Simple
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testParam_Simple() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("simpleSelectVoid", Integer.class);
Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
assertEquals(1, result.length);
assertEquals(Integer.class, result[0]);
}
示例14: testParam_Lv1Single
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testParam_Lv1Single() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("select", Object.class);
Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
assertEquals(1, result.length);
assertEquals(String.class, result[0]);
}
示例15: testParam_Lv1Array
import org.apache.ibatis.reflection.typeparam.Level1Mapper; //导入依赖的package包/类
@Test
public void testParam_Lv1Array() throws Exception {
Class<?> clazz = Level1Mapper.class;
Method method = clazz.getMethod("selectArray", List[].class);
Type[] result = TypeParameterResolver.resolveParamTypes(method, clazz);
assertTrue(result[0] instanceof GenericArrayType);
GenericArrayType genericArrayType = (GenericArrayType) result[0];
assertTrue(genericArrayType.getGenericComponentType() instanceof ParameterizedType);
ParameterizedType paramType = (ParameterizedType) genericArrayType.getGenericComponentType();
assertEquals(List.class, paramType.getRawType());
assertEquals(String.class, paramType.getActualTypeArguments()[0]);
}