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
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial