aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

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
 
jQuery in Action, 2nd edition
 
subject: Condtional check for failure property.