我有一个我在Eclipse中创建的TestNG测试库。我试图设置一个单独的机器来运行它们从一个cron作业。第一步(在我看来)是让它们从该计算机上的命令行运行。我是TestNG的新手,这是我第一次尝试从命令行运行(配置问题肯定是潜在的)。
目前,我在运行TestSuite时收到NullPointer异常。正在进行三项测试。
$ java -Xmx1024m -ea -Dfile.encoding=US-ASCII -classpath ./*:/usr/share/java/*:lib/*:lib/google/guice/* org.testng.TestNG -d . ./smoke.xml
[Parser] Running:
/home/qabot/testing/autotest/smoke.xml
===============================================
SystemHealth
Total tests run: 0, Failures: 0, Skips: 0
===============================================
Exception in thread "main" java.lang.NullPointerException
at org.testng.internal.PackageUtils.findClassesInDirPackage(PackageUtils.java:183)
at org.testng.internal.PackageUtils.findClassesInDirPackage(PackageUtils.java:185)
at org.testng.internal.PackageUtils.findClassesInDirPackage(PackageUtils.java:185)
at org.testng.internal.PackageUtils.findClassesInPackage(PackageUtils.java:56)
at org.testng.xml.XmlPackage.initializeXmlClasses(XmlPackage.java:78)
at org.testng.xml.XmlPackage.getXmlClasses(XmlPackage.java:69)
at org.testng.TestRunner.init(TestRunner.java:189)
at org.testng.TestRunner.<init>(TestRunner.java:151)
at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:488)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:250)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:915)
at org.testng.TestNG.runSuitesLocally(TestNG.java:879)
at org.testng.TestNG.run(TestNG.java:787)
at org.testng.TestNG.privateMain(TestNG.java:952)
at org.testng.TestNG.main(TestNG.java:925)
环境:
Ubuntu 12.04.2 LTS
java version "1.7.0_21"
testng-jdk15-5.11.jar