Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1073

method depends on nonexistent group, but group exists

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 2.17
    • None
    • TestNG support
    • None
    • Mac OS X 10.9, TestNG 6.8.8

    Description

      When running a whole project's tests from the command-line via 'mvn test', test-ng test dependencies are correctly resolved, and all tests pass. When trying to run a single test from the command line that depends on another test, I get a 'method depends on nonexistent group' error, with this output:

      ....
      objc[24281]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
      Running com.fourwardnetworks.com.testngtest.TestNext
      Configuring TestNG with: TestNG652Configurator
      
      Results :
      
      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
      
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5.328s
      [INFO] Finished at: Sat Apr 05 15:34:03 PDT 2014
      [INFO] Final Memory: 27M/439M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project core: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process
      [ERROR] org.testng.TestNGException:
      [ERROR] DependencyMap::Method "TestNext.runMeNext()[pri:0, instance:com.fourwardnetworks.com.testngtest.TestNext@6625abb1]" depends on nonexistent group "MyGroup"
      [ERROR] at org.testng.DependencyMap.getMethodsThatBelongTo(DependencyMap.java:46)
      [ERROR] at org.testng.TestRunner.createDynamicGraph(TestRunner.java:1074)
      [ERROR] at org.testng.TestRunner.privateRun(TestRunner.java:734)
      [ERROR] at org.testng.TestRunner.run(TestRunner.java:617)
      [ERROR] at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
      [ERROR] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
      [ERROR] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
      [ERROR] at org.testng.SuiteRunner.run(SuiteRunner.java:254)
      [ERROR] at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      [ERROR] at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      [ERROR] at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
      [ERROR] at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
      [ERROR] at org.testng.TestNG.run(TestNG.java:1057)
      [ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
      [ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:128)
      [ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:112)
      [ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:112)
      [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      

      To replicate this, two files are sufficient:

      TestNext.java

      package com.fourwardnetworks.com.testngtest;
      import org.testng.annotations.Test;
      public class TestNext {
          @Test(dependsOnGroups = { "MyGroup" })
          public void runMeNext() { }
      }
      

      and TestFirst.java:

      package com.fourwardnetworks.com.testngtest;
      import org.testng.annotations.Test;
      public class TestFirst {
          @Test(groups = { "MyGroup" })
          public void runMeFirst() { }
      }
      

      And then run from the cmd line:

       mvn -Dtest=TestNext test
      

      ... you get the error above. When run from within Eclipse, by right-clicking on function testNext, then going to Debug As -> TestNG Test, the dependent test runs correctly for this test case, but not for the bug "in the wild" - no idea why.

      Putting the two functions into one file, running from the command line, works as well. I have to assume it's some issue with generated config.

      Any pointers to help fix this? Thanks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            brandonh Brandon Heller
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: