A
andreas.h
Hi,
I've got a tricky problem with my automated build and test. I want to
set up an automated build server for my project and I want to build
and test my eclipse-plugins with the eclipse testing framework (see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co).
I'm using java 1.5, ant 1.7, eclipse 3.2.1 (both as development
environment and target platform) and the eclipse testing framework on
a windows XP machine.
So far so good. The automatic build of my plug-ins runs without
problems and my plugins get packaged. Then my build-script copies a
complete Eclipse-SDK in a test-folder and copies the newly built plug-
ins there. Then I call the eclipse platform from my ant script (but
the following error also occurs if I start it from the commandline)
and call the ui or core-test-application provided by the eclipse-test-
framework. I also specify the plugin with the test and also the
testclass itself. Below I will show the java-call and the setting of
the properties:
<target name="core-test">
<antcall target="eclipse-test">
<param name="application"
value="org.eclipse.test.coretestapplication"/>
</antcall>
</target>
<target name="eclipse-test">
<!--
Parameters to this target:
data-dir - the directory for Eclipse to write its data
plugin-name - the name of the plugin to test
classname - the name of the test class
vmargs - a string containing arguments to pass to the VM - defaults
to ""
-->
<tstamp>
<format property="TIMENOW" pattern="HHmmssSSSS"/>
</tstamp>
<!--set default heap sizes when running performance tests-->
<condition property="vmargs" value=" -Xms256M -Xmx256M">
<equals arg1="${test.target}" arg2="performance" />
</condition>
<property name="vmargs" value=""/>
<property name="formatter"
value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/ <property name="extraVMargs" value=""/>
<property name="plugin-path" value="" />
<property name="timeout" value="7200000" />
<property name="test-output" value="output.xml" /> <!-- This file is
not used anymore! Only the parent directory is relevant -->
<property name="test-application"
value="org.eclipse.test.uitestapplication" />
<property name="includePattern" value="**/*Test.class" />
<property name="excludePattern" value="" />
<property name="failonerror" value="false" />
<property name="testlistener"
value="org.eclipse.test.XMLTestListener"/>
<!--set default jvm to use for testing-->
<property name="jvm" value="${java.home}/bin/java" />
<!--Load value for eclipse.buildId from the config.ini file-->
<property file="${eclipse-home}/configuration/config.ini" />
<echo message="Running test from ${plugin-name} class ${testclass-
name}"/>
<echo message="${application} ${data-dir} ${plugin-name} ${testclass-
name} ${extraVMargs} ${plugin-path}" />
<!-- Produces the file '${default-filename}' -->
<java jar="${eclipse-home}/startup.jar" logerror="true" fork="true"
dir="."
timeout="${timeout}" jvm="${jvm}" failonerror="${failonerror}">
<arg line="-application ${application}"/>
<arg line="-data ${data-dir}"/>
<arg line="-formatter=${formatter},${test-output}"/>
<arg line="-testpluginname ${plugin-name}"/>
<arg line="-classname ${classname}"/>
<arg line="-os ${os}"/>
<arg line="-ws ${ws}"/>
<arg line="-arch ${arch}"/>
</java>
</target>
My problem is this, that everytime I start this the java call returns
1, indicating that a test case went wrong. I've added debug statements
and I saw that the Activator of my test-plugin was called but not the
test-class and the testmethod itself. Although I specified the plugin-
name and classname. I've checked everything I can think of, the plugin
is in the target-eclipse-platform, the plugin-name and classname are
correctly spelled. I tried some variations of the call parameters. I
called the platform from within another eclipse, I called it from the
commandline always return 1! And I don't understand why my testcase
isn't called, as I made the call excatly as it is specified in the
manual (http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/
testframework.html?view=co).
I hope someone out there can help me or at least give me a useful hint
as I'm at my wit's end I cannot think of something else to try.
Yours
Andreas Schweitzer
I've got a tricky problem with my automated build and test. I want to
set up an automated build server for my project and I want to build
and test my eclipse-plugins with the eclipse testing framework (see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co).
I'm using java 1.5, ant 1.7, eclipse 3.2.1 (both as development
environment and target platform) and the eclipse testing framework on
a windows XP machine.
So far so good. The automatic build of my plug-ins runs without
problems and my plugins get packaged. Then my build-script copies a
complete Eclipse-SDK in a test-folder and copies the newly built plug-
ins there. Then I call the eclipse platform from my ant script (but
the following error also occurs if I start it from the commandline)
and call the ui or core-test-application provided by the eclipse-test-
framework. I also specify the plugin with the test and also the
testclass itself. Below I will show the java-call and the setting of
the properties:
<target name="core-test">
<antcall target="eclipse-test">
<param name="application"
value="org.eclipse.test.coretestapplication"/>
</antcall>
</target>
<target name="eclipse-test">
<!--
Parameters to this target:
data-dir - the directory for Eclipse to write its data
plugin-name - the name of the plugin to test
classname - the name of the test class
vmargs - a string containing arguments to pass to the VM - defaults
to ""
-->
<tstamp>
<format property="TIMENOW" pattern="HHmmssSSSS"/>
</tstamp>
<!--set default heap sizes when running performance tests-->
<condition property="vmargs" value=" -Xms256M -Xmx256M">
<equals arg1="${test.target}" arg2="performance" />
</condition>
<property name="vmargs" value=""/>
<property name="formatter"
value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/ <property name="extraVMargs" value=""/>
<property name="plugin-path" value="" />
<property name="timeout" value="7200000" />
<property name="test-output" value="output.xml" /> <!-- This file is
not used anymore! Only the parent directory is relevant -->
<property name="test-application"
value="org.eclipse.test.uitestapplication" />
<property name="includePattern" value="**/*Test.class" />
<property name="excludePattern" value="" />
<property name="failonerror" value="false" />
<property name="testlistener"
value="org.eclipse.test.XMLTestListener"/>
<!--set default jvm to use for testing-->
<property name="jvm" value="${java.home}/bin/java" />
<!--Load value for eclipse.buildId from the config.ini file-->
<property file="${eclipse-home}/configuration/config.ini" />
<echo message="Running test from ${plugin-name} class ${testclass-
name}"/>
<echo message="${application} ${data-dir} ${plugin-name} ${testclass-
name} ${extraVMargs} ${plugin-path}" />
<!-- Produces the file '${default-filename}' -->
<java jar="${eclipse-home}/startup.jar" logerror="true" fork="true"
dir="."
timeout="${timeout}" jvm="${jvm}" failonerror="${failonerror}">
<arg line="-application ${application}"/>
<arg line="-data ${data-dir}"/>
<arg line="-formatter=${formatter},${test-output}"/>
<arg line="-testpluginname ${plugin-name}"/>
<arg line="-classname ${classname}"/>
<arg line="-os ${os}"/>
<arg line="-ws ${ws}"/>
<arg line="-arch ${arch}"/>
</java>
</target>
My problem is this, that everytime I start this the java call returns
1, indicating that a test case went wrong. I've added debug statements
and I saw that the Activator of my test-plugin was called but not the
test-class and the testmethod itself. Although I specified the plugin-
name and classname. I've checked everything I can think of, the plugin
is in the target-eclipse-platform, the plugin-name and classname are
correctly spelled. I tried some variations of the call parameters. I
called the platform from within another eclipse, I called it from the
commandline always return 1! And I don't understand why my testcase
isn't called, as I made the call excatly as it is specified in the
manual (http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/
testframework.html?view=co).
I hope someone out there can help me or at least give me a useful hint
as I'm at my wit's end I cannot think of something else to try.
Yours
Andreas Schweitzer