vmassol     2002/10/30 13:57:40

  Modified:    src/plugins-build/cactus plugin.jelly project.xml
  Log:
  Patch from Eric Pugh that adds a new cactus:single -Dtestcase goal to run a single 
cactus test.
  
  Revision  Changes    Path
  1.8       +244 -194  jakarta-turbine-maven/src/plugins-build/cactus/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/plugin.jelly,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- plugin.jelly      21 Oct 2002 17:50:48 -0000      1.7
  +++ plugin.jelly      30 Oct 2002 21:57:39 -0000      1.8
  @@ -1,194 +1,244 @@
  -<?xml version="1.0"?>
  -
  -<!--
  -  =============================================================================
  -    Cactus plugin for Maven.
  -  =============================================================================
  --->
  -<project xmlns:j="jelly:core" xmlns:dvsl="dvsl">
  -
  -  <!-- Import all the jelly scripts found in the maven.cactus.conf.dir 
  -        directory. They are jelly scripts to start/stop the different
  -        containers. -->
  -  <fileScanner var="scanner">
  -    <fileset dir="${maven.cactus.scripts.dir}" includes="*.jelly"/>
  -  </fileScanner>
  -
  -  <j:forEach var="script" items="${scanner.iterator()}">
  -    <j:import inherit="true" uri="${script.toURL().toString()}"/>
  -  </j:forEach>
  -
  -  <!--
  -     ========================================================================
  -       Compile Cactus tests.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:compile" prereqs="java:compile">
  -
  -    <mkdir dir="${maven.cactus.build.dir}"/>
  -    <mkdir dir="${maven.cactus.classes.dir}"/>
  -
  -    <javac 
  -      destdir="${maven.cactus.classes.dir}"
  -      excludes="**/package.html"
  -      debug="${maven.compile.debug}"
  -      deprecation="${maven.compile.deprecation}"
  -      optimize="${maven.compile.optimize}">
  -      <classpath>
  -        <pathelement path="${maven.build.dest}"/>
  -        <path refid="maven.dependency.classpath"/>
  -        <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  -        <pathelement path="${plugin.getDependencyPath('junit')}"/>
  -      </classpath>
  -      <src>
  -        <path location="${maven.cactus.src.dir}"/>
  -      </src>
  -    </javac>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Generate a Cactus WAR file.
  -       
  -       Call the War goal from the War plugin and then update the war to
  -       add Cactus specific stuff: modified web.xml, Cactus related jars
  -       and Cactus tests.
  -       
  -       Note: ${maven.cactus.webxml} need to be set and point to a valid
  -       web.xml prior to calling this goal.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:war" prereqs="war:war,cactus:compile">
  -
  -    <copy tofile="${maven.cactus.build.dir}/jspRedirector.jsp" 
  -      file="${maven.cactus.jspRedirector}"/>
  -    
  -    <war update="true" webxml="${maven.cactus.webxml}"
  -      warfile="${maven.war.build.dir}/${pom.id}.war">
  -
  -      <!-- Cactus framework -->
  -      <lib 
dir="${maven.repo.local}/${plugin.getDependency('cactus:cactus').getProjectId()}/jars/">

  -        <include name="${plugin.getDependency('cactus:cactus').getArtifact()}"/>
  -      </lib>    
  -
  -      <!-- AspectJ runtime -->
  -      <lib 
dir="${maven.repo.local}/${plugin.getDependency('aspectj:aspectjrt').getProjectId()}/jars/">

  -        <include 
name="${plugin.getDependency('aspectj:aspectjrt').getArtifact()}"/>
  -      </lib>    
  -
  -      <!-- Commons Logging -->
  -      <lib 
dir="${maven.repo.local}/${plugin.getDependency('commons-logging').getProjectId()}/jars/">

  -        <include name="${plugin.getDependency('commons-logging').getArtifact()}"/>
  -      </lib>    
  -
  -      <!-- JUnit -->
  -      <lib 
dir="${maven.repo.local}/${plugin.getDependency('junit').getProjectId()}/jars/">
  -        <include name="${plugin.getDependency('junit').getArtifact()}"/>
  -      </lib>    
  -
  -       <!-- Add project dependencies jars -->
  -      <j:forEach var="lib" items="${pom.dependencies}">
  -        <j:if test="${lib.getProperty('war.bundle.jar')=='true'}">
  -          <lib dir="${maven.repo.local}/${lib.getProjectId()}/jars/">
  -            <include name="${lib.getArtifact()}"/>
  -          </lib>
  -        </j:if>
  -      </j:forEach>
  -
  -      <!-- Add the Cactus Jsp Redirector -->
  -      <fileset dir="${maven.cactus.build.dir}">
  -        <include name="jspRedirector.jsp"/>
  -      </fileset>
  -
  -      <!-- Add Cactus tests -->
  -      <classes dir="${maven.cactus.classes.dir}"/>
  -            
  -    </war>
  -
  -  </goal>
  -   
  -  <!--
  -     ========================================================================
  -       Start the Cactus tests using the <junit> Ant task.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:test">
  -
  -    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  -    <mkdir dir="${maven.cactus.build.resources.dir}"/>
  -
  -    <copy todir="${maven.cactus.build.resources.dir}"
  -      file="${maven.cactus.configFile}" filtering="on">
  -      <filterset>
  -        <filter token="maven.cactus.port" value="${maven.cactus.port}"/>
  -      </filterset>
  -    </copy>
  -
  -    <taskdef name="junit"
  -      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
  -
  -    <junit printSummary="yes" fork="true" dir="${basedir}"
  -      failureProperty="maven.cactus.test.failure">
  -
  -      <formatter type="xml"/>
  -      <formatter type="plain" usefile="${maven.cactus.junit.usefile}"/>
  -      <classpath>
  -        <path refid="maven.dependency.classpath"/>
  -        <pathelement location="${maven.build.dest}"/>
  -        <pathelement location="${maven.cactus.classes.dir}"/>
  -        <pathelement location="${maven.cactus.build.resources.dir}"/>
  -        <pathelement path="${plugin.getDependencyPath('junit')}"/>
  -        <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  -        <pathelement path="${plugin.getDependencyPath('commons-httpclient')}"/>
  -        <pathelement path="${plugin.getDependencyPath('commons-logging')}"/>
  -        <pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  -        <!-- These 2 jars should not be needed but it won't work without 
  -              them -->
  -        <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
  -        <pathelement path="${plugin.getDependencyPath('xerces')}"/>
  -      </classpath>
  -      <batchtest todir="${maven.cactus.test.reportsDirectory}">
  -        <fileset dir="${maven.cactus.src.dir}"/>
  -      </batchtest>
  -
  -    </junit>
  -
  -    <j:if test="${maven.cactus.test.failure}">
  -      <j:set var="cactusignore__" value="${maven.cactus.test.failure.ignore}X"/>
  -      <j:if test="${cactusignore__ == 'X'}">
  -        <fail message="There were test failures."/>
  -      </j:if>
  -    </j:if>
  -
  -  </goal>
  -
  -  <!--
  -     ========================================================================
  -       Generate Cactus test report (xdoc format). Run maven xdoc:transform
  -       to then transform into HTML.
  -     ========================================================================
  -  -->
  -  <goal name="cactus:generate" prereqs="init-dvsl-tag">
  -
  -    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  -
  -    <!-- Consolidate the reports into a single -->
  -    <junitreport todir="${maven.cactus.test.reportsDirectory}">
  -      <fileset dir="${maven.cactus.test.reportsDirectory}">
  -        <include name="TEST-*.xml"/>
  -      </fileset>
  -    </junitreport>
  -
  -    <!-- Convert single report into an xdoc -->
  -    <dvsl:dvsl
  -      basedir="${basedir}"
  -      style="${plugin.dir}/cactus.dvsl"
  -      toolboxFile="${plugin.dir}/toolbox.props"
  -      in="${maven.cactus.test.reportsDirectory}/TESTS-TestSuites.xml"
  -      out="${maven.gen.docs}/cactus-report.xml">
  -    </dvsl:dvsl>
  -    
  -  </goal>
  -
  -</project>
  +<?xml version="1.0"?>
  +
  +<!--
  +  =============================================================================
  +    Cactus plugin for Maven.
  +  =============================================================================
  +-->
  +<project xmlns:j="jelly:core" xmlns:dvsl="dvsl">
  +
  +  <!-- Import all the jelly scripts found in the maven.cactus.conf.dir 
  +       directory. They are jelly scripts to start/stop the different
  +       containers. -->
  +  <fileScanner var="scanner">
  +    <fileset dir="${maven.cactus.scripts.dir}" includes="*.jelly"/>
  +  </fileScanner>
  +
  +  <j:forEach var="script" items="${scanner.iterator()}">
  +    <j:import inherit="true" uri="${script.toURL().toString()}"/>
  +  </j:forEach>
  +
  +  <!--
  +     ========================================================================
  +       Compile Cactus tests.
  +     ========================================================================
  +  -->
  +  <goal name="cactus:compile" prereqs="java:compile">
  +
  +    <mkdir dir="${maven.cactus.build.dir}"/>
  +    <mkdir dir="${maven.cactus.classes.dir}"/>
  +
  +    <javac 
  +      destdir="${maven.cactus.classes.dir}"
  +      excludes="**/package.html"
  +      debug="${maven.compile.debug}"
  +      deprecation="${maven.compile.deprecation}"
  +      optimize="${maven.compile.optimize}">
  +      <classpath>
  +        <pathelement path="${maven.build.dest}"/>
  +        <path refid="maven.dependency.classpath"/>
  +        <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  +        <pathelement path="${plugin.getDependencyPath('junit')}"/>
  +      </classpath>
  +      <src>
  +        <path location="${maven.cactus.src.dir}"/>
  +      </src>
  +    </javac>
  +
  +  </goal>
  +
  +  <!--
  +     ========================================================================
  +       Generate a Cactus WAR file.
  +       
  +       Call the War goal from the War plugin and then update the war to
  +       add Cactus specific stuff: modified web.xml, Cactus related jars
  +       and Cactus tests.
  +       
  +       Note: ${maven.cactus.webxml} need to be set and point to a valid
  +       web.xml prior to calling this goal.
  +     ========================================================================
  +  -->
  +  <goal name="cactus:war" prereqs="war:war,cactus:compile">
  +
  +    <copy tofile="${maven.cactus.build.dir}/jspRedirector.jsp" 
  +      file="${maven.cactus.jspRedirector}"/>
  +    
  +    <war update="true" webxml="${maven.cactus.webxml}"
  +      warfile="${maven.war.build.dir}/${pom.id}.war">
  +
  +      <!-- Cactus framework -->
  +      <lib 
dir="${maven.repo.local}/${plugin.getDependency('cactus:cactus').getProjectId()}/jars/">
  +        <include name="${plugin.getDependency('cactus:cactus').getArtifact()}"/>
  +      </lib>    
  +
  +      <!-- AspectJ runtime -->
  +      <lib 
dir="${maven.repo.local}/${plugin.getDependency('aspectj:aspectjrt').getProjectId()}/jars/">
  +        <include name="${plugin.getDependency('aspectj:aspectjrt').getArtifact()}"/>
  +      </lib>    
  +
  +      <!-- Commons Logging -->
  +      <lib 
dir="${maven.repo.local}/${plugin.getDependency('commons-logging').getProjectId()}/jars/">
  +        <include name="${plugin.getDependency('commons-logging').getArtifact()}"/>
  +      </lib>    
  +
  +      <!-- JUnit -->
  +      <lib 
dir="${maven.repo.local}/${plugin.getDependency('junit').getProjectId()}/jars/">
  +        <include name="${plugin.getDependency('junit').getArtifact()}"/>
  +      </lib>    
  +
  +      <!-- Add project dependencies jars -->
  +      <j:forEach var="lib" items="${pom.dependencies}">
  +        <j:if test="${lib.getProperty('war.bundle.jar')=='true'}">
  +          <lib dir="${maven.repo.local}/${lib.getProjectId()}/jars/">
  +            <include name="${lib.getArtifact()}"/>
  +          </lib>
  +        </j:if>
  +      </j:forEach>
  +
  +      <!-- Add the Cactus Jsp Redirector -->
  +      <fileset dir="${maven.cactus.build.dir}">
  +        <include name="jspRedirector.jsp"/>
  +      </fileset>
  +
  +      <!-- Add Cactus tests -->
  +      <classes dir="${maven.cactus.classes.dir}"/>
  +            
  +    </war>
  +
  +  </goal>
  +   
  +  <!--
  +     ========================================================================
  +       Start the Cactus tests using the <junit> Ant task.
  +     ========================================================================
  +  -->
  +  <goal name="cactus:test">
  +
  +    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  +    <mkdir dir="${maven.cactus.build.resources.dir}"/>
  +
  +    <copy todir="${maven.cactus.build.resources.dir}"
  +      file="${maven.cactus.configFile}" filtering="on">
  +      <filterset>
  +        <filter token="maven.cactus.port" value="${maven.cactus.port}"/>
  +      </filterset>
  +    </copy>
  +
  +    <taskdef name="junit"
  +      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
  +
  +    <junit printSummary="yes" fork="true" dir="${basedir}"
  +      failureProperty="maven.cactus.test.failure">
  +
  +      <formatter type="xml"/>
  +      <formatter type="plain" usefile="${maven.cactus.junit.usefile}"/>
  +      <classpath>
  +        <path refid="maven.dependency.classpath"/>
  +        <pathelement location="${maven.build.dest}"/>
  +        <pathelement location="${maven.cactus.classes.dir}"/>
  +        <pathelement location="${maven.cactus.build.resources.dir}"/>
  +        <pathelement path="${plugin.getDependencyPath('junit')}"/>
  +        <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  +        <pathelement path="${plugin.getDependencyPath('commons-httpclient')}"/>
  +        <pathelement path="${plugin.getDependencyPath('commons-logging')}"/>
  +        <pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  +        <!-- These 2 jars should not be needed but it won't work without 
  +             them -->
  +        <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
  +        <pathelement path="${plugin.getDependencyPath('xerces')}"/>
  +      </classpath>
  +      <batchtest todir="${maven.cactus.test.reportsDirectory}">
  +        <fileset dir="${maven.cactus.src.dir}"/>
  +      </batchtest>
  +
  +    </junit>
  +
  +    <j:if test="${maven.cactus.test.failure}">
  +      <j:set var="cactusignore__" value="${maven.cactus.test.failure.ignore}X"/>
  +      <j:if test="${cactusignore__ == 'X'}">
  +        <fail message="There were test failures."/>
  +      </j:if>
  +    </j:if>
  +
  +  </goal>
  +
  +  <!--
  +     ========================================================================
  +       Generate Cactus test report (xdoc format). Run maven xdoc:transform
  +       to then transform into HTML.
  +     ========================================================================
  +  -->
  +  <goal name="cactus:generate" prereqs="init-dvsl-tag">
  +
  +    <mkdir dir="${maven.cactus.test.reportsDirectory}"/>
  +
  +    <!-- Consolidate the reports into a single -->
  +    <junitreport todir="${maven.cactus.test.reportsDirectory}">
  +      <fileset dir="${maven.cactus.test.reportsDirectory}">
  +        <include name="TEST-*.xml"/>
  +      </fileset>
  +    </junitreport>
  +
  +    <!-- Convert single report into an xdoc -->
  +    <dvsl:dvsl
  +      basedir="${basedir}"
  +      style="${plugin.dir}/cactus.dvsl"
  +      toolboxFile="${plugin.dir}/toolbox.props"
  +      in="${maven.cactus.test.reportsDirectory}/TESTS-TestSuites.xml"
  +      out="${maven.gen.docs}/cactus-report.xml">
  +    </dvsl:dvsl>
  +    
  +  </goal>
  +  
  +  <goal name="cactus:single" description="Execute a single test defined using the 
'testcase' variable"
  +                               prereqs="war:war,cactus:compile">
  +    
  +      <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>
  +          <taskdef name="junit"
  +            classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
  +  
  +          <junit printSummary="yes" fork="true" dir="${basedir}"
  +            failureProperty="maven.cactus.test.failure">
  +  
  +            <formatter type="xml"/>
  +            <formatter type="plain" usefile="${maven.cactus.junit.usefile}"/>
  +            <classpath>
  +              <path refid="maven.dependency.classpath"/>
  +              <pathelement location="${maven.build.dest}"/>
  +              <pathelement location="${maven.cactus.classes.dir}"/>
  +              <pathelement location="${maven.cactus.build.resources.dir}"/>
  +              <pathelement path="${plugin.getDependencyPath('junit')}"/>
  +              <pathelement path="${plugin.getDependencyPath('cactus:cactus')}"/>
  +              <pathelement 
path="${plugin.getDependencyPath('commons-httpclient')}"/>
  +              <pathelement path="${plugin.getDependencyPath('commons-logging')}"/>
  +              <pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
  +              <!-- These 2 jars should not be needed but it won't work without 
  +                   them -->
  +              <pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
  +              <pathelement path="${plugin.getDependencyPath('xerces')}"/>
  +            </classpath>
  +            <test name="${testcase}" todir="${maven.cactus.test.reportsDirectory}"/>
  +  
  +          </junit>
  +          
  +          <j:if test="${maven.cactus.test.failure}">
  +            <j:set var="cactusignore__" 
value="${maven.cactus.test.failure.ignore}X"/>
  +            <j:if test="${cactusignore__ == 'X'}">
  +              <fail message="There were test failures."/>
  +            </j:if>
  +          </j:if>  
  +    
  +        </j:otherwise>
  +      </j:choose>
  +  </goal>
  +
  +</project>
  
  
  
  1.15      +7 -0      jakarta-turbine-maven/src/plugins-build/cactus/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/project.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- project.xml       12 Oct 2002 20:48:08 -0000      1.14
  +++ project.xml       30 Oct 2002 21:57:39 -0000      1.15
  @@ -46,6 +46,13 @@
         </roles>
       </developer>
     </developers>
  +
  +  <contributors>
  +    <contributor>
  +      <name>Eric Pugh</name>
  +      <email>[EMAIL PROTECTED]</email>
  +    </contributor>
  +  </contributors>
     
     <dependencies>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:turbine-maven-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-maven-dev-help@;jakarta.apache.org>

Reply via email to