using ANT for regular nightly invocation of JUnit

S

simonspoerri

i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?

thx for help i.a.!
 
M

MSeries

simonspoerri said:
i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?

thx for help i.a.!

IMHO it will be easier to get the OS to invoke the ant periodically. On *nix
see cron, on Windows see Tasl Scheduler.
 
R

Richard Donovan

simonspoerri said:
i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?

thx for help i.a.!

Yes, Ant has a <junit> optional tag specfically for this purpose.

http://ant.apache.org/manual/index.html

the ant task might look something like this :

<target name="test" depends="">
<mkdir dir="${build.dir}/reports"/>
<!-- make the report output directory if required -->
<!-- Run Junit -->
<junit printsummary="withOutAndErr" fork="yes">
<!-- jars required for running the unit tests -->
<formatter type="xml"/>
<classpath>
<pathelement path="C:/JBuilder8/thirdparty/junit3.8/junit.jar"/>
<pathelement path="C:/JBuilder8/thirdparty/junit3.8/src.jar"/>
<pathelement path="${build.dir}/classes"/>
<path refid="unit.lib"/>
</classpath>
<!-- run the following tests -->
<test name="anttest.Testtoken" filtertrace="no"
todir="${build.dir}/reports"/>
<!-- <test name="anttest.testWeb" filtertrace="no"
todir="${build.dir}/reports" /> -->
</junit>
 
C

Christopher Dean

simonspoerri said:
i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?

thx for help i.a.!

You may want to checkout Anthill (www.urbancode.com/projects/anthill/).
I use the free one to check out the build from CVS, build everything
including all the JUnit tests, and then email me the output, once every
night.
 
L

lasitha

(e-mail address removed) (simonspoerri) wrote in message
i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?

thx for help i.a.!

A quick look at the 'Continous Integration' chapter of "Java
Development with Ant" [1] reveals the following options (as
alternatives to scripting the OS):

1. CruiseControl http://cruisecontrol.sourceforge.net/
2. Anthill http://www.urbancode.com/projects/anthill/default.jsp
3. Gump http://jakarta.apache.org/gump/

(The book contains a comparison of these three).

These may be more 'solution' than your problem states (merely
scheduling ant invokations), but i'm guessing you're headed down the
continuous integration road (which is of course a great road to be
on).

cheers.
lasitha

[1] Erik Hatcher and Steve Loughran, Manning, April 2003
www.manning.com/antbook
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top