Consider this trivial jtreg test:
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @test
* @run @testng/othervm Foo
*/
public class Foo {
@Test
public void testFoo() {
}
}
Trying to run this as a jtreg test case fails with:
execStatus=Error. Unexpected exception caught from test java/Foo.java\: java.lang.ArrayIndexOutOfBoundsException\: 1
sections=script_messages Details
#section:script_messages
----------messages:(0/0)----------
#section:Details
----------messages:(0/0)----------
----------Stack trace:(6/413)----------
java.lang.ArrayIndexOutOfBoundsException: 1
at com.sun.javatest.regtest.exec.RegressionScript.parseActions(RegressionScript.java:392)
at com.sun.javatest.regtest.exec.RegressionScript.run(RegressionScript.java:173)
at com.sun.javatest.Script.run(Script.java:431)
at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:183)
at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:76)
result: Not run. Test running...
test result: Error. Unexpected exception caught from test java/Foo.java: java.lang.ArrayIndexOutOfBoundsException: 1
Notice that in the test case, the type of the `@run` action is `@testng/othervm`. The `@testng` was accidental and instead should have been `testng/othervm`. The accidental use of @ character in the type of the run action seems to trigger this issue.
Output from jtreg -version is as follows:
jtreg, version 5.1 dev 1000
Installed in ...
Running on platform version 1.8.0_265 from ...
Built with Java(TM) 2 SDK, Version 1.8.0_172-b11 on April 12, 2021.
Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
JT Harness, version 6.0 ea b11 (April 12, 2021)
JCov 3.0-2
TestNG (testng.jar): version unknown
TestNG (jcommander.jar): version 1.72
Java Assembler Tools, version 7.0 beta b02 (April 12, 2021)
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @test
* @run @testng/othervm Foo
*/
public class Foo {
@Test
public void testFoo() {
}
}
Trying to run this as a jtreg test case fails with:
execStatus=Error. Unexpected exception caught from test java/Foo.java\: java.lang.ArrayIndexOutOfBoundsException\: 1
sections=script_messages Details
#section:script_messages
----------messages:(0/0)----------
#section:Details
----------messages:(0/0)----------
----------Stack trace:(6/413)----------
java.lang.ArrayIndexOutOfBoundsException: 1
at com.sun.javatest.regtest.exec.RegressionScript.parseActions(RegressionScript.java:392)
at com.sun.javatest.regtest.exec.RegressionScript.run(RegressionScript.java:173)
at com.sun.javatest.Script.run(Script.java:431)
at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:183)
at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:76)
result: Not run. Test running...
test result: Error. Unexpected exception caught from test java/Foo.java: java.lang.ArrayIndexOutOfBoundsException: 1
Notice that in the test case, the type of the `@run` action is `@testng/othervm`. The `@testng` was accidental and instead should have been `testng/othervm`. The accidental use of @ character in the type of the run action seems to trigger this issue.
Output from jtreg -version is as follows:
jtreg, version 5.1 dev 1000
Installed in ...
Running on platform version 1.8.0_265 from ...
Built with Java(TM) 2 SDK, Version 1.8.0_172-b11 on April 12, 2021.
Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
JT Harness, version 6.0 ea b11 (April 12, 2021)
JCov 3.0-2
TestNG (testng.jar): version unknown
TestNG (jcommander.jar): version 1.72
Java Assembler Tools, version 7.0 beta b02 (April 12, 2021)