changeset 7815:c279bf41a35c

Add test cases for null and empty module version and location values.
author hseigel
date Thu, 12 Feb 2015 15:48:02 -0500
parents bdf226dac421
children 6304c4530d95
files test/runtime/modules/JVMDefineModule.java
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/runtime/modules/JVMDefineModule.java	Thu Feb 12 12:09:46 2015 -0500
+++ b/test/runtime/modules/JVMDefineModule.java	Thu Feb 12 15:48:02 2015 -0500
@@ -172,6 +172,22 @@
         } catch(IllegalArgumentException e) {
             // Expected
         }
+
+        // module version that is null, should be okay
+        m = ModuleHelper.DefineModule("module8", null, "/not/here", cl, new String[] { "a_package_8" });
+        assertNotNull(m, "Module should not be null");
+
+        // module version that is "", should be okay
+        m = ModuleHelper.DefineModule("module9", "", "/not/here", cl, new String[] { "a_package_9" });
+        assertNotNull(m, "Module should not be null");
+
+        // module location that is null, should be okay
+        m = ModuleHelper.DefineModule("module10", "9.5", null, cl, new String[] { "a_package_10" });
+        assertNotNull(m, "Module should not be null");
+
+        // module location that is "", should be okay
+        m = ModuleHelper.DefineModule("module11", "9.5", "", cl, new String[] { "a_package_11" });
+        assertNotNull(m, "Module should not be null");
     }
 
     static class MyClassLoader extends ClassLoader { }