epugh       2003/07/10 08:58:12

  Modified:    src/plugins-build/cactus/xdocs changes.xml tasks.xml
                        goals.xml
               src/plugins-build/cactus plugin.jelly
  Log:
  Added cactus:match goal.  Need to refactor catus:test/match/single goals to reuse 
code.
  
  Revision  Changes    Path
  1.15      +6 -1      maven/src/plugins-build/cactus/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/xdocs/changes.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- changes.xml       10 Jul 2003 12:09:38 -0000      1.14
  +++ changes.xml       10 Jul 2003 15:58:09 -0000      1.15
  @@ -7,7 +7,12 @@
   
     <body>
   
  -    <release version="3.0" date="in CVS">         
  +    <release version="3.0" date="in CVS">  
  +      <action dev="epugh" type="add">
  +        New goal cactus:match added that allows you to run just matching testcases.
  +        Pass the testcase in using -Dtestmatch=MyTestCase.  This brings to parity 
the
  +        cactus plugin with the test plugin for running types of tests.
  +      </action>         
         <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.
  
  
  
  1.7       +9 -0      maven/src/plugins-build/cactus/xdocs/tasks.xml
  
  Index: tasks.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/xdocs/tasks.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- tasks.xml 23 May 2003 21:05:56 -0000      1.6
  +++ tasks.xml 10 Jul 2003 15:58:09 -0000      1.7
  @@ -13,6 +13,15 @@
         </p>
   
         <subsection name="3.1">
  +       <p>
  +          <ul>
  +            <li>
  +              Refactor code in goals cactus:test, cactus:single, and cactus:match
  +              to share more code.  Currently there is a lot of cut-n-paste code.
  +              Should use jelly tags to reuse code.
  +            </li>
  +          </ul>
  +        </p>      
           <p>
             <ul>
               <li>
  
  
  
  1.7       +9 -1      maven/src/plugins-build/cactus/xdocs/goals.xml
  
  Index: goals.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/xdocs/goals.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- goals.xml 10 Jul 2003 12:09:38 -0000      1.6
  +++ goals.xml 10 Jul 2003 15:58:09 -0000      1.7
  @@ -35,7 +35,15 @@
             a <code>cactus.home.[container name]</code> property.  Pass the name
             of the testcase in using -Dtestcase=my.single.TestCase.
           </description>
  -      </goal>      
  +      </goal>  
  +      <goal>
  +        <name>cactus:match</name>
  +        <description>
  +          Run all Cactus tests that match a property 
<code>-Dtestmatch=MyTestCase</code> 
  +          on the containers for which you have defined
  +          a <code>cactus.home.[container name]</code> property.
  +        </description>
  +      </goal>           
         <goal>
           <name>cactus:report</name>
           <description>
  
  
  
  1.29      +130 -13   maven/src/plugins-build/cactus/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/cactus/plugin.jelly,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- plugin.jelly      10 Jul 2003 12:09:38 -0000      1.28
  +++ plugin.jelly      10 Jul 2003 15:58:11 -0000      1.29
  @@ -6,6 +6,12 @@
       Cactus project.
     =============================================================================
   -->
  +
  +<!-- 
  +     Note: There is significant refactoring required for the goals cactus:test, 
  +     cactus:single, and cactus:match.  The <cactus> tasks in each of those goals
  +     are mostly similar.
  +-->
   <project 
     xmlns:j="jelly:core" 
     xmlns:doc="doc" 
  @@ -348,22 +354,26 @@
           
     </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
  -     ========================================================================
  +  <!--
  +      ========================================================================
  +        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 -Dtestcase=my.single.TestCase
  +      ========================================================================
     -->
     <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" 
  +    <j:choose>
  +      <j:when test="${empty(testcase)}">
  +         <echo>
  +           You must define the test case to run via -Dtestcase=classname
  +           Example: maven -Dtestcase=MyTest cactus:single
  +         </echo>
  +       </j:when>
  +         
  +    <j:otherwise>    
  +     <cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war" 
           fork="yes" errorproperty="cactustests.error" 
           failureproperty="cactustests.failure"
           printsummary="${maven.cactus.printsummary}">
  @@ -439,8 +449,115 @@
         <ant:formatter type="xml"/>
         <!-- Run only a single testcase passed in via -Dtestcase=my.single.TestCase-->
         <ant:test name="${testcase}"/>
  -    </cactus>
  +     </cactus>
  +    </j:otherwise>         
  +   </j:choose>    
     </goal>
  +
  +  <!--
  +      ========================================================================
  +        Execute a Cactus tests on all containers which have been defined, 
  +        i.e. which have a ${cactus.home.[container name]} property
  +        defined.  Specify the matching tests with -Dmatch=FooTest
  +      ========================================================================
  +  -->
  +  <goal name="cactus:match" prereqs="cactus:init,cactus:cactifywar"
  +      description="Execute all the Cactus tests matching the given 'testmatch' 
variable">
  +
  +    <j:choose>
  +      <j:when test="${empty(testmatch)}">
  +         <echo>
  +           You must define the test case to match via -Dtestmatch=classname
  +           Example: maven -Dtestmatch=MyTest cactus:match
  +         </echo>
  +       </j:when>
  +         
  +    <j:otherwise>    
  +     <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 all testcases matched via -Dtestmatch=FooTest-->
  +      <ant:batchtest>
  +        <ant:fileset dir="${cactus.src.dir}">
  +          <include name="**/${testmatch}.java"/>
  +        </ant:fileset>
  +      </ant:batchtest>
  +     </cactus>
  +    </j:otherwise>         
  +   </j:choose>    
  +  </goal>
  +
   
     <!--
        ========================================================================
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to