• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Condtional check for failure property.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.,
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic