|
28 | 28 | import static io.microsphere.reflect.JavaType.EMPTY_JAVA_TYPE_ARRAY; |
29 | 29 | import static io.microsphere.reflect.JavaType.Kind.CLASS; |
30 | 30 | import static io.microsphere.reflect.JavaType.Kind.PARAMETERIZED_TYPE; |
| 31 | +import static io.microsphere.reflect.JavaType.Kind.UNKNOWN; |
31 | 32 | import static io.microsphere.reflect.JavaType.from; |
32 | 33 | import static io.microsphere.reflect.JavaTypeKindTest.C_STRING_PARAMETERIZED_TYPE; |
33 | 34 | import static io.microsphere.reflect.generics.ParameterizedTypeImpl.of; |
@@ -88,6 +89,7 @@ protected void testAs() { |
88 | 89 | testC(); |
89 | 90 | testB(); |
90 | 91 | testA(); |
| 92 | + testObject(); |
91 | 93 | } |
92 | 94 |
|
93 | 95 | private void testC() { |
@@ -152,4 +154,24 @@ private void testA() { |
152 | 154 | assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, aType.getGenericTypes()); |
153 | 155 | } |
154 | 156 |
|
| 157 | + private void testObject() { |
| 158 | + JavaType objectType = javaType.as(Object.class); |
| 159 | + |
| 160 | + // test source |
| 161 | + assertEquals(javaType, objectType.getSource()); |
| 162 | + assertEquals(source(), objectType.getRootSource()); |
| 163 | + |
| 164 | + // test super type |
| 165 | + assertEquals(from(null, UNKNOWN, objectType), objectType.getSuperType()); |
| 166 | + assertEquals(from(null, UNKNOWN, objectType), objectType.getSuperType()); |
| 167 | + |
| 168 | + // test interfaces |
| 169 | + assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, objectType.getInterfaces()); |
| 170 | + assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, objectType.getInterfaces()); |
| 171 | + |
| 172 | + // test generic types |
| 173 | + assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, objectType.getGenericTypes()); |
| 174 | + assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, objectType.getGenericTypes()); |
| 175 | + } |
| 176 | + |
155 | 177 | } |
0 commit comments