使用testNG套件运行.xml文件时,登录org.eclipse.ui时出错



如果我创建一个测试类来通过测试,一切都像预期的那样正常工作。如果我随后尝试通过.xml文件运行此测试,那么我将得到以下错误日志。我确信我所有的包和类都被正确地标记了。我试过卸载和重新安装eclipse并制作新的工作区,并尝试使用多个不同的类和包,但我总是得到相同的错误。

我在64位Windows 7上运行Eclipse Mars。

谢谢。

将发送以下数据:

------
STATUS
------
pluginId            org.eclipse.ui
pluginVersion       3.107.0.v20150507-1945
code                0
severity            4
message             Unhandled event loop exception
fingerprint         3ed0857c
Exception:java.lang.NullPointerException: null
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:431)
     at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:74)
     at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:123)
     at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
     at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
     at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
     at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
     at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:788)
     at org.eclipse.jface.action.ActionContributionItem$9.handleEvent(ActionContributionItem.java:1293)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
     at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
     at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
     at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
     at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
     at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
     at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
     at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
     at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
     at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
     at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
     at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
     at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(null:-2)
     at sun.reflect.NativeMethodAccessorImpl.invoke(null:-1)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
     at java.lang.reflect.Method.invoke(null:-1)
     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
     at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
------
REPORT
------
anonymousId         3741d217-639d-4c96-970a-231ce281c5eb
name                
email               
comment             
eclipseBuildId      4.5.1.M20150904-0015
eclipseProduct      org.eclipse.epp.package.jee.product
javaRuntimeVersion  1.8.0_60-b27
osgiWs              win32
osgiOs              Windows7
osgiOsVersion       6.1.0
osgiArch            x86_64
logMessage          false
ignoreSimilar       false
-------
BUNDLES
-------
name                org.eclipse.core.databinding.observable
version             1.5.0.v20150422-0725
name                org.eclipse.core.databinding
version             1.5.0.v20150422-0725
name                org.eclipse.core.runtime
version             3.11.1.v20150903-1804
name                org.eclipse.debug.ui
version             3.11.100.v20150731-1137
name                org.eclipse.e4.ui.workbench
version             1.3.0.v20150531-1948
name                org.eclipse.e4.ui.workbench.swt
version             0.13.0.v20150504-0621
name                org.eclipse.equinox.app
version             1.3.300.v20150423-1356
name                org.eclipse.equinox.launcher
version             1.3.100.v20150511-1540
name                org.eclipse.jface
version             3.11.0.v20150602-1400
name                org.eclipse.swt
version             3.104.1.v20150825-0743
name                org.eclipse.ui
version             3.107.0.v20150507-1945
name                org.eclipse.ui.ide.application
version             1.1.0.v20150422-0725
name                org.eclipse.ui.ide
version             3.11.0.v20150825-2158
name                org.testng.eclipse
version             6.9.7.201510070420

这是我使用的类:

package Test1;
import org.testng.annotations.Test;
public class NewTest {
  @Test
  public void testOne() {
      System.out.println("Run this.");
  }
}

然后右键单击类,导航到TestNG并转换为TestNG。

testng.xml出现在我的项目文件夹下(不在项目的任何子文件夹中),testng.xml读作

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
  <test name="Test">
    <classes>
      <class name="Test1.NewTest"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->

当前版本的Eclipse Mars (v4.5)与TestNG()结合使用确实存在一个bug。请参阅bug中的注释,因为有一个解决方案。

同样的问题,类似的解决方法:作为TestNG Suite在eclipse中不工作

相关内容

最新更新