如何使用ant以headless格式运行Eclipse Junit插件UI测试作为核心测试目标?

如何使用ant以headless格式运行Eclipse Junit插件UI测试作为核心测试目标?,junit,eclipse-plugin,eclipse-pde,Junit,Eclipse Plugin,Eclipse Pde,我正在尝试运行一个junit插件测试,它是依赖于UI的插件测试用例。我能够在使用ant从命令行运行测试并将目标调用为ui测试时运行。启动工作台并执行测试套件。但是同样的蚂蚁改变了核心测试的目标,测试套件的执行失败了。产生异常的结果,如“org.eclipse.swt.SWTException:未能执行runnable(java.lang.IllegalStateException:尚未创建工作台)。” 使用windowtester开发的测试用例 我已经完成了eclipse测试框架3.6.2的设置

我正在尝试运行一个junit插件测试,它是依赖于UI的插件测试用例。我能够在使用ant从命令行运行测试并将目标调用为ui测试时运行。启动工作台并执行测试套件。但是同样的蚂蚁改变了核心测试的目标,测试套件的执行失败了。产生异常的结果,如“org.eclipse.swt.SWTException:未能执行runnable(java.lang.IllegalStateException:尚未创建工作台)。” 使用windowtester开发的测试用例

我已经完成了eclipse测试框架3.6.2的设置

依赖于UI的测试用例可以使用核心测试作为无头测试运行,而不是使用核心测试应用程序进行UI测试

java-jar plugins\org.eclipse.equinox.launcher\u 1.1.R36x\u v20101122\u 1400.jar-application org.eclipse.ant.core.antRunner-data E:\HeadlessWT\refactoring\u folder-buildfile E:\HeadlessWT\workspace\Test13.10\build.xml-Dos=win32-Dws=win32-Darch=x86\u 64

错误日志为:
不可能。这就是为什么Eclipse有两个不同的ui和核心测试目标。

不可能。这就是为什么Eclipse有两个不同的ui和核心测试目标

!SESSION 2011-07-21 16:45:26.593 -----------------------------------------------
eclipse.buildId=M20110210-1200
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product -application org.eclipse.test.coretestapplication formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,E:\HeadlessWT\workspace\Test13.10\..\../connectionProfile.MyTestSuite1310.xml -testPluginName Test13.10 -className connectionProfile.MyTestSuite1310
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data E:\HeadlessWT\workspace\Test13.10\..\../refactoring_folder -application org.eclipse.test.coretestapplication formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,E:\HeadlessWT\workspace\Test13.10\..\../connectionProfile.MyTestSuite1310.xml -testPluginName Test13.10 -className connectionProfile.MyTestSuite1310 -consolelog

!ENTRY com.instantiations.eclipse 1 0 2011-07-21 16:45:30.203
!MESSAGE UI test starting: connectionProfile.CreateConnProfile_testCreateConnProfile

!ENTRY com.instantiations.eclipse 1 0 2011-07-21 16:45:30.281
!MESSAGE 
*************************************************
WindowTester Runtime 201009131510
   OS:   Windows 2003, amd64, 5.2
   Java: Sun Microsystems Inc., 1.6.0_26
   Spec: Java Platform API Specification, Sun Microsystems Inc., 1.6
   VM:   Java Virtual Machine Specification, Sun Microsystems Inc., 1.0
*************************************************


!ENTRY com.instantiations.eclipse 1 0 2011-07-21 16:45:30.437
!MESSAGE Exception caught in SWTExecutionMonitor.waitUntilFinished():

!ENTRY com.instantiations.eclipse 4 0 2011-07-21 16:45:30.437
!MESSAGE Unexpected exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Workbench has not been created yet.)
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at com.windowtester.runtime.swt.internal.junit.SWTExecutionMonitor.doWaitForFinish(SWTExecutionMonitor.java:151)
    at com.windowtester.internal.runtime.junit.core.AbstractExecutionMonitor.waitUntilFinished(AbstractExecutionMonitor.java:205)
    at com.windowtester.internal.runtime.junit.core.SequenceRunner.waitUntilFinished(SequenceRunner.java:69)
    at com.windowtester.internal.runtime.junit.core.SequenceRunner.exec(SequenceRunner.java:53)
    at com.windowtester.runtime.common.UITestCaseCommon.runUITest(UITestCaseCommon.java:147)
    at com.windowtester.runtime.common.UITestCaseCommon.runBare(UITestCaseCommon.java:128)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:376)
    at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:209)
    at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
    at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
    at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
    at com.windowtester.runtime.swt.internal.finder.ShellFinder.getRootShell(ShellFinder.java:195)
    at com.windowtester.runtime.swt.internal.finder.ShellFinder$3.run(ShellFinder.java:180)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    ... 37 more

!ENTRY com.instantiations.eclipse 1 0 2011-07-21 16:45:30.781
!MESSAGE UI test starting: crudauto.ValidatingPKCRUD_testValidatingPKCRUD

!ENTRY com.instantiations.eclipse 1 0 2011-07-21 16:45:30.781
!MESSAGE Exception caught in SWTExecutionMonitor.waitUntilFinished():

!ENTRY com.instantiations.eclipse 4 0 2011-07-21 16:45:30.781
!MESSAGE Unexpected exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Workbench has not been created yet.)
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at 
......
......
    ... 37 more