diff options
author | 2015-04-22 03:48:14 +0000 | |
---|---|---|
committer | 2015-04-22 03:48:14 +0000 | |
commit | c2725c2c950b9372cd61d00accfc3c6bdab9e21c (patch) | |
tree | f33f3c24d65dc128d709fd89abe4bcf6f919e463 /test/068-classloader/src | |
parent | 08faf72e16a3b73b205e9f1ca618470b78174d4e (diff) | |
parent | 598854726a5d50c18fa720af6b097279e5e01584 (diff) |
Merge "Class.forName(..., ..., null) fixes - Add test for Class.forName(..., ..., null) - Simplify VMStack.getClosestUserClassLoader based on new behavior of Class.forName(..., ..., null)"
Diffstat (limited to 'test/068-classloader/src')
-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"); + } + } } |