author | duke |
Wed, 05 Jul 2017 23:23:09 +0200 | |
changeset 44981 | 30e75693ae99 |
parent 41374 | 092e014ed01e |
permissions | -rw-r--r-- |
41374
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
1 |
/* |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
2 |
* This is the test JavaScript program used in jjs-modulepathTest.sh |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
3 |
*/ |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
4 |
|
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
5 |
print("--module-path passed: " + $OPTIONS._module_path); |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
6 |
print("--add-modules passed: " + $OPTIONS._add_modules); |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
7 |
|
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
8 |
if ($OPTIONS._add_modules != "java.base,com.greetings") { |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
9 |
throw new Error("--add-modules values are not merged!"); |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
10 |
} |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
11 |
|
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
12 |
var Hello = com.greetings.Hello; |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
13 |
|
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
14 |
var moduleName = Hello.class.module.name; |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
15 |
if (moduleName != "com.greetings") { |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
16 |
throw new Error("Expected module name to be com.greetings"); |
092e014ed01e
8167018: Nashorn and jjs should support --module-path and --add-modules options
sundar
parents:
diff
changeset
|
17 |
} |