testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Cannot launch test which dependsOnMethods declared in abstract superclass #435

Open lmsurpre opened 5 years ago

lmsurpre commented 5 years ago

Problem Statement

TestNG plugin is installed and working well, except for this minor annoyance.

To reproduce:

  1. 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");
    }
}
  1. Execute the ConcreteTest class as a TestNG Test
  2. 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)

Any relate message in "Error Log" view

[TestNGLaunchConfigurationDelegate] Launching:
  Classpath: /Users/lmsurpre/eclipse/java-photon/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/1271/0/.cp/lib/testng-remote.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjcefw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmsaslfw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcertpathprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcertpathfw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjsseprovider2.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/xml.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmorbapi.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmorb.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjssefw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmsecurity.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmpkcs.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcfw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjgssfw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjgssprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmext.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/resources.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/rt.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jsse.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jce.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/charsets.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jfr.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmldsigprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/CmpCrmf.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmlencprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjceprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmpkcs11impl.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/IBMSecureRandom.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunec.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/nashorn.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmkeycert.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/cldrdata.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/jfxrt.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjceplus.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjcefips.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/dnsns.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmlcrypto.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmsaslprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/localedata.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunjce_provider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/gskikm.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmcmsprovider.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/xmlencfw.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunpkcs11.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/jaccess.jar /Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/zipfs.jar /System/Library/Java/Extensions/MRJToolkit.jar /Users/lmsurpre/workspaces/fhir/test/target/test-classes /Users/lmsurpre/workspaces/fhir/test/target/classes /Users/lmsurpre/.p2/pool/plugins/org.testng_6.14.3.r201802240500.jar /Users/lmsurpre/.p2/pool/plugins/com.beust.jcommander_1.72.0.jar /Users/lmsurpre/.p2/pool/plugins/org.apache-extras.beanshell.bsh_2.0.0.b6.jar /Users/lmsurpre/.p2/pool/plugins/org.yaml.snakeyaml_1.17.0.jar /Users/lmsurpre/.m2/repository/org/apache/httpcomponents/httpclient/4.3/httpclient-4.3.jar /Users/lmsurpre/.m2/repository/org/apache/httpcomponents/httpcore/4.3/httpcore-4.3.jar /Users/lmsurpre/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar /Users/lmsurpre/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
  VMArgs:    -ea -ea
  Class:     org.testng.remote.RemoteTestNG
  Args:      -serport 49332 -protocol json -d /Users/lmsurpre/workspaces/fhir/test/test-output /var/folders/mg/ch346nld45391zsh5062j97c0000gn/T/testng-eclipse-147552084/testng-customsuite.xml
java -ea -ea -classpath /Users/lmsurpre/eclipse/java-photon/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/1271/0/.cp/lib/testng-remote.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjcefw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmsaslfw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcertpathprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcertpathfw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjsseprovider2.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/xml.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmorbapi.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmorb.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjssefw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmsecurity.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmpkcs.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmcfw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjgssfw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmjgssprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/endorsed/ibmext.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/resources.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/rt.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jsse.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jce.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/charsets.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/jfr.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmldsigprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/CmpCrmf.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmlencprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjceprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmpkcs11impl.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/IBMSecureRandom.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunec.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/nashorn.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmkeycert.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/cldrdata.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/jfxrt.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjceplus.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmjcefips.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/dnsns.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmxmlcrypto.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmsaslprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/localedata.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunjce_provider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/gskikm.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/ibmcmsprovider.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/xmlencfw.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/sunpkcs11.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/jaccess.jar:/Users/lmsurpre/lib/macosxx6480sr5fp25hybrid-20181026_03-sdk/jre/lib/ext/zipfs.jar:/System/Library/Java/Extensions/MRJToolkit.jar:/Users/lmsurpre/workspaces/fhir/test/target/test-classes:/Users/lmsurpre/workspaces/fhir/test/target/classes:/Users/lmsurpre/.p2/pool/plugins/org.testng_6.14.3.r201802240500.jar:/Users/lmsurpre/.p2/pool/plugins/com.beust.jcommander_1.72.0.jar:/Users/lmsurpre/.p2/pool/plugins/org.apache-extras.beanshell.bsh_2.0.0.b6.jar:/Users/lmsurpre/.p2/pool/plugins/org.yaml.snakeyaml_1.17.0.jar:/Users/lmsurpre/.m2/repository/org/apache/httpcomponents/httpclient/4.3/httpclient-4.3.jar:/Users/lmsurpre/.m2/repository/org/apache/httpcomponents/httpcore/4.3/httpcore-4.3.jar:/Users/lmsurpre/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/Users/lmsurpre/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar org.testng.remote.RemoteTestNG -serport 49332 -protocol json -d /Users/lmsurpre/workspaces/fhir/test/test-output /var/folders/mg/ch346nld45391zsh5062j97c0000gn/T/testng-eclipse-147552084/testng-customsuite.xml

The Dependency Management tool for your project

Operating System

lmsurpre commented 5 years ago

If test1 and test2 are both in the AbstractTest class it fails in the same way. If test1 and test2 are both in the ConcreteTest it works.