Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Condtional check for failure property.

 
Jaya Lalla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic