aslom 2002/11/24 22:29:12 Modified: java build.xml classpath.bat classpath.sh Log: updated build.xml to support compiling JUnit tests and executing them (execution does not work for now due to hardcoded setup assumptions in tests code Revision Changes Path 1.12 +55 -3 xml-axis-wsif/java/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/xml-axis-wsif/java/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- build.xml 12 Nov 2002 22:15:49 -0000 1.11 +++ build.xml 25 Nov 2002 06:29:12 -0000 1.12 @@ -33,14 +33,14 @@ - srcdist -> creates the complete src distribution Author: - Aleksander Slominski <[EMAIL PROTECTED]> + Aleksander Slominski <[EMAIL PROTECTED]> Matthew J. Duftler <[EMAIL PROTECTED]> Jeremy Hughes <[EMAIL PROTECTED]> Owen Burroughs <[EMAIL PROTECTED]> ==================================================================== --> -<project default="compile" basedir="."> +<project default=" " basedir="."> <target name="init"> <property name="Name" value="WSIF"/> @@ -68,6 +68,7 @@ <property name="dynamic.dest" value="./build/classes"/> <property name="build.lib" value="./build/lib"/> <property name="build.samples" value="./build/samples"/> + <property name="build.tests" value="./build/tests"/> <property name="build.javadocs" value="./build/javadocs"/> <property name="jar" value="${build.dir}/lib/${name}.jar"/> @@ -116,7 +117,8 @@ <available property="apachesoap.present" classname="org.apache.soap.Envelope" /> <available property="apacheaxis.present" classname="org.apache.axis.message.SOAPEnvelope" /> <available property="j2c.present" classname="javax.resource.Referenceable" /> - + <available property="junit.present" classname="junit.framework.TestCase" /> + </target> <target name="checkSoapRMI" unless="soaprmi.present"> @@ -143,6 +145,10 @@ <echo message="Warning: J2C dependencies were not resolved."/> </target> + <target name="checkJUnit" unless="junit.present"> + <echo message="Warning: JUnit dependencies were not resolved."/> + </target> + <target name="checkDependencies" depends="prepare" unless="javac.notRequired"> <antcall target="checkSoapRMI"/> <antcall target="checkJMS"/> @@ -181,6 +187,10 @@ <include name="**/*.java"/> </patternset> + <patternset id="test.source.files"> + <include name="**/*.java"/> + </patternset> + <patternset id="j2c.source.files"> <include name="**/wsif/**/jca/**/*.java" /> <exclude name="**/wsif/**/jca/**/*.java" unless="j2c.present"/> @@ -290,6 +300,48 @@ </fileset> </copy> </target> + + <!-- =================================================================== --> + <!-- Compiles unit tests --> + <!-- =================================================================== --> + <target name="tests" depends="dynamic,samples,checkJUnit" if="junit.present"> + <mkdir dir="${build.tests}"/> + <javac srcdir="test" destdir="${build.tests}" + classpath="${dynamic.dest}:${build.samples}" debug="${debug}"> + <patternset refid="test.source.files"/> + <exclude name="shop/**.java" unless="ejb.present"/> + </javac> + + <copy todir="${build.samples}"> + <fileset dir="${samples.dir}"> + </fileset> + </copy> + </target> + + <path id="test-classpath"> + <pathelement location="${dynamic.dest}" /> + <pathelement path="${java.class.path}" /> + </path> + + <target name="junit" if="junit.present" depends="tests"> + <junit haltonfailure="yes" fork="yes"> + <classpath> + <path refid="test-classpath" /> + <pathelement location="${build.tests}" /> + <pathelement location="${build.samples}" /> + </classpath> + <formatter type="plain" usefile="false" /> + <test name="util.WSIFTestRunner" /> + + <!--batchtest> + <fileset dir="${build_tests}"> + <include name="**/PackageTest.class" /> + </fileset> + </batchtest--> + + </junit> + </target> + <!-- =================================================================== --> <!-- Creates the API documentation in separate directories --> 1.2 +4 -1 xml-axis-wsif/java/classpath.bat Index: classpath.bat =================================================================== RCS file: /home/cvs/xml-axis-wsif/java/classpath.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- classpath.bat 14 Oct 2002 16:55:42 -0000 1.1 +++ classpath.bat 25 Nov 2002 06:29:12 -0000 1.2 @@ -29,13 +29,16 @@ for %%i in (lib\jaxrpc\*.jar) do call lib\ant\lcp.bat %%i for %%i in (lib\saaj\*.jar) do call lib\ant\lcp.bat %%i +for %%i in (lib\soaprmi11\*.jar) do call lib\ant\lcp.bat %%i + +set LOCALCLASSPATH=build\classes;build\samples;build\tests;%LOCALCLASSPATH% + if "%1" == "build" goto build_classpath if "%1" == "run" goto run_classpath if "%1" == "clean" goto clean_classpath REM otherwise set user classpath -set LOCALCLASSPATH=build\classes;build\samples;build\tests;%LOCALCLASSPATH% set CLASSPATH=%LOCALCLASSPATH% if "%1" == "quiet" goto end 1.2 +8 -3 xml-axis-wsif/java/classpath.sh Index: classpath.sh =================================================================== RCS file: /home/cvs/xml-axis-wsif/java/classpath.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- classpath.sh 14 Oct 2002 16:55:42 -0000 1.1 +++ classpath.sh 25 Nov 2002 06:29:12 -0000 1.2 @@ -21,7 +21,6 @@ LOCALCLASSPATH=`echo lib/log4j/*.jar | tr ' ' ':'`:$LOCALCLASSPATH fi - #optional if [ ! "`echo lib/jms_api/*.jar`" = "lib/jms_api/*.jar" ] ; then LOCALCLASSPATH=`echo lib/jms_api/*.jar | tr ' ' ':'`:$LOCALCLASSPATH @@ -60,6 +59,13 @@ LOCALCLASSPATH=`echo lib/saaj/*.jar | tr ' ' ':'`:$LOCALCLASSPATH fi +#Soaprmi 1.1 +if [ ! "`echo lib/soaprmi11/*.jar`" = "lib/soaprmi11/*.jar" ] ; then + LOCALCLASSPATH=`echo lib/soaprmi11/*.jar | tr ' ' ':'`:$LOCALCLASSPATH +fi + +LOCALCLASSPATH=build/classes:build/samples:build/tests:$LOCALCLASSPATH + if [ "$1" = "build" ] ; then LOCALCLASSPATH=`echo lib/ant/*.jar | tr ' ' ':'`:$LOCALCLASSPATH LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$LOCALCLASSPATH @@ -71,8 +77,7 @@ elif [ ! "$2" = "quiet" ] ; then echo $LOCALCLASSPATH fi -else - LOCALCLASSPATH=build/api:build/samples:build/classes:build/tests:$LOCALCLASSPATH +else if [ "$1" = "run" ] ; then if [ "$2" = "set" ] ; then CLASSPATH=$LOCALCLASSPATH