升级到Intellij 15后,TestNG测试不在IDE中运行

Ram*_*Ram 11 testng intellij-idea intellij-15

我将社区版IntelliJ从版本14升级到15.0.1,以及曾在IDE中运行的TestNG测试给出了这些例外.我该如何解决这些问题?

Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/CommandLineArgs
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.testng.CommandLineArgs
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
Run Code Online (Sandbox Code Playgroud)

如果需要更多信息,请与我们联系.

San*_*van 10

org.testng.CommandLineArgs类是在TestNG 6.0中引入的.我遇到了同样的问题,我的项目有TestNG 5.9.升级到较新版本后,测试成功运行.