I am trying to automate my WindowTester Unit tests by ruinning them from an ant script. I tried to alter the example given in wt-commons, under the org.wtc.samples.releng.
My tests runs fine when I run them under eclipse as "JUnit plug-in test".
I am trying to run the tests with the approach described here: http://www.eclipse.org/articles/article ... index.html
I have configured the classpath settings in the ant script so that it has the same classpath that eclipse uses when running the unit tests. "@dot.classpath" in the following snipped was created using the eclipse PDE tool.
My script contains the following targets:
- Code: Select all
<target name="test2">
<java classname="com.x.test.utils.PDETestPortLocator" fork="yes">
<classpath>
<path location="bin/"/>
</classpath>
</java>
<waitfor maxwait="10" maxwaitunit="second" checkevery="100" checkeveryunit="millisecond">
<available file="pde_test_port.properties"/>
</waitfor>
<property file="pde_test_port.properties"/>
<echo message="Using port ${pde.test.port} for listening to PDE Test run"/>
<parallel>
<daemons>
<antcall target="run_pde_test_listener"/>
</daemons>
<sequential>
<sleep seconds="5"/>
<!-- Give the listener a few seconds to start up -->
<antcall target="run_pde_tests"/>
</sequential>
</parallel>
</target>
<property name="plugin.name" value="com.x.test.scenarios.WorkflowTestSuite"/>
<target name="run_pde_test_listener">
<java classname="com.x.test.utils.PDETestResultsCollector" fork="yes" >
<sysproperty key="DEBUG" value="true"/>
<arg line="${plugin.name} ${pde.test.port}"/>
<jvmarg value="-Duser=admin -Dpasswd=admin" />
<classpath>
<path location="../../helios-swt4Copy2/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/junit.jar"/>
<path location="../../helios-swt4Copy2/plugins/org.eclipse.jdt.junit.core_3.6.0.v20100526-0800.jar"/>
<path refid="@dot.classpath"/>
<path location="C:/apache-ant-1.8.0/lib/ant.jar"/>
<path location="C:/apache-ant-1.8.0/lib/ant-junit.jar"/>
<path location="bin/"/>
</classpath>
</java>
</target>
<property name="plugin.dir" value="C:/ide/helios-swt4Copy2/plugins"/>
<property name="test.reports.dir" value="C:/ide/helios-swt4Copy2/testReports"/>
<property name="test.classes.list" value="com.x.test.utils.WorkFlowTestSuite"/>
<target name="run_pde_tests" >
<mkdir dir="${test.reports.dir}/output/ws"/>
<java dir="${plugin.dir}" classname="org.eclipse.equinox.launcher.Main" fork="yes" >
<arg line="-application com.windowtester.runner.application -product com.x.client.product -data ${test.reports.dir}/output/ws -dev bin -clean -port ${pde.test.port} -testpluginname com.x.client.swt -classnames ${test.classes.list} -verbose "/>
<classpath>
<path refid="@dot.classpath"/>
<path location="C:/apache-ant-1.8.0/lib/ant-junit.jar"/>
<path location="C:/apache-ant-1.8.0/lib/ant.jar"/>
<path location="../../helios-swt4Copy2/plugins/org.eclipse.jdt.junit.core_3.6.0.v20100526-0800.jar"/>
<path location="../../helios-swt4Copy2/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/junit.jar"/>
<path location="bin/"/>
<fileset dir="../../helios-swt4Copy2/plugins"
includes="org.eclipse.equinox.launcher_*.jar,
org.eclipse.equinox.p2.metadata.generator_*.jar"/>
</classpath>
</java>
</target>
This produces the following result:
>ant test2
Buildfile: ..\build.xml
test2:
[java] PDE Test port: 52146
[java] PDE Test port saved to file c:\ide\workspace_helios_swt4Copy2\com.x.client.swt\pde_test_port.properties
[echo] Using port 52146 for listening to PDE Test run
run_pde_test_listener:
[java] Listening on port 52146 for test suite com.x.test.scenarios.WorkflowTestSuite results ...
run_pde_tests:
[java] An error has occurred. See the log file
[java] ...\configuration\1286114715600.log.
[java] Java Result: 13
BUILD SUCCESSFUL
Total time: 12 seconds
In the mentioned log file I always get the same error message:
!SESSION 2010-10-03 15:05:15.044 -----------------------------------------------
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Framework arguments: -application com.windowtester.runner.application -product com.x.client.product -port 52146 -testpluginname com.x.client.swt -classnames com.x.test.utils.WorkFlowTestSuite -verbose
Command-line arguments: -application com.windowtester.runner.application -product com.x.client.product -data C:/ide/helios-swt4Copy2/testReports/output/ws -dev bin -clean -port 52146 -testpluginname com.x.client.swt -classnames com.x.test.utils.WorkFlowTestSuite -verbose
This is a continuation of log file C:\ide\helios-swt4Copy2\configuration\1286114715600.bak_0.log
Created Time: 2010-10-03 15:05:18.294
!ENTRY org.eclipse.equinox.registry 4 0 2010-10-03 15:05:18.295
!MESSAGE Could not parse XML contribution for "org.eclipse.pde.junit.runtime//plugin.xml". Any contributed extensions and extension points will be ignored.
!STACK 0
org.xml.sax.SAXException: Could not acquire XML parsing service.
at org.eclipse.core.internal.registry.ExtensionsParser.parseManifest(ExtensionsParser.java:392)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1061)
...
!ENTRY org.eclipse.equinox.registry 4 0 2010-10-03 15:05:18.298
!MESSAGE Could not parse XML contribution for "org.eclipse.pde.launching//plugin.xml". Any contributed extensions and extension points will be ignored.
!STACK 0
org.xml.sax.SAXException: Could not acquire XML parsing service.
at org.eclipse.core.internal.registry.ExtensionsParser.parseManifest(ExtensionsParser.java:392)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1061)
...
!ENTRY org.eclipse.equinox.registry 4 0 2010-10-03 15:05:18.300
!MESSAGE Could not parse XML contribution for "org.eclipse.pde.runtime//plugin.xml". Any contributed extensions and extension points will be ignored.
!STACK 0
org.xml.sax.SAXException: Could not acquire XML parsing service.
at org.eclipse.core.internal.registry.ExtensionsParser.parseManifest(ExtensionsParser.java:392)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1061)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1039)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.addBundle(EclipseBundleListener.java:184)
...
!ENTRY org.eclipse.equinox.registry 4 0 2010-10-03 15:05:18.304
!MESSAGE Could not parse XML contribution for "org.eclipse.pde.ua.core//plugin.xml". Any contributed extensions and extension points will be ignored.
!STACK 0
org.xml.sax.SAXException: Could not acquire XML parsing service.
at org.eclipse.core.internal.registry.ExtensionsParser.parseManifest(ExtensionsParser.java:392)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1061)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1039)
...
I couldn't find a proper way of runnung com.windowtester.runner.application from an ant script.
What ever change I make in the build script and classpath configuration, I always get the same SAXException.
I am using Eclipse 3.6 and the jdk that ant uses is jdk1.6.0_20.
I would appreciate any help regarding this issue.
Regards.