test/jdk/tools/jjs/modulepath.js
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 41374 jdk/test/tools/jjs/modulepath.js@092e014ed01e
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse

/*
 * This is the test JavaScript program used in jjs-modulepathTest.sh
 */

print("--module-path passed: " + $OPTIONS._module_path);
print("--add-modules passed: " + $OPTIONS._add_modules);

var Hello = com.greetings.Hello;
var moduleName = Hello.class.module.name;
if (moduleName != "com.greetings") {
    throw new Error("Expected module name to be com.greetings");
} else {
    print("Module name is " + moduleName);
}

var msg = Hello.greet();
if (msg != "Hello World!") {
    throw new Error("Expected 'Hello World!'");
} else {
    print(msg);
}