ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tmni <>
Subject Defining ant target to run junit tests using dbunit
Date Tue, 20 May 2008 15:14:41 GMT

I am relatively new to ant and am having trouble setting up a target to run a
series of junit tests.
These tests all run fine when I launch them via eclipse.  But if I try to
run ant directly via command prompt, I get errors.  First, I was getting
error like:
Error 'Unexpected failure during bean definition parsing in resource URL
[file:spring-misc-junit.xml] at:
Bean 'mailSender'; nested exception is java.lang.SecurityException: class
“javax.mail.AuthenticationFailedException”’s signer information does not
match signer information of other classes in the same package.

I thought it might have something to do with authenticating to database, so
tried adding the following
dbunit info.  I got an error that there must be at least 1 step in a dbunit
task. I tried adding a task to do
an insert, but don't know why this would be necessary since the test
themselves set up the test data, accessing a test data xml file.  Even with
that change, I get error that oracle driver cannot be loaded.

The tests use dbunit and the underlying database is Oracle (accessed via
Hibernate in application).
I can't figure out how to define the test target and I cannot find a sample
that does this.  Does
anyone have a sample ant build file that runs junit tests that use
dbunit/hibernate/oracle combination??

<target name="test2" depends="init,compile">
  <taskdef classpathref="project.class.path" name="dbunit"
    classname="org.dbunit.ant.DbUnitTask" />
  <dbunit driver="oracle.jdbc.OracleDriver"

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message