Skip to content

Commit

Permalink
Add test for Java 9 module system detection
Browse files Browse the repository at this point in the history
  • Loading branch information
uschindler committed Oct 3, 2017
1 parent d750767 commit a52cd69
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/de/thetaphi/forbiddenapis/CheckerSetupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,19 @@ public void testSignaturePolymorphic() throws Exception {
}
}

@Test
public void testJava9ModuleSystemFallback() {
final Class<?> moduleClass;
try {
moduleClass = Class.forName("java.lang.Module");
} catch (ClassNotFoundException cfe) {
assumeNoException("This test only works with Java 9+", cfe);
return;
}
assertNotNull(checker.method_Class_getModule);
assertSame(moduleClass, checker.method_Class_getModule.getReturnType());
assertNotNull(checker.method_Module_getName);
assertSame(moduleClass, checker.method_Module_getName.getDeclaringClass());
}

}

0 comments on commit a52cd69

Please sign in to comment.