openamf/build ant.properties,1.2,1.3 build.xml,1.48,1.49

[email protected] Wed, 20 Aug 2003 12:01:18 -0700
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/build
In directory sc8-pr-cvs1:/tmp/cvs-serv29741/build

Modified Files:
	ant.properties build.xml 
Log Message:
integrated junit testing

Index: ant.properties
===================================================================
RCS file: /cvsroot/openamf/openamf/build/ant.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ant.properties	14 Apr 2003 02:17:02 -0000	1.2
--- ant.properties	20 Aug 2003 19:01:16 -0000	1.3
***************
*** 1,2 ****
! # deploy.dir=C:/java/jboss-3.0.6/server/default/deploy/
! deploy.dir=/usr/java/jboss-3.0.6/server/default/deploy/
\ No newline at end of file
--- 1 ----
! deploy.dir=C:/resin-ee-2.1.8/webapps
\ No newline at end of file

Index: build.xml
===================================================================
RCS file: /cvsroot/openamf/openamf/build/build.xml,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** build.xml	19 Aug 2003 23:08:55 -0000	1.48
--- build.xml	20 Aug 2003 19:01:16 -0000	1.49
***************
*** 8,12 ****
  -->
  <!-- $Header$ -->
! <project name="openamf" default="deploy-war" basedir="..">
  	<!--
  		Give user a chance to override property file
--- 8,12 ----
  -->
  <!-- $Header$ -->
! <project name="openamf" default="usage" basedir="..">
  	<!--
  		Give user a chance to override property file
***************
*** 14,24 ****
  	<property file="${user.home}/ant.properties"/>
  	<property file="build/ant.properties"/>
- 	<path id="project.class.path">
- 		<fileset dir="lib">
- 			<include name="**/*.jar"/>
- 		</fileset>
- 		<!-- append the external classpath lastly -->
- 		<pathelement path="${java.class.path}"/>
- 	</path>
  	<property name="name" value="openamf"/>
  	<property name="src.dir" value="src"/>
--- 14,17 ----
***************
*** 35,41 ****
  	<property name="build.dir" value="build"/>
  	<property name="lib.dir" value="lib"/>
  	<property name="ant.jar.file" value="${lib.dir}/ant.jar"/>
  	<property name="astranslator.jar.file" value="${lib.dir}/astranslator-1.5.2.jar"/>
- 	<!-- add jars for webservices -->
  	<property name="axis.jar.file" value="${lib.dir}/axis.jar"/>
  	<property name="wsdl4j.jar.file" value="${lib.dir}/wsdl4j.jar"/>
--- 28,35 ----
  	<property name="build.dir" value="build"/>
  	<property name="lib.dir" value="lib"/>
+ 	<property name="props.dir" value="properties"/>
+ 
  	<property name="ant.jar.file" value="${lib.dir}/ant.jar"/>
  	<property name="astranslator.jar.file" value="${lib.dir}/astranslator-1.5.2.jar"/>
  	<property name="axis.jar.file" value="${lib.dir}/axis.jar"/>
  	<property name="wsdl4j.jar.file" value="${lib.dir}/wsdl4j.jar"/>
***************
*** 52,55 ****
--- 46,50 ----
  	<property name="lang.jar.file" value="${lib.dir}/commons-lang-1.0.1.jar"/>
  	<property name="httpclient.jar.file" value="${lib.dir}/commons-httpclient-2.0-beta1.jar"/>
+ 
  	<property name="javadocs.build.dir" value="${build.dir}/javadocs"/>
  	<property name="core.build.dir" value="${build.dir}/core"/>
***************
*** 70,73 ****
--- 65,101 ----
  	<property name="build.deploy.dir" value="${build.dir}/deploy"/>
  	<property name="deploy.dir" value="${JBOSS_HOME}/deploy"/>
+ 
+ 	<path id="project.class.path">
+ 	  <pathelement path="${build.dir}/core"/>
+ 	  <pathelement path="${props.dir}"/>
+ 		<fileset dir="lib">
+ 			<include name="**/*.jar"/>
+ 		</fileset>
+     <pathelement location="${java.home}/jre/lib/rt.jar"/>
+     <pathelement location="${java.home}/lib/tools.jar"/>
+ 	</path>
+ 
+ 	<target name="usage">
+     <echo>
+ $ ant [target]
+ Where [target] is one of:
+   jar         - builds ${jar.file}
+   war         - builds ${war.file}
+   ear         - builds ${ear.file}
+   deploy-war  - builds war and copies to
+                 ${deploy.dir}
+   deploy-ear  - builds ear and copies to
+                 ${deploy.dir}
+   javadoc     - builds API documentation in ${javadocs.build.dir}
+   dist        - builds ${dist.zip.file}
+                 and ${examples.zip.file}
+   test        - runs test suite
+                 use -Dtest=path/to/package/or/java/file to run
+                 tests in a single package or a single test file
+   clean       - deletes all compiled files,
+                 generated docs and packaged distributables
+     </echo>
+ 	</target>
+ 
  	<target name="clean">
  		<delete file="${jar.file}"/>
***************
*** 83,86 ****
--- 111,115 ----
  		<delete dir="${javadocs.build.dir}"/>
  	</target>
+ 
  	<target name="prepare">
  		<mkdir dir="${core.build.dir}"/>
***************
*** 95,98 ****
--- 124,128 ----
  		<mkdir dir="${javadocs.build.dir}"/>
  	</target>
+ 
  	<target name="ejbdoclet" depends="prepare">
  		<taskdef name="ejbdoclet" classname="xdoclet.ejb.EjbDocletTask" classpath="${xdoclet.jar.file};${log4j.jar.file};${ant.jar.file}"/>
***************
*** 112,115 ****
--- 142,146 ----
  		</ejbdoclet>
  	</target>
+ 
  	<target name="compile-ejbs" depends="ejbdoclet">
  		<!-- Compile EJBs -->
***************
*** 118,121 ****
--- 149,153 ----
  		</javac>
  	</target>
+ 
  	<!-- Compile core  -->
  	<target name="compile-core" depends="prepare">
***************
*** 125,128 ****
--- 157,161 ----
  		</javac>
  	</target>
+ 
  	<!-- Compile test  -->
  	<target name="compile-test" depends="prepare">
***************
*** 132,135 ****
--- 165,169 ----
  		</javac>
  	</target>
+ 
  	<!-- Create jar  -->
  	<target name="jar" depends="compile-core">
***************
*** 138,141 ****
--- 172,176 ----
  		</jar>
  	</target>
+ 
  	<!-- Create war  -->
  	<target name="war" depends="jar, compile-test">
***************
*** 164,167 ****
--- 199,203 ----
  		</jar>
  	</target>
+ 
  	<!-- Create EJB-JAR file -->
  	<target name="ejb-jar" depends="compile-ejbs">
***************
*** 174,177 ****
--- 210,214 ----
  		</jar>
  	</target>
+ 
  	<!-- Create EAR file -->
  	<target name="ear" depends="war,ejb-jar">
***************
*** 181,184 ****
--- 218,222 ----
  		</ear>
  	</target>
+ 
  	<target name="deploy-ear" depends="ear">
  		<!--Delete war file from deploy dir if it exists before deploying ear-->
***************
*** 186,189 ****
--- 224,228 ----
  		<copy file="${ear.file}" todir="${deploy.dir}"/>
  	</target>
+ 
  	<target name="deploy-war" depends="war">
  		<!--Delete ear file from deploy dir if it exists before deploying war-->
***************
*** 191,194 ****
--- 230,234 ----
  		<copy file="${war.file}" todir="${deploy.dir}"/>
  	</target>
+ 
  	<target name="javadocs" depends="prepare">
  		<javadoc packagenames="org.openamf.*,flashgateway.*" sourcepath="${java.src.dir}" defaultexcludes="yes" destdir="${javadocs.build.dir}" author="true" version="true" use="true" failonerror="yes" classpathref="project.class.path" windowtitle="openamf">
***************
*** 196,199 ****
--- 236,240 ----
  		</javadoc>
  	</target>
+ 
  	<target name="dist" depends="ear,javadocs">
  		<delete file="${dist.zip.file}"/>
***************
*** 234,236 ****
--- 275,325 ----
  		</zip>
  	</target>
+ 
+ 
+   <!--
+      - Specify test with -Dtest=path/to/test/dir/, -Dtest=path/to/test/file, -Dtest=TestClass.java
+      - Default is to run all tests
+     -->
+   <target name="prepare-test" depends="prepare">
+     <condition property="test_include"    value="${test}/*Test.java">
+       <available file="${war.src}/${test}" type="dir"/>
+     </condition>
+     <condition property="test_include"    value="${test}">
+       <available file="${war.src}/${test}" type="file"/>
+     </condition>
+     <condition property="test_include"    value="**/${test}">
+       <and>
+         <isset property="test"/>
+         <not><isset property="test_include"/></not>
+       </and>
+     </condition>
+     <condition property="test_include"    value="**/*Test.java">
+       <not><isset property="test_include"/></not>
+     </condition>
+   </target>
+ 
+   <target name="test" depends="deploy-war,prepare-test">
+ 
+     <echo>Testing: ${test_include}</echo>
+ 
+     <junit printsummary="withOutAndErr"
+            haltonfailure="yes"
+            haltonerror="yes">
+ 
+       <sysproperty key="log4j.debug" value="false"/>
+       <sysproperty key="log4j.configuration" value="log4j-junit.properties"/>
+ 
+       <classpath refid="project.class.path"/>
+ 
+       <formatter type="plain" usefile="false"/>
+ 
+       <batchtest fork="no">
+         <fileset dir="${java.src.dir}">
+           <include name="${test_include}" />
+           <exclude name="org/openamf/test/**" />
+         </fileset>
+       </batchtest>
+     </junit>
+   </target>
+ 
  </project>




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0