You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oa...@apache.org on 2002/01/30 10:27:19 UTC

cvs commit: jakarta-commons-sandbox/services build.xml

oalexeev    02/01/30 01:27:19

  Modified:    services build.xml
  Log:
  Add junit sections to support unit testing.
  
  Revision  Changes    Path
  1.3       +48 -1     jakarta-commons-sandbox/services/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/services/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	19 Dec 2001 17:03:56 -0000	1.2
  +++ build.xml	30 Jan 2002 09:27:19 -0000	1.3
  @@ -3,7 +3,7 @@
   
   <!--
           "Services" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.2 2001/12/19 17:03:56 oalexeev Exp $
  +        $Id: build.xml,v 1.3 2002/01/30 09:27:19 oalexeev Exp $
   -->
   
   
  @@ -19,6 +19,9 @@
   
   
     <!-- The directories corresponding to your necessary dependencies -->
  +  <property name="junit.jar"               value="../../junit3.7/junit.jar"/>
  +  <property name="jaxp.jar"                value="../../jaxp-1.1/jaxp.jar"/>
  +  <property name="crimson.jar"             value="../../jaxp-1.1/crimson.jar"/>
     <property name="commons-collections.jar" value="../../jakarta-commons/collections/dist/commons-collections.jar"/>
     <property name="commons-beanutils.jar"   value="../../jakarta-commons/beanutils/dist/commons-beanutils.jar"/>
     <property name="commons-digester.jar"    value="../../jakarta-commons/digester/dist/commons-digester.jar"/>
  @@ -74,6 +77,25 @@
       <pathelement location="${commons-pool.jar}"/>
     </path>
   
  +  <!-- Construct unit test classpath -->
  +  <path id="test.classpath">
  +    <pathelement location="${build.home}/classes"/>
  +    <pathelement location="${build.home}/tests"/>
  +    <pathelement location="${junit.jar}"/>
  +    <pathelement location="${jaxp.jar}"/>
  +    <pathelement location="${crimson.jar}"/>
  +    <pathelement location="${commons-beanutils.jar}"/>
  +    <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-digester.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
  +    <pathelement location="${commons-pool.jar}"/>
  +  </path>
  +
  +  <!-- Should all tests fail if one does? -->
  +  <property name="test.failonerror"        value="true"/>
  +
  +  <!-- The test runner to execute -->
  +  <property name="test.runner"             value="junit.textui.TestRunner"/>
   
   <!-- ========== Executable Targets ======================================== -->
   
  @@ -149,6 +171,31 @@
       <copy     todir="${dist.home}/src" filtering="on">
         <fileset  dir="${source.home}"/>
       </copy>
  +  </target>
  +
  +<!-- ========== Testing section ======================================== -->
  +
  +  <target name="compile.tests" depends="compile" description="Compile unit test cases">
  +    <javac  srcdir="${test.home}"
  +           destdir="${build.home}/tests"
  +             debug="${compile.debug}"
  +       deprecation="${compile.deprecation}"
  +          optimize="${compile.optimize}">
  +      <classpath refid="test.classpath"/>
  +    </javac>
  +    <copy    todir="${build.home}/tests" filtering="on">
  +      <fileset dir="${test.home}" excludes="**/*.java"/>
  +    </copy>
  +  </target>
  +
  +  <target name="test.servicemanager" depends="compile.tests"
  +   description="Run basic ServiceManager unit tests ...">
  +    <echo message="Running basic ServiceManager tests ..."/>
  +    <java classname="${test.runner}" fork="yes"
  +        failonerror="${test.failonerror}">
  +      <arg value="org.apache.commons.services.ServiceManagerTest"/>
  +      <classpath refid="test.classpath"/>
  +    </java>
     </target>
   
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>