Skip to content

Commit cd59001

Browse files
committed
Update JavaTypeClassDTest.java
1 parent f8499bd commit cd59001

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

microsphere-java-core/src/test/java/io/microsphere/reflect/JavaTypeClassDTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static io.microsphere.reflect.JavaType.EMPTY_JAVA_TYPE_ARRAY;
2929
import static io.microsphere.reflect.JavaType.Kind.CLASS;
3030
import static io.microsphere.reflect.JavaType.Kind.PARAMETERIZED_TYPE;
31+
import static io.microsphere.reflect.JavaType.Kind.UNKNOWN;
3132
import static io.microsphere.reflect.JavaType.from;
3233
import static io.microsphere.reflect.JavaTypeKindTest.C_STRING_PARAMETERIZED_TYPE;
3334
import static io.microsphere.reflect.generics.ParameterizedTypeImpl.of;
@@ -88,6 +89,7 @@ protected void testAs() {
8889
testC();
8990
testB();
9091
testA();
92+
testObject();
9193
}
9294

9395
private void testC() {
@@ -152,4 +154,24 @@ private void testA() {
152154
assertArrayEquals(EMPTY_JAVA_TYPE_ARRAY, aType.getGenericTypes());
153155
}
154156

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+
155177
}

0 commit comments

Comments
 (0)