Testng - 无效版本" 6.3-201110161418":非数字" 3-201110161418"

时间:2016-06-07 01:00:32

标签: java eclipse testng testng-eclipse

适用于Web开发人员的Eclipse Java EE IDE。

版本:Mars.2发布(4.5.2) 构建ID:20160218-0600

TestNG 6.9.11.201604020423 org.testng.eclipse.feature.group Cedric Beust

由于以下异常导致Testng失败,有没有人遇到此错误?

java.lang.IllegalArgumentException: invalid version "6.3-201110161418": non-numeric "3-201110161418"
    at org.osgi.framework.Version.parseInt(Version.java:170)
    at org.osgi.framework.Version.<init>(Version.java:130)
    at org.testng.remote.RemoteTestNG.getTestNGVersion(RemoteTestNG.java:87)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:39)
Caused by: java.lang.NumberFormatException: For input string: "3-201110161418"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at org.osgi.framework.Version.parseInt(Version.java:168)
    ... 3 more
[ServiceLoaderHelper] More than one working implementation for 'null', we will use the first one
[TestNG] Running:
  /Users/../test.xml

===============================================
    wurfl
    Tests run: 0, Failures: 0, Skips: 0
===============================================

java.lang.NoSuchMethodError: org.testng.ITestResult.getInstanceName()Ljava/lang/String;
    at org.testng.remote.strprotocol.TestResultMessage.<init>(TestResultMessage.java:133)
    at org.testng.remote.strprotocol.TestResultMessage.<init>(TestResultMessage.java:140)
    at org.testng.remote.strprotocol.RemoteTestListener.onTestFailure(RemoteTestListener.java:72)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1868)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1852)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1268)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:753)
    at org.testng.TestRunner.run(TestRunner.java:613)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1137)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1062)
    at org.testng.TestNG.run(TestNG.java:974)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)

1 个答案:

答案 0 :(得分:0)

默认行为在几个版本之前发生了变化,现在插件首先从类路径中获取testng。

罐子的命名不符合预期的格式。

但是请不要尝试更改它,因为你的testng版本太旧而且插件不支持它。

更改项目插件的配置,并要求它使用嵌入式版本。

编辑:这是https://github.com/cbeust/testng-eclipse/issues/224

之前的行为

只需升级TestNG版本,因为您使用的版本太旧而且不受支持。

顺便说一句,该插件应该提供更易理解的消息,我为此创建了一个新问题:https://github.com/cbeust/testng-eclipse/issues/255