8076646: nashorn tests should avoid using package names used by nashorn sources

Reviewed-by: hannesw
This commit is contained in:
Athijegannathan Sundararajan 2015-04-03 19:09:34 +05:30
parent 0f4227cfde
commit 44b017bd90
45 changed files with 78 additions and 46 deletions

View File

@ -281,12 +281,12 @@
<fileset dir="${test.src.dir}/META-INF/services/"/>
</copy>
<copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
<fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
<copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
<fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
</copy>
<copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
<fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
<copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
<fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
</copy>
<!-- tests that check nashorn internals and internal API -->

View File

@ -29,8 +29,8 @@
* @security
*/
var Window = Java.type("jdk.nashorn.api.scripting.Window");
var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.WindowEventHandler");
var Window = Java.type("jdk.nashorn.api.scripting.test.Window");
var WindowEventHandler = Java.type("jdk.nashorn.api.scripting.test.WindowEventHandler");
var w = new Window();

View File

@ -28,6 +28,6 @@
* @run
*/
load("classpath:jdk/nashorn/internal/runtime/resources/load_test.js")
load("classpath:jdk/nashorn/internal/runtime/test/resources/load_test.js")
Assert.assertEquals(loadedFunc("hello"), "HELLO");

View File

@ -1 +1 @@
jdk.nashorn.api.NashornSQLDriver
jdk.nashorn.api.test.NashornSQLDriver

View File

@ -23,8 +23,9 @@
* questions.
*/
package jdk.internal.dynalink.beans;
package jdk.internal.dynalink.beans.test;
import jdk.internal.dynalink.beans.BeansLinker;
import jdk.nashorn.test.models.ClassLoaderAware;
import org.testng.annotations.Test;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import java.util.HashMap;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
@SuppressWarnings("javadoc")
public class Person {

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import javax.script.Invocable;
import javax.script.ScriptEngine;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.javaaccess;
package jdk.nashorn.api.javaaccess.test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@ -36,6 +36,7 @@ import java.util.LinkedHashMap;
import java.util.Set;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import jdk.nashorn.api.scripting.AbstractJSObject;
import org.testng.annotations.Test;
/**

View File

@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@ -35,6 +35,8 @@ import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleBindings;
import javax.script.SimpleScriptContext;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import jdk.nashorn.api.scripting.URLReader;
import org.testng.Assert;
import org.testng.annotations.Test;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.fail;
import java.lang.reflect.InvocationHandler;
@ -32,6 +32,8 @@ import java.lang.reflect.Proxy;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.ClassFilter;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import org.testng.annotations.Test;
/**

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@ -51,6 +51,7 @@ import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import org.testng.annotations.Test;
/**
@ -541,7 +542,7 @@ public class ScriptEngineTest {
final ScriptEngineManager m = new ScriptEngineManager();
final ScriptEngine e = m.getEngineByName("nashorn");
e.eval("obj = { foo: 'hello' }");
e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.Window"));
e.put("Window", e.eval("Packages.jdk.nashorn.api.scripting.test.Window"));
assertEquals(e.eval("Window.funcJSObject(obj)"), "hello");
assertEquals(e.eval("Window.funcScriptObjectMirror(obj)"), "hello");
assertEquals(e.eval("Window.funcMap(obj)"), "hello");

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@ -41,6 +41,8 @@ import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.JSObject;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import org.testng.annotations.Test;
/**

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
@SuppressWarnings("javadoc")
public interface VariableArityTestInterface {

View File

@ -23,10 +23,12 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
import java.util.Map;
import javax.script.Bindings;
import jdk.nashorn.api.scripting.JSObject;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
@SuppressWarnings("javadoc")
public class Window {

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api.scripting;
package jdk.nashorn.api.scripting.test;
@SuppressWarnings("javadoc")
public interface WindowEventHandler {

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.api;
package jdk.nashorn.api.test;
import java.sql.Connection;
import java.sql.Driver;

View File

@ -22,13 +22,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.nashorn.api.tree;
package jdk.nashorn.api.tree.test;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import jdk.nashorn.api.tree.Parser;
import jdk.nashorn.api.tree.SimpleTreeVisitorES5_1;
import jdk.nashorn.api.tree.Tree;
import org.testng.Assert;
import org.testng.annotations.Test;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.codegen;
package jdk.nashorn.internal.codegen.test;
import static jdk.nashorn.internal.runtime.Source.readFully;
import static jdk.nashorn.internal.runtime.Source.sourceFor;

View File

@ -23,11 +23,12 @@
* questions.
*/
package jdk.nashorn.internal.parser;
package jdk.nashorn.internal.parser.test;
import static jdk.nashorn.internal.runtime.Source.readFully;
import static jdk.nashorn.internal.runtime.Source.sourceFor;
import java.io.File;
import jdk.nashorn.internal.parser.Parser;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.ErrorManager;
import jdk.nashorn.internal.runtime.Source;

View File

@ -23,8 +23,9 @@
* questions.
*/
package jdk.nashorn.internal.runtime.regexp.joni;
package jdk.nashorn.internal.runtime.regexp.joni.test;
import jdk.nashorn.internal.runtime.regexp.joni.Regex;
import org.testng.annotations.Test;
/**

View File

@ -23,8 +23,11 @@
* questions.
*/
package jdk.nashorn.internal.runtime.regexp;
package jdk.nashorn.internal.runtime.regexp.test;
import jdk.nashorn.internal.runtime.regexp.RegExp;
import jdk.nashorn.internal.runtime.regexp.RegExpFactory;
import jdk.nashorn.internal.runtime.regexp.RegExpMatcher;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static org.testng.Assert.fail;
import java.io.File;

View File

@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;

View File

@ -23,8 +23,9 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import jdk.nashorn.internal.runtime.ConsString;
import static org.testng.Assert.assertEquals;
import org.testng.annotations.Test;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static jdk.nashorn.internal.runtime.Source.sourceFor;
import static org.testng.Assert.assertEquals;
@ -31,6 +31,12 @@ import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import java.util.Map;
import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.ErrorManager;
import jdk.nashorn.internal.runtime.ScriptFunction;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
import jdk.nashorn.internal.runtime.Source;
import jdk.nashorn.internal.runtime.options.Options;
import org.testng.annotations.Test;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
@ -34,6 +34,8 @@ import java.io.ObjectOutputStream;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import jdk.nashorn.internal.runtime.RewriteException;
import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
import org.testng.annotations.Test;
/**

View File

@ -23,8 +23,10 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import jdk.nashorn.internal.runtime.JSType;
import jdk.nashorn.internal.runtime.ScriptRuntime;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import org.testng.annotations.Test;

View File

@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static org.testng.Assert.fail;
import java.io.ByteArrayOutputStream;

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static jdk.nashorn.internal.runtime.Source.sourceFor;
import static org.testng.Assert.assertEquals;
@ -36,6 +36,7 @@ import java.io.Reader;
import java.net.URL;
import java.util.Arrays;
import jdk.nashorn.api.scripting.URLReader;
import jdk.nashorn.internal.runtime.Source;
import org.testng.annotations.Test;
/**

View File

@ -23,7 +23,7 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
package jdk.nashorn.internal.runtime.test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
@ -36,6 +36,7 @@ import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import jdk.nashorn.api.scripting.ClassFilter;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import jdk.nashorn.internal.runtime.Version;
import org.testng.annotations.Test;
/**