You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package test;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class TestNGEclipseBug {
private static final String PROPERTY = "property";
public TestNGEclipseBug() {
System.setProperty("property", "Hello world!");
}
@Parameters({ PROPERTY }) // An internal error occurred during: "Launching TestNGEclipseBug.testBug".
// @Parameters(PROPERTY) // no error
// @Parameters({ "property" }) // no error
// @Parameters("property") // no error
@Test
public void testBug(final String property) {
System.out.println(property);
}
}
Using @Parameters({ PROPERTY }) would cause error when running the test:
An internal error occurred during: "Launching TestNGEclipseBug.testBug".
class org.eclipse.jdt.core.dom.SimpleName cannot be cast to class org.eclipse.jdt.core.dom.StringLiteral (org.eclipse.jdt.core.dom.SimpleName and org.eclipse.jdt.core.dom.StringLiteral are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @6fa15c7b)
Code compiles, but test cannot run in Eclipse using this plugin. Based on the error message it seems to be issue with Eclipse plugin instead of TestNG itself.
No error if static variable is used by itself (as opposed to wrapped inside array), or if string literal is used instead (array or not).
Similar(same?) issue reported back in 2018: #294 (comment)
Any relate message in "Error Log" view
"Windows -> Show View -> Others -> Error Log"
The Dependency Management tool for your project
Maven
Gradle
Ant
Eclipse Buildpath (aka. Use "TestNG Library" for your project in Eclipse)
Operating System
Windows
Linux
OSX
The text was updated successfully, but these errors were encountered:
Problem Statement
please read https://github.com/cbeust/testng-eclipse/blob/master/docs/Troubleshooting.md first
Example code:
Using
@Parameters({ PROPERTY })
would cause error when running the test:Code compiles, but test cannot run in Eclipse using this plugin. Based on the error message it seems to be issue with Eclipse plugin instead of TestNG itself.
No error if static variable is used by itself (as opposed to wrapped inside array), or if string literal is used instead (array or not).
Similar(same?) issue reported back in 2018: #294 (comment)
Any relate message in "Error Log" view
The Dependency Management tool for your project
Operating System
The text was updated successfully, but these errors were encountered: