jvanzyl     01/12/15 23:08:46

  Modified:    .        build.xml default.properties
  Added:       .        build-test.xml
  Log:
  - creating a new test setup with everything in build-test.xml. preparing
    to start adding some tests for fulcrum
  
    NOTE: In order to use the <junit> task you must put the junit.jar
          in your $ANT_HOME/lib directory as stated in the Ant docs
  
    There is a mechanism in place that will allow you to write tests
    and have them picked up in a batch (i think the commented out code
    did the same thing) which is what i want to do.
  
    dlr: i left your tests in the form they are but you might want
         to convert them to junit tests. i think the problem was just
         the junit.jar missing from your $ANT_HOME/lib
  
  Revision  Changes    Path
  1.35      +5 -55     jakarta-turbine-fulcrum/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/build.xml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- build.xml 2001/11/23 14:37:34     1.34
  +++ build.xml 2001/12/16 07:08:46     1.35
  @@ -67,59 +67,6 @@
     </target>
   
     <!-- ================================================================== -->
  -  <!-- T E S T                                                            -->
  -  <!-- ================================================================== -->
  -
  -  <target name="test" depends="compile-test"
  -    description="==> runtime tests">
  -    <path id="test.classpath">
  -      <pathelement location="${junit.jar}"/>
  -    </path>
  -
  -<!-- I was not able to succesfully load a <junit> taskdef. (dlr)
  -    <available
  -      classname="junit.framework.TestCase"
  -      property="junit.present"
  -      classpathref="test.classpath"/>
  -
  -    <echo>junit.present=${junit.present}</echo>
  -
  -    <taskdef name="junit"
  -      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
  -      <classpath refid="test.classpath"/>
  -    </taskdef>
  -
  -    <junit printsummary="no" haltonfailure="yes">
  -      <classpath>
  -        <path refid="test.classpath"/>
  -        <path refid="classpath"/>
  -        <pathelement location="${build.dir}/${final.name}.jar"/>
  -        <pathelement location="${build.dir}/test"/>
  -      </classpath>
  -
  -      <formatter type="plain" usefile="false"/>
  -
  -      <batchtest>
  -        <fileset dir="${src.dir}/test">
  -          <include name="**/*Test.java"/>
  -        </fileset>
  -      </batchtest>
  -    </junit>
  --->
  -
  -    <java
  -      classname="org.apache.fulcrum.localization.LocalizationTest"
  -      fork="yes" failonerror="true">
  -      <classpath>
  -        <path refid="test.classpath"/>
  -        <path refid="classpath"/>
  -        <pathelement location="${build.dir}/classes"/>
  -        <pathelement location="${build.dir}/test"/>
  -      </classpath>
  -    </java>
  -  </target>
  -
  -  <!-- ================================================================== -->
     <!-- I N I T                                                            -->
     <!-- ================================================================== -->
   
  @@ -396,8 +343,11 @@
     <!-- C O M P I L E                                                      -->
     <!-- ================================================================== -->
     
  -  <target name="compile" depends="prepare"
  -          description="--> compiles the source code">
  +  <target 
  +    name="compile" 
  +    depends="prepare"
  +    description="--> compiles the source code">
  +    
       <javac srcdir="${build.dir}/src"
         destdir="${build.dir}/classes"
         excludes="**/package.html"
  
  
  
  1.12      +6 -0      jakarta-turbine-fulcrum/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/default.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- default.properties        2001/12/05 19:18:00     1.11
  +++ default.properties        2001/12/16 07:08:46     1.12
  @@ -14,6 +14,7 @@
   
   build.dir = ./bin
   build.src = ${build.dir}/src
  +build.dest = ${build.dir}/classes
   src.dir = ./src
   
   # If you rename the jakarta-turbine-torque module after checkout,
  @@ -29,6 +30,11 @@
   debug = on
   optimize = off
   deprecation = off
  +
  +# Testing
  +test.reportsDirectory = test-reports
  +test.dir = ${src.dir}/test
  +build.test = ${build.dir}/test
   
   # You must set values for the JAR file properties listed here, or in
   # your ${user.home}/build.properties or local build.properties file in
  
  
  
  1.1                  jakarta-turbine-fulcrum/build-test.xml
  
  Index: build-test.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project name="Stratum" default="test" basedir=".">
  
    <!-- Allow any user specific values to override the defaults -->
    <property file="${user.home}/build.properties" />
    <!-- Allow user defaults for this project -->
    <property file="build.properties" />
    <!-- Set default values for the build -->
    <property file="default.properties" />
  
    <!-- Construct compile classpath -->
    <path id="classpath">
      <pathelement location="${bsf.jar}"/>
      <pathelement location="${commons-collections.jar}"/>
      <pathelement location="${commons-email.jar}"/>
      <pathelement location="${commons-util.jar}"/>
      <pathelement location="${jaf.jar}"/>
      <pathelement location="${javamail.jar}"/>
      <pathelement location="${jdbc.jar}"/>
      <pathelement location="${jndi.jar}"/>
      <pathelement location="${log4j.jar}"/>
      <pathelement location="${regexp.jar}"/>
      <pathelement location="${servlet.jar}"/>
      <pathelement location="${torque.jar}"/>
      <pathelement location="${velocity.jar}"/>
      <pathelement location="${village.jar}"/>
      <pathelement location="${xalan.jar}"/>
      <pathelement location="${xerces.jar}"/>
      <pathelement location="${xmlrpc.jar}"/>
      <pathelement location="${build.dest}"/>
      <pathelement location="${junit.jar}"/>
    </path>
  
    <!-- ================================================================== -->
    <!-- T E S T                                                            -->
    <!-- ================================================================== -->
  
    <target 
      name="test" 
      depends="compile-test" 
      description="runs (junit) unit tests">
  
      <delete dir="${test.reportsDirectory}"/>
      <mkdir dir="${test.reportsDirectory}"/>
  
      <echo>
        Running all JUnit tests
      </echo>
      
      <junit printSummary="yes">
        <formatter type="plain"/>
        <classpath refid="classpath"/>
        <batchtest todir="${test.reportsDirectory}">
          <fileset dir="${build.dest}">
            <include name="**/*Test*.class"/>
            <exclude name="**/LocaleTokenizerTest.class"/>
            <exclude name="**/LocalizationTest.class"/>
          </fileset>
        </batchtest>
      </junit>
  
  
      <java
        classname="org.apache.fulcrum.localization.LocalizationTest"
        fork="yes" failonerror="true">
        <classpath>
          <path refid="classpath"/>
          <pathelement location="${build.dir}/classes"/>
          <pathelement location="${build.dir}/test"/>
        </classpath>
      </java>
    
    </target>
  
    <!-- ================================================================== -->
    <!-- C O M P I L E  T E S T S                                           -->
    <!-- ================================================================== -->
  
    <target
      name="compile-test"
      description="==> compiles the test source code">
      
      <ant antfile="build.xml" target="clean"/>
      <ant antfile="build.xml" target="compile"/>
      
      <javac srcdir="${test.dir}"
        destdir="${build.dest}"
        excludes="**/package.html"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">
        <classpath refid="classpath"/>
        <classpath>
          <pathelement path="${build.dest}"/>
        </classpath>
      </javac>
    </target>
  
  </project>
  
  
  

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

Reply via email to