|
From: CC U. <cc...@gm...> - 2009-09-11 16:56:16
|
Hello,
I am using JUnit with CruiseControl. The tests are executed successfully. I get the following in the console window:
[cc]Sep-11 18:44:13 ScriptRunner - ccAntProgress -- init
[cc]Sep-11 18:44:13 ScriptRunner - ccAntProgress -- compile
[cc]Sep-11 18:44:13 ScriptRunner - ccAntProgress -- test
[cc]Sep-11 18:44:13 ScriptRunner - [junit] Testsuite: MyClassTest
[cc]Sep-11 18:44:13 ScriptRunner - [junit] Tests run: 1, Failures: 0, Error
s: 0, Time elapsed: 0,093 sec
[cc]Sep-11 18:44:13 ScriptRunner - [junit]
[cc]Sep-11 18:44:13 ScriptRunner -
[cc]Sep-11 18:44:13 ScriptRunner - BUILD SUCCESSFUL
Yet in the JUnit log file, I can read the following:
<testsuite errors="1" failures="0" ...
When I open the CruiseControl web UI, it tells me:
Test MyClassTest FAILED
Even more annoying is the line below:
Unit Tests: (0)
No Tests Run
This project doesn't have any tests
However, obviously CruiseControl is accessing the test results. Do I have to register the tests additionally in config.xml?
This is my config.xml:
<cruisecontrol>
<project name="test">
<listeners>
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
</listeners>
<bootstrappers>
<currentbuildstatusbootstrapper file="logs/${project.name}/status.txt" />
</bootstrappers>
<modificationset quietperiod="1">
<!-- touch any file in connectfour project to trigger a build -->
<svn LocalWorkingCopy="C:/Users/.../Documents/test-checkout"/>
</modificationset>
<schedule interval="30">
<composite>
<exec command="svn" args="up C:\Users\...\Documents\test-checkout"/>
<ant anthome="apache-ant-1.7.0" buildfile="C:/Users/.../Documents/test-checkout/build.xml" target="compile,test"/>
</composite>
</schedule>
<log dir="projects/${project.name}">
</log>
<publishers>
<!--htmlemail mailhost="smtp.mail.yahoo.de"
returnaddress="ber...@ya..."
username="ber...@ya..."
password=""
skipusers="true"
reportsuccess="fixes"
subjectprefix="[CruiseControl]"
buildresultsurl="http://buildserver:8080/cruisecontrol/buildresults"
logdir="logs/${project.name}/"
xsldir="C:\Program Files\CruiseControl\webapps\cruisecontrol\xsl"
mailport="25"
css="C:\Program Files\CruiseControl\webapps\cruisecontrol\css\cruisecontrol.css">
<failure address="ber...@ya..." />
<success address="ber...@ya..." />
</htmlemail-->
<!--artifactspublisher dest="artifacts/${project.name}" file="C:\Users\...\Documents\test-checkout\build"/-->
</publishers>
</project>
</cruisecontrol>
And the build.xml from Ant:
<?xml version="1.0"?>
<project name="test" default="compile" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="junit.dir" value="C:\Program Files\CruiseControl\projects\test"/>
<property name="test.class" value="MyClassTest"/>
<path id="classpath">
<pathelement location="${build.dir}" />
<pathelement location="${junit.jar}" />
</path>
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${junit.dir}"/>
</target>
<target name="compile" depends="init">
<!-- Compile the java code -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="test" depends="compile" description="unit test" >
<junit errorProperty="test.failed" failureProperty="test.failed">
<test name="${test.class}" todir="${junit.dir}" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<classpath refid="classpath" />
</junit>
<fail message="Tests failed: check test reports." if="test.failed" />
</target>
</project>
Thanks a lot to anyone helping me!
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
|