--- old/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java 2015-11-12 19:05:36.205405400 +0530 +++ new/test/src/jdk/nashorn/api/javaaccess/test/ArrayConversionTest.java 2015-11-12 19:05:35.570395900 +0530 @@ -40,6 +40,10 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +/** + * @test + * @run testng/othervm jdk.nashorn.api.javaaccess.test.ArrayConversionTest + */ @SuppressWarnings("javadoc") public class ArrayConversionTest { private static ScriptEngine e = null; --- old/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java 2015-11-12 19:05:39.841458900 +0530 +++ new/test/src/jdk/nashorn/api/javaaccess/test/ConsStringTest.java 2015-11-12 19:05:39.071439400 +0530 @@ -39,6 +39,10 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +/** + * @test + * @run testng jdk.nashorn.api.javaaccess.test.ConsStringTest + */ @SuppressWarnings("javadoc") public class ConsStringTest { private static ScriptEngine e = null; --- old/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java 2015-11-12 19:05:44.301657000 +0530 +++ new/test/src/jdk/nashorn/api/scripting/test/InvocableTest.java 2015-11-12 19:05:43.648619700 +0530 @@ -40,6 +40,10 @@ /** * Tests for javax.script.Invocable implementation of nashorn. + * + * @test + * @build jdk.nashorn.api.scripting.test.VariableArityTestInterface jdk.nashorn.api.scripting.test.InvocableTest + * @run testng jdk.nashorn.api.scripting.test.InvocableTest */ @SuppressWarnings("javadoc") public class InvocableTest { --- old/test/src/jdk/nashorn/api/scripting/test/JSONCompatibleTest.java 2015-11-12 19:05:48.315762200 +0530 +++ new/test/src/jdk/nashorn/api/scripting/test/JSONCompatibleTest.java 2015-11-12 19:05:47.813759200 +0530 @@ -39,6 +39,10 @@ import org.testng.Assert; import org.testng.annotations.Test; +/** + * @test + * @run testng jdk.nashorn.api.scripting.test.JSONCompatibleTest + */ public class JSONCompatibleTest { /** --- old/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java 2015-11-12 19:05:51.279778900 +0530 +++ new/test/src/jdk/nashorn/api/scripting/test/PluggableJSObjectTest.java 2015-11-12 19:05:50.759778100 +0530 @@ -47,6 +47,9 @@ * * JDK-8024615: Refactor ScriptObjectMirror and JSObject to support external * JSObject implementations. + * + * @test + * @run testng jdk.nashorn.api.scripting.test.PluggableJSObjectTest */ @SuppressWarnings("javadoc") public class PluggableJSObjectTest { --- old/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java 2015-11-12 19:05:54.619812600 +0530 +++ new/test/src/jdk/nashorn/api/scripting/test/ScriptEngineSecurityTest.java 2015-11-12 19:05:54.088807300 +0530 @@ -38,6 +38,9 @@ /** * jsr223 tests for security access checks. + * + * @test + * @run testng/othervm jdk.nashorn.api.scripting.test.ScriptEngineSecurityTest */ @SuppressWarnings("javadoc") public class ScriptEngineSecurityTest { @@ -244,7 +247,7 @@ final ScriptEngineManager m = new ScriptEngineManager(); final ScriptEngine e = m.getEngineByName("nashorn"); final Runnable r = (Runnable)Proxy.newProxyInstance( - ScriptEngineTest.class.getClassLoader(), + ScriptEngineSecurityTest.class.getClassLoader(), new Class[] { Runnable.class }, new InvocationHandler() { @Override --- old/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java 2015-11-12 19:05:58.275870500 +0530 +++ new/test/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java 2015-11-12 19:05:57.659865900 +0530 @@ -47,6 +47,9 @@ /** * Tests to check jdk.nashorn.api.scripting.ScriptObjectMirror API. + * + * @test + * @run testng jdk.nashorn.api.scripting.test.ScriptObjectMirrorTest */ @SuppressWarnings("javadoc") public class ScriptObjectMirrorTest { --- old/test/src/jdk/nashorn/api/tree/test/ParseAPITest.java 2015-11-12 19:06:01.481893700 +0530 +++ new/test/src/jdk/nashorn/api/tree/test/ParseAPITest.java 2015-11-12 19:06:00.911892900 +0530 @@ -37,17 +37,38 @@ /** * Test for nashorn Parser API (jdk.nashorn.api.tree.*) + * + * @test + * @run testng jdk.nashorn.api.tree.test.ParseAPITest */ public class ParseAPITest { private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("parserapitest.verbose")); private static final boolean TEST262 = Boolean.valueOf(System.getProperty("parserapitest.test262")); - private static final String TEST_BASIC_DIR = System.getProperty("test.basic.dir"); - private static final String TEST_MAPTESTS_DIR = System.getProperty("test.maptests.dir"); - private static final String TEST_SANDBOX_DIR = System.getProperty("test.sandbox.dir"); - private static final String TEST_TRUSTED_DIR = System.getProperty("test.trusted.dir"); - private static final String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir"); + private static String TEST_BASIC_DIR = System.getProperty("test.basic.dir"); + private static String TEST_MAPTESTS_DIR = System.getProperty("test.maptests.dir"); + private static String TEST_SANDBOX_DIR = System.getProperty("test.sandbox.dir"); + private static String TEST_TRUSTED_DIR = System.getProperty("test.trusted.dir"); + private static String TEST262_SUITE_DIR = System.getProperty("test262.suite.dir"); + + static { + String testSrc = System.getProperty("test.src"); + if (testSrc != null) { + String testScriptDir = testSrc + "/../../../../../../script/"; + TEST_BASIC_DIR = testScriptDir + "basic"; + TEST_MAPTESTS_DIR = testScriptDir + "maptests"; + TEST_SANDBOX_DIR = testScriptDir + "sandbox"; + TEST_TRUSTED_DIR = testScriptDir + "trusted"; + TEST262_SUITE_DIR = testScriptDir + "external/test262/test/suite"; + } else { + TEST_BASIC_DIR = System.getProperty("test.basic.dir"); + TEST_MAPTESTS_DIR = System.getProperty("test.maptests.dir"); + TEST_SANDBOX_DIR = System.getProperty("test.sandbox.dir"); + TEST_TRUSTED_DIR = System.getProperty("test.trusted.dir"); + TEST262_SUITE_DIR = System.getProperty("test262.suite.dir"); + } + } interface TestFilter { public boolean exclude(File file, String content);