[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-discuss] ANT and JUNIT issues

From: Raif S. Naffah
Subject: Re: [Classpathx-discuss] ANT and JUNIT issues
Date: Mon, 03 Dec 2001 21:35:29 +1100

At 09:37 AM 12/3/01 +0000, Nic Ferrier wrote:
I think we need some debate about this, in order to do that I'd like one,
fairly established, project to develop some Junit tests and we can have a
look at how it works.

not implying that gnu.crypto is an established project, but have a look in the test folder under source.

the relevant target in the build.xml is:

   <target name="test" depends="jar,jar-test"
description="Run built-in tests to ensure correctness of .jar file">
      <java classname="test.AllTests"
            fork="yes" taskname="junit" failonerror="true">
            <pathelement location="${test.jar}"/>
            <pathelement location="${main.jar}"/>
            <pathelement location="${junit.jar}"/>

which says:

1. to resolve the target "test", first resolve, in order, "jar" and then "jar-test"; 2. resolving "test" effectively means: invoke the java interpreter, in a process of its own, with "test.AllTests" as the main class to execute; ie. invoke its main() method, using 3 jars as the classpath. if the execution fails, stop the build.

the target "jar" compiles and packs the binary deliverable, while "jar-test" does the same for the test classes only; ie. everything under the "test/" hierarchy.

${foo} is a reference to a property that will resolve to a value assigned earlier in the build process. ${main.jar} and ${test.jar} are (for me) standard names used to refer to the jars of the main and test binaries of every project. ${junit.jar} would resolve to the local copy of junit.jar which usually (again for me) goes into a lib/ folder.

apologies if some of the stuff is obvious + cheers;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]