Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 运行TestNG测试时发生异常_Java_Intellij Idea_Testng_Intellij 14 - Fatal编程技术网

Java 运行TestNG测试时发生异常

Java 运行TestNG测试时发生异常,java,intellij-idea,testng,intellij-14,Java,Intellij Idea,Testng,Intellij 14,我似乎根本无法运行任何测试,因为我遇到以下异常: java.lang.AbstractMethodError:org.testng.remote.RemoteTestNG$delegatingestrunnerfactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/util/Collection;Ljava/util/List;)Lorg/testng/TestRunner; 位于org.testng.Suit

我似乎根本无法运行任何测试,因为我遇到以下异常:

java.lang.AbstractMethodError:org.testng.remote.RemoteTestNG$delegatingestrunnerfactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/util/Collection;Ljava/util/List;)Lorg/testng/TestRunner; 位于org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner

我们使用TestNG,依赖项中的jar文件如下所示:

testng.6.9.12


有什么想法吗?

升级到IntelliJ 2016.1的最新版本解决了这个问题。

我在运行testNG套件时也遇到AbstractMethod错误。以下是对我有效的解决方案:

  • 在Intellij中打开注册表

    • (在Mac上)
    • 按:命令选项Shift/
    • 单击:注册表
  • 检查testng_sm_runner框值

  • 基本上,我遵循了这里的说明:

    您可以尝试更新IDE的TestNG插件。 您使用的TestNG版本和安装在IDE中的TestNG插件可能不兼容。所以在更新之后,有可能
    它会起作用。

    问题可能出在testng.jar上。尝试使用不同版本的testng。您应该在上打开一个问题,但我认为IDEA14太旧,不支持新的testng版本。奇怪。几天前,测试运行良好。如果它是testng.jar的版本升级,那么它不应该通过干净的重建工作吗?我们的构建系统是gradle,我们有多个项目。我还必须升级到IntelliJ 2016来解决这个问题。我试过Intellij14和15,但没有成功。