changeset 40941:e9970aac41d9

8165870: Fix module dependencies for javax.script/* tests Reviewed-by: sundar Contributed-by: sergei.kovalev@oracle.com
author skovalev
date Tue, 13 Sep 2016 15:28:44 +0300
parents 1413b2ff89e4
children 7a81fdff5752
files jdk/test/javax/script/ExceptionTest.java jdk/test/javax/script/JavaScriptScopeTest.java jdk/test/javax/script/NullUndefinedVarTest.java jdk/test/javax/script/PluggableContextTest.java jdk/test/javax/script/Test1.java jdk/test/javax/script/Test2.java jdk/test/javax/script/Test3.java jdk/test/javax/script/Test4.java jdk/test/javax/script/Test5.java jdk/test/javax/script/Test6.java jdk/test/javax/script/Test7.java jdk/test/javax/script/Test8.java
diffstat 12 files changed, 85 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/javax/script/ExceptionTest.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/ExceptionTest.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,14 @@
  * @bug 6474943 6705893
  * @summary Test that script engine exception messages are
  * available from ScriptException.
+ * @modules jdk.scripting.nashorn
  */
 
-import java.io.*;
-import javax.script.*;
+import javax.script.Compilable;
+import javax.script.CompiledScript;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
 
 public class ExceptionTest {
     private static final String ERROR_MSG = "error from JavaScript";
--- a/jdk/test/javax/script/JavaScriptScopeTest.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/JavaScriptScopeTest.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,9 +28,13 @@
  * get affected by default scope assignments. Also, verify
  * that script globals can be created and accessed from Java
  * as well as JavaScript.
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
+import javax.script.Bindings;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+
 
 public class JavaScriptScopeTest {
 
--- a/jdk/test/javax/script/NullUndefinedVarTest.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/NullUndefinedVarTest.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,11 @@
  * @bug 6346732 6705893
  * @summary should be able to assign null and undefined
  * value to JavaScript global variables.
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class NullUndefinedVarTest {
 
--- a/jdk/test/javax/script/PluggableContextTest.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/PluggableContextTest.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,12 @@
  * @bug 6398614 6705893
  * @summary Create a user defined ScriptContext and check
  * that script can access variables from non-standard scopes
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class PluggableContextTest {
     public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test1.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test1.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,13 @@
  * @bug 6249843 6705893
  * @summary Create JavaScript engine and execute a simple script.
  * Tests script engine discovery mechanism.
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
-import java.io.*;
+import java.io.File;
+import java.io.FileReader;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test1  {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test2.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test2.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,13 @@
  * @test
  * @bug 6249843
  * @summary Test exposing a Java object to script
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
-import java.io.*;
+import java.io.File;
+import java.io.FileReader;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test2 {
         public static class Testobj {
--- a/jdk/test/javax/script/Test3.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test3.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,17 @@
  * @test
  * @bug 6249843 6705893
  * @summary Test engine and global scopes
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.SimpleBindings;
 
 public class Test3 {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test4.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test4.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,14 @@
  * @test
  * @bug 6249843 6705893
  * @summary Test script functions implementing Java interface
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
-import java.io.*;
+import java.io.File;
+import java.io.FileReader;
+import javax.script.Invocable;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test4 {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test5.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test5.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,18 @@
  * @test
  * @bug 6249843 6705893
  * @summary Tests engine, global scopes and scope hiding.
+ * @modules jdk.scripting.nashorn
  */
 
-import java.io.*;
-import javax.script.*;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.SimpleBindings;
+import javax.script.SimpleScriptContext;
 
 public class Test5 {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test6.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test6.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,16 @@
  * @bug 6249843 6705893
  * @summary Test basic script compilation. Value eval'ed from
  * compiled and interpreted scripts should be same.
+ * @modules jdk.scripting.nashorn
  */
 
-import java.io.*;
-import javax.script.*;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import javax.script.Compilable;
+import javax.script.CompiledScript;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test6 {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test7.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test7.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,14 @@
  * @test
  * @bug 6249843 6705893
  * @summary Tests importPackage and java access in script
+ * @modules jdk.scripting.nashorn
  */
 
-import java.io.*;
-import javax.script.*;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test7 {
         public static void main(String[] args) throws Exception {
--- a/jdk/test/javax/script/Test8.java	Tue Sep 13 13:55:35 2016 -0700
+++ b/jdk/test/javax/script/Test8.java	Tue Sep 13 15:28:44 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,14 @@
  * @test
  * @bug 6249843 6705893
  * @summary Test invoking script function or method from Java
+ * @modules jdk.scripting.nashorn
  */
 
-import javax.script.*;
-import java.io.*;
+import java.io.File;
+import java.io.FileReader;
+import javax.script.Invocable;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 
 public class Test8 {
         public static void main(String[] args) throws Exception {