1 /* 2 * This is the test JavaScript program used in jjs-modulepathTest.sh 3 */ 4 5 print("--module-path passed: " + $OPTIONS._module_path); 6 print("--add-modules passed: " + $OPTIONS._add_modules); 7 8 var Hello = com.greetings.Hello; 9 var moduleName = Hello.class.module.name; 10 if (moduleName != "com.greetings") { 11 throw new Error("Expected module name to be com.greetings"); 12 } else { 13 print("Module name is " + moduleName); 14 } 15 16 var msg = Hello.greet(); 17 if (msg != "Hello World!") { 18 throw new Error("Expected 'Hello World!'"); 19 } else { 20 print(msg); 21 }