8076972: Several nashorn tests failing

Reviewed-by: lagergren, jlaskey
This commit is contained in:
Athijegannathan Sundararajan 2015-04-07 00:13:18 +05:30
parent 99a408038d
commit fcb7a55923
19 changed files with 48 additions and 47 deletions

View File

@ -402,14 +402,14 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" {
<!-- only to be invoked as dependency of "test" target --> <!-- only to be invoked as dependency of "test" target -->
<target name="-test-classes-all" depends="jar" unless="test.class"> <target name="-test-classes-all" depends="jar" unless="test.class">
<fileset id="test.classes" dir="${build.test.classes.dir}"> <fileset id="test.classes" dir="${build.test.classes.dir}">
<include name="**/api/javaaccess/*Test.class"/> <include name="**/api/javaaccess/test/*Test.class"/>
<include name="**/api/scripting/*Test.class"/> <include name="**/api/scripting/test/*Test.class"/>
<include name="**/api/tree/*Test.class"/> <include name="**/api/tree/test/*Test.class"/>
<include name="**/codegen/*Test.class"/> <include name="**/codegen/test/*Test.class"/>
<include name="**/parser/*Test.class"/> <include name="**/parser/test/*Test.class"/>
<include name="**/runtime/*Test.class"/> <include name="**/runtime/test/*Test.class"/>
<include name="**/runtime/regexp/*Test.class"/> <include name="**/runtime/regexp/test/*Test.class"/>
<include name="**/runtime/regexp/joni/*Test.class"/> <include name="**/runtime/regexp/joni/test/*Test.class"/>
<include name="**/framework/*Test.class"/> <include name="**/framework/*Test.class"/>
</fileset> </fileset>
</target> </target>

View File

@ -38,8 +38,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.BooleanAccessTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.BooleanAccessTest
* @run testng/othervm jdk.nashorn.api.javaaccess.BooleanAccessTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.BooleanAccessTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class BooleanAccessTest { public class BooleanAccessTest {
@ -57,7 +57,7 @@ public class BooleanAccessTest {
e = m.getEngineByName("nashorn"); e = m.getEngineByName("nashorn");
o = new SharedObject(); o = new SharedObject();
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
} }
@AfterClass @AfterClass

View File

@ -41,8 +41,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.MethodAccessTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.MethodAccessTest
* @run testng/othervm jdk.nashorn.api.javaaccess.MethodAccessTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.MethodAccessTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class MethodAccessTest { public class MethodAccessTest {
@ -61,8 +61,8 @@ public class MethodAccessTest {
o = new SharedObject(); o = new SharedObject();
o.setEngine(e); o.setEngine(e);
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.Person;"); e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.test.Person;");
} }
@AfterClass @AfterClass
@ -338,13 +338,13 @@ public class MethodAccessTest {
@Test @Test
public void accessDefaultConstructor() throws ScriptException { public void accessDefaultConstructor() throws ScriptException {
e.eval("var dc = new Packages.jdk.nashorn.api.javaaccess.Person()"); e.eval("var dc = new Packages.jdk.nashorn.api.javaaccess.test.Person()");
assertEquals(new Person(), e.get("dc")); assertEquals(new Person(), e.get("dc"));
} }
@Test @Test
public void accessCustomConstructor() throws ScriptException { public void accessCustomConstructor() throws ScriptException {
e.eval("var cc = new Packages.jdk.nashorn.api.javaaccess.Person(17)"); e.eval("var cc = new Packages.jdk.nashorn.api.javaaccess.test.Person(17)");
assertEquals(new Person(17), e.get("cc")); assertEquals(new Person(17), e.get("cc"));
} }

View File

@ -38,8 +38,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberAccessTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.NumberAccessTest
* @run testng/othervm jdk.nashorn.api.javaaccess.NumberAccessTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.NumberAccessTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class NumberAccessTest { public class NumberAccessTest {
@ -57,7 +57,7 @@ public class NumberAccessTest {
e = m.getEngineByName("nashorn"); e = m.getEngineByName("nashorn");
o = new SharedObject(); o = new SharedObject();
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
} }
@AfterClass @AfterClass

View File

@ -37,8 +37,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberBoxingTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.NumberBoxingTest
* @run testng/othervm jdk.nashorn.api.javaaccess.NumberBoxingTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.NumberBoxingTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class NumberBoxingTest { public class NumberBoxingTest {
@ -56,7 +56,7 @@ public class NumberBoxingTest {
e = m.getEngineByName("nashorn"); e = m.getEngineByName("nashorn");
o = new SharedObject(); o = new SharedObject();
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
} }
@AfterClass @AfterClass

View File

@ -37,8 +37,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.ObjectAccessTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.ObjectAccessTest
* @run testng/othervm jdk.nashorn.api.javaaccess.ObjectAccessTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.ObjectAccessTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class ObjectAccessTest { public class ObjectAccessTest {
@ -56,8 +56,8 @@ public class ObjectAccessTest {
e = m.getEngineByName("nashorn"); e = m.getEngineByName("nashorn");
o = new SharedObject(); o = new SharedObject();
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.Person;"); e.eval("var Person = Packages.jdk.nashorn.api.javaaccess.test.Person;");
} }
@AfterClass @AfterClass
@ -80,7 +80,7 @@ public class ObjectAccessTest {
e.eval("var p_object_array = o.publicObjectArray;"); e.eval("var p_object_array = o.publicObjectArray;");
assertEquals(o.publicObjectArray[0], e.eval("o.publicObjectArray[0]")); assertEquals(o.publicObjectArray[0], e.eval("o.publicObjectArray[0]"));
assertArrayEquals(o.publicObjectArray, (Object[])e.get("p_object_array")); assertArrayEquals(o.publicObjectArray, (Object[])e.get("p_object_array"));
e.eval("var t_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" + e.eval("var t_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
"t_object_arr[0] = new Person(100);" + "t_object_arr[0] = new Person(100);" +
"t_object_arr[1] = new Person(120);" + "t_object_arr[1] = new Person(120);" +
"t_object_arr[2] = new Person(140);" + "t_object_arr[2] = new Person(140);" +
@ -104,7 +104,7 @@ public class ObjectAccessTest {
e.eval("var ps_object_array = SharedObject.publicStaticObjectArray;"); e.eval("var ps_object_array = SharedObject.publicStaticObjectArray;");
assertEquals(SharedObject.publicStaticObjectArray[0], e.eval("SharedObject.publicStaticObjectArray[0]")); assertEquals(SharedObject.publicStaticObjectArray[0], e.eval("SharedObject.publicStaticObjectArray[0]"));
assertArrayEquals(SharedObject.publicStaticObjectArray, (Object[])e.get("ps_object_array")); assertArrayEquals(SharedObject.publicStaticObjectArray, (Object[])e.get("ps_object_array"));
e.eval("var ts_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" + e.eval("var ts_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
"ts_object_arr[0] = new Person(100);" + "ts_object_arr[0] = new Person(100);" +
"ts_object_arr[1] = new Person(120);" + "ts_object_arr[1] = new Person(120);" +
"ts_object_arr[2] = new Person(140);" + "ts_object_arr[2] = new Person(140);" +
@ -128,7 +128,7 @@ public class ObjectAccessTest {
e.eval("var pf_object_array = o.publicFinalObjectArray;"); e.eval("var pf_object_array = o.publicFinalObjectArray;");
assertEquals(o.publicFinalObjectArray[0], e.eval("o.publicFinalObjectArray[0]")); assertEquals(o.publicFinalObjectArray[0], e.eval("o.publicFinalObjectArray[0]"));
assertArrayEquals(o.publicFinalObjectArray, (Object[])e.get("pf_object_array")); assertArrayEquals(o.publicFinalObjectArray, (Object[])e.get("pf_object_array"));
e.eval("var tf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" + e.eval("var tf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
"tf_object_arr[0] = new Person(100);" + "tf_object_arr[0] = new Person(100);" +
"tf_object_arr[1] = new Person(120);" + "tf_object_arr[1] = new Person(120);" +
"tf_object_arr[2] = new Person(140);" + "tf_object_arr[2] = new Person(140);" +
@ -152,7 +152,7 @@ public class ObjectAccessTest {
e.eval("var psf_object_array = SharedObject.publicStaticFinalObjectArray;"); e.eval("var psf_object_array = SharedObject.publicStaticFinalObjectArray;");
assertEquals(SharedObject.publicStaticFinalObjectArray[0], e.eval("SharedObject.publicStaticFinalObjectArray[0]")); assertEquals(SharedObject.publicStaticFinalObjectArray[0], e.eval("SharedObject.publicStaticFinalObjectArray[0]"));
assertArrayEquals(SharedObject.publicStaticFinalObjectArray, (Object[])e.get("psf_object_array")); assertArrayEquals(SharedObject.publicStaticFinalObjectArray, (Object[])e.get("psf_object_array"));
e.eval("var tsf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.Person[]\"))(3);" + e.eval("var tsf_object_arr = new (Java.type(\"jdk.nashorn.api.javaaccess.test.Person[]\"))(3);" +
"tsf_object_arr[0] = new Person(100);" + "tsf_object_arr[0] = new Person(100);" +
"tsf_object_arr[1] = new Person(120);" + "tsf_object_arr[1] = new Person(120);" +
"tsf_object_arr[2] = new Person(140);" + "tsf_object_arr[2] = new Person(140);" +

View File

@ -37,8 +37,8 @@ import org.testng.annotations.Test;
/** /**
* @test * @test
* @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.StringAccessTest * @build jdk.nashorn.api.javaaccess.test.SharedObject jdk.nashorn.api.javaaccess.test.Person jdk.nashorn.api.javaaccess.test.StringAccessTest
* @run testng/othervm jdk.nashorn.api.javaaccess.StringAccessTest * @run testng/othervm jdk.nashorn.api.javaaccess.test.StringAccessTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class StringAccessTest { public class StringAccessTest {
@ -56,7 +56,7 @@ public class StringAccessTest {
e = m.getEngineByName("nashorn"); e = m.getEngineByName("nashorn");
o = new SharedObject(); o = new SharedObject();
e.put("o", o); e.put("o", o);
e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.SharedObject;"); e.eval("var SharedObject = Packages.jdk.nashorn.api.javaaccess.test.SharedObject;");
} }
@AfterClass @AfterClass

View File

@ -35,7 +35,7 @@ import org.testng.annotations.Test;
* independently. * independently.
* *
* @test * @test
* @run testng jdk.nashorn.api.scripting.MultipleEngineTest * @run testng jdk.nashorn.api.scripting.test.MultipleEngineTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class MultipleEngineTest { public class MultipleEngineTest {

View File

@ -58,8 +58,8 @@ import org.testng.annotations.Test;
* Tests for JSR-223 script engine for Nashorn. * Tests for JSR-223 script engine for Nashorn.
* *
* @test * @test
* @build jdk.nashorn.api.scripting.Window jdk.nashorn.api.scripting.WindowEventHandler jdk.nashorn.api.scripting.VariableArityTestInterface jdk.nashorn.api.scripting.ScriptEngineTest * @build jdk.nashorn.api.scripting.test.Window jdk.nashorn.api.scripting.test.WindowEventHandler jdk.nashorn.api.scripting.test.VariableArityTestInterface jdk.nashorn.api.scripting.test.ScriptEngineTest
* @run testng/othervm jdk.nashorn.api.scripting.ScriptEngineTest * @run testng/othervm jdk.nashorn.api.scripting.test.ScriptEngineTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class ScriptEngineTest { public class ScriptEngineTest {

View File

@ -32,7 +32,7 @@ import org.testng.annotations.Test;
* Joni coverage tests * Joni coverage tests
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.regexp.joni.JoniTest * @run testng jdk.nashorn.internal.runtime.regexp.joni.test.JoniTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class JoniTest { public class JoniTest {

View File

@ -38,7 +38,7 @@ import org.testng.annotations.Test;
* Basic tests for the JDK based RegExp implementation. * Basic tests for the JDK based RegExp implementation.
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.regexp.JdkRegExpTest * @run testng jdk.nashorn.internal.runtime.regexp.test.JdkRegExpTest
*/ */
public class JdkRegExpTest { public class JdkRegExpTest {

View File

@ -38,10 +38,11 @@ import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* @ignore Fails with jtreg, but passes with ant test run. Ignore for now.
* @test * @test
* @bug 8039185 8039403 * @bug 8039185 8039403
* @summary Test for persistent code cache and path handling * @summary Test for persistent code cache and path handling
* @run testng jdk.nashorn.internal.runtime.CodeStoreAndPathTest * @run testng jdk.nashorn.internal.runtime.test.CodeStoreAndPathTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class CodeStoreAndPathTest { public class CodeStoreAndPathTest {

View File

@ -34,7 +34,7 @@ import org.testng.annotations.Test;
* Tests for JSType methods. * Tests for JSType methods.
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.ConsStringTest * @run testng jdk.nashorn.internal.runtime.test.ConsStringTest
*/ */
public class ConsStringTest { public class ConsStringTest {

View File

@ -44,7 +44,7 @@ import org.testng.annotations.Test;
* Basic Context API tests. * Basic Context API tests.
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.ContextTest * @run testng jdk.nashorn.internal.runtime.test.ContextTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class ContextTest { public class ContextTest {

View File

@ -42,7 +42,7 @@ import org.testng.annotations.Test;
* JDK-8044518: Ensure exceptions related to optimistic recompilation are not serializable * JDK-8044518: Ensure exceptions related to optimistic recompilation are not serializable
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.ExceptionsNotSerializable * @run testng jdk.nashorn.internal.runtime.test.ExceptionsNotSerializable
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class ExceptionsNotSerializable { public class ExceptionsNotSerializable {

View File

@ -37,7 +37,7 @@ import org.testng.annotations.Test;
* Tests for JSType methods. * Tests for JSType methods.
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.JSTypeTest * @run testng jdk.nashorn.internal.runtime.test.JSTypeTest
*/ */
public class JSTypeTest { public class JSTypeTest {
/** /**

View File

@ -40,7 +40,7 @@ import static org.testng.Assert.assertEquals;
* Top-level lexical binding tests. * Top-level lexical binding tests.
* *
* @test * @test
* @run testng jdk.nashorn.internal.runtime.LexicalBindingTest * @run testng jdk.nashorn.internal.runtime.test.LexicalBindingTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class LexicalBindingTest { public class LexicalBindingTest {

View File

@ -43,7 +43,7 @@ import org.testng.annotations.Test;
* @test * @test
* @bug 8037378 * @bug 8037378
* @summary Sanity tests for no persistence caching * @summary Sanity tests for no persistence caching
* @run testng/othervm jdk.nashorn.internal.runtime.NoPersistenceCachingTest * @run testng/othervm jdk.nashorn.internal.runtime.test.NoPersistenceCachingTest
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class NoPersistenceCachingTest { public class NoPersistenceCachingTest {

View File

@ -49,7 +49,7 @@ public class SourceTest {
final private static String SOURCE_STRING = "var x = 1;"; final private static String SOURCE_STRING = "var x = 1;";
final private static char[] SOURCE_CHARS = SOURCE_STRING.toCharArray(); final private static char[] SOURCE_CHARS = SOURCE_STRING.toCharArray();
final private static String RESOURCE_PATH = "resources/load_test.js"; final private static String RESOURCE_PATH = "resources/load_test.js";
final private static File SOURCE_FILE = new File("build/test/classes/jdk/nashorn/internal/runtime/" + RESOURCE_PATH); final private static File SOURCE_FILE = new File("build/test/classes/jdk/nashorn/internal/runtime/test/" + RESOURCE_PATH);
final private static URL SOURCE_URL = SourceTest.class.getResource(RESOURCE_PATH); final private static URL SOURCE_URL = SourceTest.class.getResource(RESOURCE_PATH);