mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
Added some tests for class types
This commit is contained in:
parent
75dda14691
commit
ecce49be5d
@ -103,10 +103,26 @@ public class Reflection {
|
|||||||
throw new OutOfMemoryError();
|
throw new OutOfMemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void classType() throws Exception {
|
||||||
|
// Class types
|
||||||
|
expect(!Reflection.class.isAnonymousClass());
|
||||||
|
expect(!Reflection.class.isLocalClass());
|
||||||
|
expect(!Reflection.class.isMemberClass());
|
||||||
|
|
||||||
|
expect(Reflection.Hello.class.isMemberClass());
|
||||||
|
|
||||||
|
Cloneable anonymousLocal = new Cloneable() {};
|
||||||
|
expect(anonymousLocal.getClass().isAnonymousClass());
|
||||||
|
|
||||||
|
class NamedLocal {}
|
||||||
|
expect(NamedLocal.class.isLocalClass());
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
innerClasses();
|
innerClasses();
|
||||||
annotations();
|
annotations();
|
||||||
genericType();
|
genericType();
|
||||||
|
classType();
|
||||||
|
|
||||||
Class system = Class.forName("java.lang.System");
|
Class system = Class.forName("java.lang.System");
|
||||||
Field out = system.getDeclaredField("out");
|
Field out = system.getDeclaredField("out");
|
||||||
|
Loading…
Reference in New Issue
Block a user