Is there a reason why maven would not run my AfterClass which is set to alwaysRun=true? BeforeClass is run without issues and test passes according to surefire report. I run command in terminal:
mvn -Dtest=TestSuite2#test_case3 test
and get
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:10.228s
[INFO] Finished at: Wed Nov 13 18:24:07 EET 2013
[INFO] Final Memory: 14M/114M
[INFO] ------------------------------------------------------------------------
The problem is though that my AfterClass, where I quit driver (driver.quit()) is not run. Everything works as expected, if I run the same test via Eclipse with TestNG (right click on the method, run as TestNG test)