This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Condtional check for failure property. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Condtional check for failure property." Watch "Condtional check for failure property." New topic
Author

Condtional check for failure property.

Jaya Lalla
Greenhorn

Joined: May 22, 2012
Posts: 3
I am trying to do the following in my ant build file.
Run my junit tests based on if the junit.error property is set - I need to run another ant task.
I need to check for both pass an failure of the tests.



I have tried the following with in my target

it does not print the statement.

I get an error saying
C:\apps\workspace-next13.3\CompositePageService\build.xml:418: Problem: failed to create task or type if
Cause: The name is undefined.

I have tried.
<if name="junit.error" value="true">
<echo> there has been a failure </echo>
</if>
however if there is no failure the variable may not be set.
Can someone please help with the tags that should be set.

Thanks.,
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Welcome to CodeRanch! I edited your post to add code tags - this makes it easier to read.

Your code looks fine. It uses the if tag from the ant contrib library. Have you added a taskdef tag to your Ant build to include it?


[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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Condtional check for failure property.
 
Similar Threads
ant junitreport always going to wrong
Ant: while compiling it doen not recognize junit related things and shows errors
WSAD 5/Ant/JUNIT problem
WSAD5 Ant/JUNIT problem
conditional build failure in Ant