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

Surefire crashes if test depends on unknown group

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.12.4
    • 2.13
    • TestNG support
    • None

    Description

      Unzip and run the attached testcase.

      Surefire throws the following exception:

      Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@6127ffd7
      org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      Caused by: org.testng.TestNGException: 
      DependencyMap::Method "AppTest.removeNonExistentLocation()[pri:0, instance:null(com.mycompany.testfailed.AppTest)]" depends on nonexistent group "getLocation"
      	at org.testng.DependencyMap.getMethodsThatBelongTo(DependencyMap.java:45)
      	at org.testng.TestRunner.createDynamicGraph(TestRunner.java:1079)
      	at org.testng.TestRunner.privateRun(TestRunner.java:734)
      	at org.testng.TestRunner.run(TestRunner.java:617)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
      	at org.testng.TestNG.run(TestNG.java:1031)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:110)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:106)
      	... 9 more
      

      and prints:

      "The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?"

      Expected behavior:

      1. Kill this misleading error message, please. I wasted a lot of time looking in the wrong direction because of it.
      2. Surefire should report this as a normal test failure, not a crash.

      See http://netbeans.org/bugzilla/show_bug.cgi?id=219097 for a related discussion.

      Attachments

        1. TestFailed.zip
          3 kB
          Gili

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              cowwoc Gili
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: