It's not a secret anymore!*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant junit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant junit" Watch "ant junit" New topic
Author

ant junit

vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
Hi. Does anyone know how I can debug the java code when executing junit tests from an ant script? I am using eclipse - right click on build file --> debug as --> ant build
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why would you want to? Just debug the test that's failing.
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
I have packaged all of my unit tests in a jar and all of the test classes are reading files. The code for reading files in a jar is different from the code for reading files not in a jar
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure how that's related to your question, but ok.
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
debugging the unit test in isolation (i.e. without ant script) will require me to make changes to the code to read files ...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

vik ar wrote:debugging the unit test in isolation (i.e. without ant script) will require me to make changes to the code to read files ...

Why? Can't you write a class that calls the code in the jar?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Don't get me started about those stupid light bulbs.
 
subject: ant junit
 
Similar Threads
can't generate JUnit report
ANT and JUnit fork problem
Taking Report for junit
Not able run junit test cases from ANT
integrate jUnit with the Ant