ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knuplesch, Juergen" <Juergen.Knuple...@icongmbh.de>
Subject AW: Defining ant target to run junit tests using dbunit
Date Tue, 20 May 2008 15:29:12 GMT
If I read this http://www.dbunit.org/anttask.html right, than you have to use operation, export
or compare.

I use JUNIT but not dbunit. I guess somewhere you have to tell the task, what test you are
running.



-- 
J├╝rgen 

Von: tmni [mailto:teresni@ucia.gov] 
Gesendet: Dienstag, 20. Mai 2008 17:15
An: user@ant.apache.org
Betreff: Defining ant target to run junit tests using dbunit


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"
   url="jdbc:oracle:thin:@server:port:dbname"
   userid="me"
   password="password">
</dbunit>

--
View this message in context: http://www.nabble.com/Defining-ant-target-to-run-junit-tests-using-dbunit-tp17342896p17342896.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message