Added new cactus:single target to run just one testcase.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
760d65fd53
commit
3bd3c8a091
@ -59,6 +59,29 @@
|
||||
<j:set var="cactusSourcePresent" value="true"/>
|
||||
</util:available>
|
||||
|
||||
<!-- Prepare the directories for the JUnit reports -->
|
||||
<ant:mkdir dir="${cactus.reports.dir}"/>
|
||||
|
||||
<j:if test="${context.getVariable('cactus.home.jboss3x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/jboss3x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.orion1x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/orion1x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.orion2x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/orion2x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.resin2x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/resin2x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.tomcat4x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/tomcat4x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.tomcat5x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/tomcat5x"/>
|
||||
</j:if>
|
||||
|
||||
|
||||
</goal>
|
||||
|
||||
<!--
|
||||
@ -190,28 +213,6 @@
|
||||
<goal name="cactus:test" prereqs="cactus:init,cactus:cactifywar"
|
||||
description="Run all Cactus Test Cases">
|
||||
|
||||
<!-- Prepare the directories for the JUnit reports -->
|
||||
<ant:mkdir dir="${cactus.reports.dir}"/>
|
||||
|
||||
<j:if test="${context.getVariable('cactus.home.jboss3x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/jboss3x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.orion1x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/orion1x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.orion2x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/orion2x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.resin2x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/resin2x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.tomcat4x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/tomcat4x"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.home.tomcat5x') != null}">
|
||||
<ant:mkdir dir="${cactus.reports.dir}/tomcat5x"/>
|
||||
</j:if>
|
||||
|
||||
<cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war"
|
||||
fork="yes" errorproperty="cactustests.error"
|
||||
failureproperty="cactustests.failure"
|
||||
@ -345,6 +346,100 @@
|
||||
<ant:fail if="cactustests.error">At least one test had an error!</ant:fail>
|
||||
</j:if>
|
||||
|
||||
</goal>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Execute a single Cactus test on all containers which have been defined,
|
||||
i.e. which have a ${cactus.home.[container name]} property
|
||||
defined. Specify the case with -Dcactus.testcase=my.test.Case
|
||||
========================================================================
|
||||
-->
|
||||
<goal name="cactus:single" prereqs="cactus:init,cactus:cactifywar"
|
||||
description="Run a single Cactus Test Case">
|
||||
|
||||
<j:set var="testcase__" value="${testcase}X"/>
|
||||
<j:if test="${testcase__ == 'X'}">
|
||||
<ant:fail>You must provide a test case using -Dtestcase=my.single.TestCase</ant:fail>
|
||||
</j:if>
|
||||
|
||||
<cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war"
|
||||
fork="yes" errorproperty="cactustests.error"
|
||||
failureproperty="cactustests.failure"
|
||||
printsummary="${maven.cactus.printsummary}">
|
||||
<ant:classpath>
|
||||
<ant:pathelement path="${maven.build.dest}"/>
|
||||
<ant:pathelement location="${cactus.target.classes.dir}"/>
|
||||
<ant:path refid="maven.dependency.classpath"/>
|
||||
<ant:path refid="cactus.classpath"/>
|
||||
</ant:classpath>
|
||||
<containerset>
|
||||
<!-- TODO: Find how to set the port for JBoss 3x -->
|
||||
<jboss3x if="cactus.home.jboss3x"
|
||||
dir="${cactus.home.jboss3x}"
|
||||
output="${cactus.reports.dir}/jboss3x.out"
|
||||
todir="${cactus.reports.dir}/jboss3x"
|
||||
config="${cactus.jboss3x.config.name}"/>
|
||||
|
||||
<orion1x if="cactus.home.orion1x"
|
||||
dir="${cactus.home.orion1x}" port="${cactus.port}"
|
||||
output="${cactus.reports.dir}/orion1x.out"
|
||||
todir="${cactus.reports.dir}/orion1x"/>
|
||||
|
||||
<orion2x if="cactus.home.orion2x"
|
||||
dir="${cactus.home.orion2x}" port="${cactus.port}"
|
||||
output="${cactus.reports.dir}/orion2x.out"
|
||||
todir="${cactus.reports.dir}/orion2x"/>
|
||||
|
||||
<resin2x if="cactus.home.resin2x"
|
||||
dir="${cactus.home.resin2x}" port="${cactus.port}"
|
||||
output="${cactus.reports.dir}/resin2x.out"
|
||||
todir="${cactus.reports.dir}/resin2x">
|
||||
<j:if test="${context.getVariable('cactus.resin2x.config') != null}">
|
||||
<ant:setProperty name="resinconf" value="${cactus.resin2x.config}"/>
|
||||
</j:if>
|
||||
</resin2x>
|
||||
|
||||
<tomcat4x if="cactus.home.tomcat4x"
|
||||
dir="${cactus.home.tomcat4x}" port="${cactus.port}"
|
||||
output="${cactus.reports.dir}/tomcat4x.out"
|
||||
todir="${cactus.reports.dir}/tomcat4x">
|
||||
<j:if test="${context.getVariable('cactus.tomcat4x.config') != null}">
|
||||
<ant:setProperty name="serverxml" value="${cactus.tomcat4x.config}"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.tomcat4x.tmpdir') != null}">
|
||||
<ant:setProperty name="tmpdir" value="${cactus.tomcat4x.tmpdir}"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.tomcat4x.conf.dir') != null}">
|
||||
<conf dir="${cactus.tomcat4x.conf.dir}"
|
||||
includes="${cactus.tomcat4x.conf.includes}"
|
||||
excludes="${cactus.tomcat4x.conf.excludes}"/>
|
||||
</j:if>
|
||||
</tomcat4x>
|
||||
|
||||
<tomcat5x if="cactus.home.tomcat5x"
|
||||
dir="${cactus.home.tomcat5x}" port="${cactus.port}"
|
||||
output="${cactus.reports.dir}/tomcat5x.out"
|
||||
todir="${cactus.reports.dir}/tomcat5x">
|
||||
<j:if test="${context.getVariable('cactus.tomcat5x.config') != null}">
|
||||
<ant:setProperty name="serverxml" value="${cactus.tomcat5x.config}"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.tomcat5x.tmpdir') != null}">
|
||||
<ant:setProperty name="tmpdir" value="${cactus.tomcat5x.tmpdir}"/>
|
||||
</j:if>
|
||||
<j:if test="${context.getVariable('cactus.tomcat5x.conf.dir') != null}">
|
||||
<conf dir="${cactus.tomcat5x.conf.dir}"
|
||||
includes="${cactus.tomcat5x.conf.includes}"
|
||||
excludes="${cactus.tomcat5x.conf.excludes}"/>
|
||||
</j:if>
|
||||
</tomcat5x>
|
||||
|
||||
</containerset>
|
||||
<ant:formatter type="plain" usefile="${cactus.junit.usefile}"/>
|
||||
<ant:formatter type="xml"/>
|
||||
<!-- Run only a single testcase passed in via -Dtestcase=my.single.TestCase-->
|
||||
<ant:test name="${testcase}"/>
|
||||
</cactus>
|
||||
</goal>
|
||||
|
||||
<!--
|
||||
|
||||
@ -7,10 +7,14 @@
|
||||
|
||||
<body>
|
||||
|
||||
<release version="3.0" date="in CVS">
|
||||
<release version="3.0" date="in CVS">
|
||||
<action dev="epugh" type="add">
|
||||
New goal cactus:single added that allows you to run just a single testcase.
|
||||
Pass the testcase in using -Dtestcase=my.single.TestCase.
|
||||
</action>
|
||||
<action dev="evenisse" type="fix">
|
||||
Add xml declaration to generated report. Fixed for character encoding.
|
||||
</action>
|
||||
</action>
|
||||
<action dev="epugh" type="add">
|
||||
Ability to optionally specify for Tomcat 4x and 5x a directory to which
|
||||
the container will be installed for the tests.
|
||||
|
||||
@ -28,6 +28,14 @@
|
||||
a <code>cactus.home.[container name]</code> property.
|
||||
</description>
|
||||
</goal>
|
||||
<goal>
|
||||
<name>cactus:single</name>
|
||||
<description>
|
||||
Run a single Cactus test on the containers for which you have defined
|
||||
a <code>cactus.home.[container name]</code> property. Pass the name
|
||||
of the testcase in using -Dtestcase=my.single.TestCase.
|
||||
</description>
|
||||
</goal>
|
||||
<goal>
|
||||
<name>cactus:report</name>
|
||||
<description>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user