TestNG plugin is installed and working well, except for this minor annoyance.
To reproduce:
Create 2 test classes:
import org.testng.annotations.Test;
public abstract class AbstractTest {
@Test
public void test1() {
System.out.println("do something");
}
}
```java
import org.testng.annotations.Test;
public class ConcreteTest extends AbstractTest{
@Test(dependsOnMethods = { "test1" })
public void test2() {
System.out.println("doesn't work when launched alone");
}
}
Execute the ConcreteTest class as a TestNG Test
From the "Results of running class ConcreteTest" window, right-click on test2 and choose Run
Expected Result: TestNG should see that test2 depends on test1 and invoke them both.
Actual Result:
[RemoteTestNG] detected TestNG version 6.14.3
org.testng.TestNGException:
ConcreteTest.test2() is depending on method public void AbstractTest.test1(), which is not annotated with @Test or not included.
at org.testng.internal.MethodHelper.findDependedUponMethods(MethodHelper.java:123)
at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:266)
at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:376)
at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:65)
at org.testng.TestRunner.initMethods(TestRunner.java:438)
at org.testng.TestRunner.init(TestRunner.java:271)
at org.testng.TestRunner.init(TestRunner.java:241)
at org.testng.TestRunner.<init>(TestRunner.java:192)
at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
at org.testng.SuiteRunner.init(SuiteRunner.java:260)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:198)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Problem Statement
TestNG plugin is installed and working well, except for this minor annoyance.
To reproduce:
public abstract class AbstractTest { @Test public void test1() { System.out.println("do something"); } }
test2
and choose RunExpected Result: TestNG should see that test2 depends on test1 and invoke them both.
Actual Result:
Any relate message in "Error Log" view
The Dependency Management tool for your project
Operating System