No More Missing TestNG Tests
March 25th, 2009 by Anna KozlovaI often forget to add newly created tests to the testng.xml, which is used in our TeamCity build, and by the time I realize that they don’t run something is surely went wrong. What a bummer! Not any more, fortunately — IntelliJ IDEA makes sure no tests are missing. All it takes is to enable the Undeclared test inspection under TestNG in the Errors section of the Settings dialog.
Tags: Code Analysis, Testing, TestNG

March 27th, 2009 at 1:13 am
It seems that my test are all undeclared.
When I use the inspection it’s asking me for my testng.xml.
But how can I specify which testng.xml the inspection should use as reference?
cheers
March 27th, 2009 at 4:21 am
It searches for any occurrences of your test in an xml file which looks like testng.xml. So, if all your tests are declared via factories then they will be shown as undeclared.