Did anyone use Ant's junit task?

Did anyone use Ant's junit task?

Post by krish.. » Thu, 07 Dec 2000 04:00:00



Did anyone use Ant build tool's built in Junit task?

I'm running some JUnit tests (Junit 3.2) on a java application and I would
like to log the Junit test results to a file. I came to know that Jakarta's
ant has buit in "junit tasks" using which I can print the results to a file.
I tried to use the junit task in my build.xml file but I'm getting an error
"Ant couldn't find junit in it's task definitions".  I'm using Ant1.2 -binary
editon.

Any help/sugestions please?
Thank you,
-kris

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Did anyone use Ant's junit task?

Post by Stefan Bodewi » Fri, 08 Dec 2000 04:00:00



> Did anyone use Ant build tool's built in Junit task?

Yes.

Quote:> I tried to use the junit task in my build.xml file but I'm getting
> an error "Ant couldn't find junit in it's task definitions".  I'm
> using Ant1.2 -binary editon.

<junit> is an optional task and as such doesn't ship with the binary
distribution. Pick up
<http://jakarta.apache.org/builds/ant/release/v1.2/bin/optional.jar>
and put it into ANT_HOME/lib and Ant should be happy.

Cheers

        Stefan

 
 
 

Did anyone use Ant's junit task?

Post by krish.. » Fri, 08 Dec 2000 04:00:00


Thank you so much Stefan. It is a great help.
I copied optional.jar to ant\lib directory and it's working now.

regards,
Kris

Quote:> <junit> is an optional task and as such doesn't ship with the binary
> distribution. Pick up
> <http://jakarta.apache.org/builds/ant/release/v1.2/bin/optional.jar>
> and put it into ANT_HOME/lib and Ant should be happy.

> Cheers

>         Stefan

Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

1. Did anyone use 'batchtest' of ant's junit task?

Hi,
Did anyone use 'batchtest' of ant's junit task?

I'm using junit batchtest to run all the files **Test*.java using pattern
matching. Ant is running junit on these files and logging the test results to
files named TEST-name.txt for each matching file in the directory.

Suppose if there are 3 matching files SinpleTest.java, VectorTest.java, and
MoneyTest.java, the results are collected in 3 files TEST-SimpleTest.txt,
TEST-VectorTest.txt, and TEST-MonetTest.txt.

Is there a way to collect the results of all the tests in a single
"results.txt" file instead of ant creating one results file for each matching
file?

Ant is not allowing me to put the attribute "outfile=results.txt" either in
the 'fileset' or in the 'batchtest' tags.

Please help!  Thank You so much!

regards,
Kris

My build file is given below:

<?xml version="1.0"?> <project name = "Ant_Test" default="test" basedir=".">
<property name="classpath"
value=".;C:\jdk1.3\jre\lib\rt.jar;C:\jdk1.3\jre\lib\jaws.jar;C:\jdk1.3\jre\li
b\i18n.jar;C:\jdk1.3\lib\tools.jar;C:\junit3.2\j
unit.jar;C:\JavaWork\.;C:\jBoss\examples\interest\.;C:\junit3.2\.;C:\ant\lib\
ant.jar;C:\ant\lib\jaxp.jar;C:\ant\lib\pars
er.jar;C:\ant\lib\optional.jar;C:\ant\.;" />

<property name="srcdir" value="ant" />

<target name="test">
<junit printsummary="yes" haltonfailure="no">

<classpath>     <pathelement location="${srcdir}" />
                <pathelement path="${classpath}" />
</classpath>

<formatter type="plain" /> <!-- <test name="junit.samples.SimpleTest"
haltonfailure="no" outfile="Test_results"> </test> -->

<batchtest fork="yes">
        <fileset dir="${srcdir}" excludes="**\src\**">
                <include name="**/*Test*.java" />
                <exclude name="**/AllTests.java" />

        </fileset>

</batchtest>

</junit>

Sent via Deja.com
http://www.deja.com/

2. Sequence points + how to fix volatile

3. Can't get build to fail with junit, ant, and cruisecontrol

4. Some highlights are not visible with this form

5. JUnit 3.7 and Ant 1.4 Property definitions - don't work

6. How dial past voice mail beep

7. Test cases organization (JUnit, Ant...)

8. 3rd party utilities for Acrobat?

9. JUnit + Ant + lazy developers

10. Test cases organization (JUnit, Ant...)

11. Anyone using Junit under cygwin?

12. Task switch notification for DOS programs under '95?

13. Disable 'close' button for NTVDM dos box running DOS app