diff options
Diffstat (limited to 'test/068-classloader/src/Main.java')
-rw-r--r-- | test/068-classloader/src/Main.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/068-classloader/src/Main.java b/test/068-classloader/src/Main.java index 1b2a4a4ceb..361e2938e3 100644 --- a/test/068-classloader/src/Main.java +++ b/test/068-classloader/src/Main.java @@ -21,7 +21,7 @@ public class Main { /** * Main entry point. */ - public static void main(String[] args) { + public static void main(String[] args) throws Exception { FancyLoader loader; loader = new FancyLoader(ClassLoader.getSystemClassLoader()); @@ -60,6 +60,8 @@ public class Main { testIfaceImplement(loader); testSeparation(); + + testClassForName(); } static void testSeparation() { @@ -479,4 +481,13 @@ public class Main { DoubledImplement2 di2 = ifaceSuper.getDoubledInstance2(); di2.one(); } + + static void testClassForName() throws Exception { + System.out.println(Class.forName("Main").toString()); + try { + System.out.println(Class.forName("Main", false, null).toString()); + } catch (ClassNotFoundException expected) { + System.out.println("Got expected ClassNotFoundException"); + } + } } |