Thursday October 17, 2002
Ant and JUnit.
I reduced the build.xml file on my project drastically this morning (more than 900 lines). I used to have a task per testcase and was able to consolidate from this:
<!-- =================================================================== -->
<!-- Run the UserDAO test -->
<!-- =================================================================== -->
<target name="test.userDAO" depends="compile">
<echo message="Running UserDAO Test -------------------"/>
<junit printsummary="yes" haltonfailure="yes"
haltonerror="yes" fork="yes">
<jvmarg value="-Djunit.conf=./src/onpoint/PersistenceTestValues.ini"/>
<classpath>
<pathelement path="${webapp.target}/WEB-INF/classes"/>
</classpath>
<classpath refid="classpath"/>
<formatter type="plain" usefile="false"/>
<test name="com.onpoint.webapp.persistence.UserDAOTest"/>
</junit>
</target>
To this:
<!-- =================================================================== -->
<!-- Run all the Persistence tests -->
<!-- =================================================================== -->
<target name="test.persistence" depends="compile">
<echo message="Running Persistence Tests -------------------"/>
<junit printsummary="yes" haltonfailure="yes"
haltonerror="yes" fork="yes">
<jvmarg value="-Djunit.conf=./src/onpoint/PersistenceTestValues.ini"/>
<classpath>
<path refid="classpath"/>
<pathelement path="${webapp.target}/WEB-INF/classes"/>
</classpath>
<formatter type="plain" usefile="false"/>
<test name="com.onpoint.webapp.persistence.${testcase}" if="testcase"/>
<batchtest unless="testcase">
<fileset dir="${webapp.target}/WEB-INF/classes"
includes="**/persistence/*Test.class"/>
</batchtest>
</junit>
</target>
And I got to remove the AllTests.java file in the persistence package! You probably knew this already, but just in case...
Thanks to Erik Hatcher for Java Development with Ant. I studied this book for three hours yesterday and it's already increasing my productivity! I hope to finish it by tomorrow afternoon - only 300 pages to go. It's pretty cool when you're reading someone's book and getting e-mails from them at the same time. Posted in General at Oct 17 2002, 04:37:09 AM MDT Add a Comment
Search This Site
Recent Entries
- What's Next
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju