cbeust/testng-eclipse — Issue #40: Running Test Class which contains dependsOnGroups
Author: khmarbaise
Created: 2011-12-12 16:55:23+00:00
State: open

I have two integration tests within a single module. Now i just select a single Check1IT class which contains dependsOnGroups via project explorer in Eclipse ( TestNG	6.3.1.20111126_1116	org.testng.eclipse.feature.group	Cedric Beust).
So the problem which occures is that the plugin decides to run the integration tests of the second class before the selected class which contains the dependant group but which is NOT selected during "Run As Test NG Test"...

I have checked that with Maven 3.0.3 (failsafe-plugin 2.9) and TestNG on command as well and this will fail with a:

I use to run the Maven command line a thing like this:

```
mvn ... -Dit.test=Check1IT clean verify
```

The following will be printed out

```
INFO: Executing: [56a9034f-bb9d-441e-96ab-709d879835b3, implicitlyWait {"ms":100
00}]
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.In
vocationTargetException; nested exception is java.lang.reflect.InvocationTargetE
xception: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke
(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(Suref
ireStarter.java:172)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWh
enForked(SurefireStarter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
70)
Caused by: org.testng.TestNGException:
Method "PruefenDerFilterFuerZentralbearbeiterFinanzamtIT.ueberpruefeInhaltFallli
ste()[pri:0, instance:com.rfz.de.test2.zentralbearbeiterfinanzamt.PruefenDerFilt
erFuerZentralbearbeiterFinanzamtIT@5e3974]" depends on nonexistent group "modifi
ziere.daten"
at org.testng.DependencyMap.getMethodsThatBelongTo(DependencyMap.java:29
)
at org.testng.TestRunner.createDynamicGraph(TestRunner.java:1071)
at org.testng.TestRunner.privateRun(TestRunner.java:724)
at org.testng.TestRunner.run(TestRunner.java:613)
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:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1137)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1062)
at org.testng.TestNG.run(TestNG.java:974)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.ja
va:70)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(Tes
tNGDirectoryTestSuite.java:108)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider
.java:111)
... 9 more
```

I understand the error message...but the question which results from that:

Can i run a Test which contains a dependsOnGroups separately alone?

I'm not sure if this belongs to TestNG or to the Eclipse Plugin or both?