Regardless NPE are always bad.
------------------------------------------------------------------------
Here is the xbuild.xml file I import. <?xml version="1.0"?> <project default="test" name="junit.antlib">
<!-- Where to put html docs generate by this antlib. -->
<property name="junit.antlib.docs.dir" value="${project.build.dir}/docs/junit"/>
<property name="junit.antlib.build.dir.passdown" value="${junit.antlib.build.dir}"/>
<!-- Classpath for my jars -->
<path id="junit.classpath">
<fileset dir="${junit.antlib.dir}/lib/">
<include name="*.jar"/>
<include name="endorsed/*.jar"/>
</fileset>
</path>
<optionalclassloader name="junit.antlib.loader" parentFirst="true" classpathRef="junit.classpath">
</optionalclassloader>
<taskdef file="${junit.antlib.dir}/tasks.properties"
loaderRef="junit.antlib.loader" />
<if> <!-- set project.test.dir if test/junit is set in module.xml-->
<not><equals arg1="${viprom:/module/[EMAIL PROTECTED]/[EMAIL PROTECTED]'test/junit']/@dir}"
arg2="$${viprom:/module/[EMAIL PROTECTED]/[EMAIL PROTECTED]'test/junit']/@dir}" />
</not> <then>
<property name="project.test.dir"
value="${viprom:/module/[EMAIL PROTECTED]/[EMAIL PROTECTED]'test/junit']/@dir}"/>
</then> </if> <description> Perform the unit tests using JUnit, and generates reports. </description>
<!-- =================================================================== -->
<target name="failsafe-test" description="Perform jUnit tests without failing; important to make it possible to generate a report on the failings">
<property name="junit.test.haltonfailure" value="no"/>
<antcall target="test"/>
</target>
<target name="compile-junit"
if="project.test.dir">
<!-- Compile tests -->
<mkdir dir="${junit.antlib.build.dir}/classes"/>
<copy todir="${junit.antlib.build.dir}/classes">
<fileset dir="${project.test.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<javac srcdir="${project.test.dir}"
destdir="${junit.antlib.build.dir}/classes"
debug= "${build.compiler.debug}"
optimize= "${build.compiler.optimize}"
deprecation="${build.compiler.deprecation}"
target= "${build.compiler.vm}"
source= "${build.compiler.source}"
nowarn= "false">
<classpath>
<pathelement location="${project.build.dir}/classes/" />
<path refid="${project.name}.classpath"/>
<path refid="junit.classpath"/>
</classpath>
</javac>
</target><!-- Initialize for testing. -->
<target name="test-init"
if="project.test.dir">
<property name="junit.test.haltonfailure" value="yes"/>
<echo message="Testing..."/>
<mkdir dir="${junit.antlib.build.dir}/results"/>
</target>
<!-- Perform jUnit tests. Add the junit.antlib.extra.sysproperty elements in
properties.xml to add sys properties. -->
<target name="test"
description="Perform jUnit tests. Add the junit.antlib.extra.sysproperty
elements in properties.xml to add sys properties."
depends="compile, compile-junit, test-init"
if="project.test.dir">
<property name="testcase" value=""/>
<!-- create property file to be used by junit antlib -->
<xslt in="properties.xml" out="${junit.antlib.work.dir}/test.xml"
style="${junit.antlib.dir}/resources/stylesheets/test.xsl"
force="true">
<param name="testcase" expression="${testcase}"/>
<param name="projectName" expression="${project.name}"/>
</xslt>
<ant antfile="${junit.antlib.work.dir}/test.xml" inheritRefs="true"/>
</target>
<!-- =================================================================== -->
<!-- Test reports -->
<!-- =================================================================== -->
<target name="report" description="Perform jUnit test reports"
if="project.test.dir">
<mkdir dir="${junit.antlib.docs.dir}"/>
<mkdir dir="${junit.antlib.work.dir}"/>
<junitreport todir="${junit.antlib.work.dir}">
<fileset dir="${junit.antlib.build.dir}/results">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.antlib.docs.dir}"/>
</junitreport>
</target></project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
