Please excuse the newb question - my conceptual models are still quite incomplete...
I'm trying to re-execute TestNG tests from a command line using maven and surefire. My command line looks like:
D:\workspaces\workspace01\aptest>mvn clean install surefire:test -Dtests=myTestNGSuite test
Clearly I'm not getting it because the output I end up with includes:
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ aptest ---
[INFO] Skipping execution of surefire because it has already been run for this configuration
How do I clear out the configuration so I can re-run my TestNG suite from the command line? Is there a better way to run TestNG suites from the command line?
TIA, -->Aaron
Based on the command you've given
BTW: Where the parameter tests should be named test
which means to run through the install life-cycle which means to run through the following steps:
as you can see that within this life-cycle the test phase has already been run...in Other words the surefire:test does not make sense nor the test which would run the life-cycle like this:
So to run the suite within TestNG it is sufficient to call Maven like this:
or if you have run the test life cylce before this can be shortent to:
Furthermore usually you shouldn't use test suites neither in JUnit nor in TestNG cause maven-surefire-plugin will automatically recognize the unit tests within the correct locaiton (src/test/java). so there is no need to write Test Suites. BTW you should define an more up-to-date version of the maven-surefire-plugin (2.13 in the meantime).
The test goal of the surefire plugin is automatically run in the test phase so the first time just run
and then if you want to re run do a
Note that I am not calling the clean goal so that only your changes of test cases or code are recompiled and that I am NOT invoking the test goal of the surefire plugin.