cbeust/testng — Issue #189: NPE if 'methods' passed to TestNG Ant Task do not exist
Author: lukasj
Created: 2012-03-09 00:19:15+00:00
State: open

-pass non-existing method to TestNG Ant task using 'methods' attribute
-run the task

=>
```[TestNGAntTask] TESTNG PASSED @/tmp/testng6762246149931793475 WHICH CONTAINS:
-d /tmp/JavaApplication50/build/test/results
-testclass /tmp/JavaApplication50/build/test/classes/ng/NewEmptyTestNGTest.class
-listener org.testng.reporters.VerboseReporter
-methods a.b.c
Exception in thread "main" java.lang.NullPointerException
at org.testng.xml.XmlClass.(XmlClass.java:46)
at org.testng.internal.Utils.classesToXmlClasses(Utils.java:83)
at org.testng.TestNG.createCommandLineSuitesForClasses(TestNG.java:555)
at org.testng.TestNG.createCommandLineSuitesForMethods(TestNG.java:523)
at org.testng.TestNG.initializeCommandLineSuites(TestNG.java:800)
at org.testng.TestNG.run(TestNG.java:998)
at org.testng.TestNG.privateMain(TestNG.java:1330)
at org.testng.TestNG.main(TestNG.java:1294)
The tests failed.
```

Fix is to add check for null on line 520 in TestNG.java... I'll include the fix for this in pull request