aboutsummaryrefslogtreecommitdiff
path: root/test/script/sandbox/classloader.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/script/sandbox/classloader.js')
-rw-r--r--test/script/sandbox/classloader.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/script/sandbox/classloader.js b/test/script/sandbox/classloader.js
index 76764960..9de1a5c3 100644
--- a/test/script/sandbox/classloader.js
+++ b/test/script/sandbox/classloader.js
@@ -26,6 +26,7 @@
*
* @test
* @security
+ * @bug JDK-8032954: Nashorn: extend Java.extend
*/
try {
@@ -39,3 +40,24 @@ try {
}
}
+try {
+ Java.extend(Java.type('java.lang.ClassLoader'));
+ fail("should have thrown SecurityException");
+} catch (e) {
+ if (e instanceof java.lang.SecurityException) {
+ print(e);
+ } else {
+ fail("expected SecurityException, got " + e);
+ }
+}
+
+try {
+ Java.extend(Java.type("javax.management.loading.MLet"));
+ fail("should have thrown SecurityException");
+} catch (e) {
+ if (e instanceof java.lang.SecurityException) {
+ print(e);
+ } else {
+ fail("expected SecurityException, got " + e);
+ }
+}