From: Bob W. <Rob...@un...> - 2005-10-04 23:14:09
|
User: walkerrl49 Date: 05/10/04 19:13:59 Modified: jboss-admin-console build.xml Log: Added target to run just one test class: build test-one -Dtest=foo.bar.MyClassTest Revision Changes Path 1.28 +186 -197 jboss-admin-console/build.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: build.xml =================================================================== RCS file: /cvsroot/jboss/jboss-admin-console/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -b -r1.27 -r1.28 --- build.xml 9 Sep 2005 18:28:04 -0000 1.27 +++ build.xml 4 Oct 2005 23:13:59 -0000 1.28 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE project [ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent"> - <!ENTITY modules SYSTEM "../tools/etc/buildmagic/modules.ent"> +<!ENTITY modules SYSTEM "../tools/etc/buildmagic/modules.ent"> ]> <!-- @@ -15,33 +15,28 @@ <!-- Temporary build file until jbossbuild.xml becomes the main build --> <!-- ================================================================== --> -<project name="project.temp" - default="war" - basedir="." -> - <property name="project.thirdparty" value="../thirdparty"/> - <property name="project.root" value=".."/> - <property file="${basedir}/build.properties"/> +<project name="project.temp" default="war" basedir="."> + <property name="project.thirdparty" value="../thirdparty" /> + <property name="project.root" value=".." /> + <property file="${basedir}/build.properties" /> <!-- ========= --> <!-- Libraries --> <!-- ========= --> &libraries; - - <!-- The combined library classpath --> <path id="library.classpath"> <!-- NEW LIBRARY: Add path references to additional libraries here, check in libraries.ent. Should only really need to added entries here for things that are need at compile/junit time --> - <path refid="apache.struts.classpath"/> - <path refid="sun.servlet.classpath"/> - <path refid="apache.commons.classpath"/> - <path refid="dom4j.dom4j.classpath"/> - <path refid="jboss.messaging.classpath"/> - <path refid="hibernate3.classpath"/> - <path refid="apache.beanutils.classpath"/> - <path refid="apache.validator.classpath"/> + <path refid="apache.struts.classpath" /> + <path refid="sun.servlet.classpath" /> + <path refid="apache.commons.classpath" /> + <path refid="dom4j.dom4j.classpath" /> + <path refid="jboss.messaging.classpath" /> + <path refid="hibernate3.classpath" /> + <path refid="apache.beanutils.classpath" /> + <path refid="apache.validator.classpath" /> </path> <!-- ======= --> @@ -52,130 +47,125 @@ <!-- Specify modules upon which this build depends --> <!-- NEW MODULE: Add path references to additional jboss modules here, check in modules.ent --> <path id="dependentmodule.classpath"> - <path refid="jboss.j2ee.classpath"/> - <path refid="jboss.j2se.classpath"/> - <path refid="jboss.varia.classpath"/> - <path refid="jboss.system.classpath"/> + <path refid="jboss.j2ee.classpath" /> + <path refid="jboss.j2se.classpath" /> + <path refid="jboss.varia.classpath" /> + <path refid="jboss.system.classpath" /> </path> <!-- The combined thirdparty classpath --> <path id="thirdparty.classpath"> - <path refid="library.classpath"/> - <path refid="dependentmodule.classpath"/> + <path refid="library.classpath" /> + <path refid="dependentmodule.classpath" /> </path> + <target name="compile"> - <mkdir dir="output/ant/classes"/> + <mkdir dir="output/ant/classes" /> <depend destdir="output/ant/classes" srcdir="src/main"> <classpath> - <path refid="thirdparty.classpath"/> + <path refid="thirdparty.classpath" /> </classpath> </depend> - <javac - destdir="output/ant/classes" - srcdir="src/main" - debug="true" - > + <javac destdir="output/ant/classes" srcdir="src/main" debug="true"> <classpath> - <path refid="thirdparty.classpath"/> + <path refid="thirdparty.classpath" /> </classpath> </javac> </target> - <target name="compile-test" depends="compile,copy-test-jars"> - <mkdir dir="output/ant/test-classes"/> - <javac - destdir="output/ant/test-classes" - srcdir="src/test" - debug="true" - > - <classpath> - <!-- include test compile&runtime jars --> - <fileset dir="output/ant/lib/test-jars/"> - <include name="**/*.jar"/> + <!-- The testing classpath --> + <path id="test.classpath"> + <pathelement location="output/ant/test-classes" /> + <pathelement location="output/ant/classes" /> + <!-- include both regular runtime jars and test compile&runtime jars --> + <fileset dir="output/ant/lib/"> + <include name="**/*.jar" /> </fileset> - <pathelement location="output/ant/test-classes"/> - <pathelement location="output/ant/classes"/> <!-- include regular compile time dependencies --> - <path refid="thirdparty.classpath"/> - </classpath> + <path refid="thirdparty.classpath" /> + </path> + + <path id="test.run.classpath"> + <path refid="test.classpath"/> + <!-- used to find web.xml for Struts tests --> + <pathelement location="src/resources/admin-console.war" /> + </path> + + <target name="compile-test" depends="compile,copy-test-jars"> + <mkdir dir="output/ant/test-classes" /> + <javac destdir="output/ant/test-classes" srcdir="src/test" debug="true"> + <classpath refid="test.classpath"/> </javac> </target> - <target name="test" depends="compile-test,copy-WEB-INF-jars"> - <mkdir dir="output/ant/test-reports"/> + <target name="test-one" depends="compile-test,copy-WEB-INF-jars"> + <fail unless="test" message="Please specify the class to be tested (e.g., build test-one -Dtest=org.foo.bar.MyTest)."/> + <mkdir dir="output/ant/test-reports" /> <junit printsummary="yes" haltonfailure="yes"> - <classpath> - <pathelement location="output/ant/test-classes"/> - <!-- include both regular runtime jars and test compile&runtime jars --> - <fileset dir="output/ant/lib/"> - <include name="**/*.jar"/> - </fileset> - <pathelement location="output/ant/classes"/> - <!-- used to find web.xml for Struts tests --> - <pathelement location="src/resources/admin-console.war"/> - <!-- include regular compile time dependencies --> - <path refid="thirdparty.classpath"/> - </classpath> - - <formatter type="plain"/> + <classpath refid="test.run.classpath" /> + <formatter type="plain" /> + <test if="test" name="${test}" fork="yes" outfile="TEST-ONE-${test}" todir="output/ant/test-reports" /> + </junit> + </target> - <test if="testcase" name="org.jboss.admin.${testcase}" fork="yes" - outfile="TESTCASE-org.jboss.admin.${testcase}" todir="output/ant/test-reports"/> - <batchtest unless="testcase" fork="yes" todir="output/ant/test-reports"> + <target name="test" depends="compile-test,copy-WEB-INF-jars"> + <mkdir dir="output/ant/test-reports" /> + <junit printsummary="yes" haltonfailure="yes"> + <classpath refid="test.run.classpath" /> + <formatter type="plain" /> + <batchtest fork="yes" todir="output/ant/test-reports"> <fileset dir="output/ant/test-classes"> - <include name="**/*Test.class"/> + <include name="**/*Test.class" /> </fileset> </batchtest> </junit> </target> - <!-- TODO: remove this when doing builds declaratively with jbossbuild.xml --> <target name="copy-WEB-INF-jars"> - <mkdir dir="output/ant/lib/WEB-INF-jars/"/> + <mkdir dir="output/ant/lib/WEB-INF-jars/" /> <copy todir="output/ant/lib/WEB-INF-jars/" flatten="true"> <!-- NEW LIBRARY: Add path to jars to be included in WEB-INF/lib here. This will include all runtime dependencies --> <fileset dir="${apache.struts.lib}"> - <include name="struts*.jar"/> + <include name="struts*.jar" /> </fileset> <fileset dir="${antlr.antlr.lib}"> - <include name="antlr-2.7.5H3.jar"/> + <include name="antlr-2.7.5H3.jar" /> </fileset> <fileset dir="${apache.taglibs.lib}"> - <include name="jstl*.jar"/> - <include name="standard*.jar"/> + <include name="jstl*.jar" /> + <include name="standard*.jar" /> </fileset> <fileset dir="${apache.oro.lib}"> - <include name="jakarta-oro*.jar"/> + <include name="jakarta-oro*.jar" /> </fileset> <fileset dir="${apache.validator.lib}"> - <include name="commons-validator*.jar"/> + <include name="commons-validator*.jar" /> </fileset> <fileset dir="${apache.digester.lib}"> - <include name="commons-digester-1.6.jar"/> + <include name="commons-digester-1.6.jar" /> </fileset> <fileset dir="${apache.logging.lib}"> - <include name="commons-logging.jar"/> + <include name="commons-logging.jar" /> </fileset> <fileset dir="${apache.beanutils.lib}"> - <include name="commons-beanutils*.jar"/> + <include name="commons-beanutils*.jar" /> </fileset> <fileset dir="${apache.fileupload.lib}"> - <include name="commons-fileupload*.jar"/> + <include name="commons-fileupload*.jar" /> </fileset> <fileset dir="${apache.lang.lib}"> - <include name="commons-lang-2.0.jar"/> + <include name="commons-lang-2.0.jar" /> </fileset> <fileset dir="${dom4j.dom4j.lib}"> - <include name="dom4j*.jar"/> + <include name="dom4j*.jar" /> </fileset> - <fileset dir="${basedir}/tmp_libs" - includes="displaytag-1.0-rc1.jar, + <fileset dir="${basedir}/tmp_libs" includes="displaytag-1.0-rc1.jar, wsabi4j2ee.jar, wsabi4j2ee-jboss.jar" /> @@ -184,55 +174,54 @@ <!-- TODO: remove this when doing builds declaratively with jbossbuild.xml --> <target name="copy-test-jars"> - <mkdir dir="output/ant/lib/test-jars/"/> + <mkdir dir="output/ant/lib/test-jars/" /> <copy todir="output/ant/lib/test-jars/" flatten="true"> <!-- NEW LIBRARY: Add path to jars which are required for running tests here. This will include all compile time and run time test specific dependencies --> <fileset dir="${apache.log4j.lib}"> - <include name="log4j*.jar"/> + <include name="log4j*.jar" /> </fileset> <fileset dir="${junit.junit.lib}"> - <include name="junit*.jar"/> + <include name="junit*.jar" /> </fileset> <fileset dir="${easymock.easymock.lib}"> - <include name="easymock*.jar"/> + <include name="easymock*.jar" /> </fileset> <fileset dir="${struts.test.case.lib}"> - <include name="strutstest*.jar"/> + <include name="strutstest*.jar" /> </fileset> <fileset dir="${cglib.lib}"> - <include name="cglib*.jar"/> + <include name="cglib*.jar" /> </fileset> <fileset dir="${asm.asm.lib}"> - <include name="asm.jar"/> + <include name="asm.jar" /> </fileset> <fileset dir="${apache.collections.lib}"> - <include name="commons-collections.jar"/> + <include name="commons-collections.jar" /> </fileset> <fileset dir="${jboss.common.lib}"> - <include name="jboss-common.jar"/> + <include name="jboss-common.jar" /> </fileset> </copy> </target> <!-- TODO: implement this declaratively in jbossbuild.xml --> <target name="war" depends="copy-test-jars,compile,copy-WEB-INF-jars"> - <mkdir dir="output/ant/lib"/> - <war destfile="output/ant/lib/admin-console.war" - webxml="src/resources/admin-console.war/WEB-INF/web.xml"> - <classes dir="output/ant/classes" includes="**"/> + <mkdir dir="output/ant/lib" /> + <war destfile="output/ant/lib/admin-console.war" webxml="src/resources/admin-console.war/WEB-INF/web.xml"> + <classes dir="output/ant/classes" includes="**" /> <fileset dir="src/resources/admin-console.war" includes="**" excludes="**/web.xml" /> - <lib dir="output/ant/lib/WEB-INF-jars/"/> + <lib dir="output/ant/lib/WEB-INF-jars/" /> </war> </target> <target name="deploy" depends="war"> - <copy todir="${jboss.home}/server/default/deploy" file="output/ant/lib/admin-console.war"/> + <copy todir="${jboss.home}/server/default/deploy" file="output/ant/lib/admin-console.war" /> </target> <target name="clean"> - <delete dir="output/ant"/> + <delete dir="output/ant" /> </target> </project> |