Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • error from multiple antcalls, how to fail after all antcalls run?

    6 answers - 1468 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I've done this in the past by making all of my tests create a resource
    if they fail, and after all the tests are completed, check if that
    resource exists. I am sure there are better ways to do this, though.
    Message
    From: glenn opdycke-hansen [mailto:glennoph (AT) gmail (DOT) com]
    Sent: Thursday, August 03, 2006 10:52 AM
    To: ant user
    Subject: error from multiple antcalls, how to fail after all antcalls
    run?
    I have a question about how to code a script to multiple tests are run
    and
    fail at the end of the script.
    I have a script that calls multiple targets via antcalls:
    <antcall target="check-resource-test">
    <param name="url" value="${url.bigip}"/>
    </antcall>
    <antcall target="check-resource-test">
    <param name="url" value="${url.5r}"/>
    </antcall>
    I want to execute all of the antcall targets.
    If any of the antcall targets get an error, then the script must fail.
    How can this be done?
    If each antcall target fails, then the script terminates.
    I was thinking of using a touch or concat to create a file that
    indicates an
    error occurred. The script can test if the file exists at the end and
    then
    fail if needed.
    suggestions?
    Thanks,
    Glenn
    To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
  • No.1 | | 1675 bytes | |

    How about instead of using antcall, have a target that has a depends on
    them all? So replace the ant-calls with a depends="xxx yyy xxx"

    Mathew Delong wrote:
    I've done this in the past by making all of my tests create a resource
    if they fail, and after all the tests are completed, check if that
    resource exists. I am sure there are better ways to do this, though.

    Message
    From: glenn opdycke-hansen [mailto:glennoph (AT) gmail (DOT) com]
    Sent: Thursday, August 03, 2006 10:52 AM
    To: ant user
    Subject: error from multiple antcalls, how to fail after all antcalls
    run?

    I have a question about how to code a script to multiple tests are run
    and
    fail at the end of the script.
    I have a script that calls multiple targets via antcalls:
    <antcall target="check-resource-test">
    <param name="url" value="${url.bigip}"/>
    </antcall>
    <antcall target="check-resource-test">
    <param name="url" value="${url.5r}"/>
    </antcall>

    I want to execute all of the antcall targets.
    If any of the antcall targets get an error, then the script must fail.

    How can this be done?
    If each antcall target fails, then the script terminates.

    I was thinking of using a touch or concat to create a file that
    indicates an
    error occurred. The script can test if the file exists at the end and
    then
    fail if needed.

    suggestions?

    Thanks,
    Glenn
    >
    >
    >


    To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
    --
  • No.2 | | 2311 bytes | |

    Sorry, maybe I am misunderstanding Do you want it to fail
    immediately or run to completion then fail if an error arose?

    Scot P. Floess wrote:
    How about instead of using antcall, have a target that has a depends
    on them all? So replace the ant-calls with a depends="xxx yyy xxx"

    Mathew Delong wrote:
    >I've done this in the past by making all of my tests create a resource
    >if they fail, and after all the tests are completed, check if that
    >resource exists. I am sure there are better ways to do this, though.
    >>

    >Message
    >From: glenn opdycke-hansen [mailto:glennoph (AT) gmail (DOT) com] Sent:
    >Thursday, August 03, 2006 10:52 AM
    >To: ant user
    >Subject: error from multiple antcalls, how to fail after all antcalls
    >run?
    >>

    >I have a question about how to code a script to multiple tests are run
    >and
    >fail at the end of the script.
    >I have a script that calls multiple targets via antcalls:
    ><antcall target="check-resource-test">
    ><param name="url" value="${url.bigip}"/>
    ></antcall>
    ><antcall target="check-resource-test">
    ><param name="url" value="${url.5r}"/>
    ></antcall>
    >>

    >I want to execute all of the antcall targets.
    >If any of the antcall targets get an error, then the script must fail.
    >>

    >How can this be done?
    >If each antcall target fails, then the script terminates.
    >>

    >I was thinking of using a touch or concat to create a file that
    >indicates an
    >error occurred. The script can test if the file exists at the end and
    >then
    >fail if needed.
    >>

    >suggestions?
    >>

    >Thanks,
    >Glenn
    >>
    >>
    >>

    >
    >To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    >For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
    >>
    >>

    >
    >
  • No.3 | | 2662 bytes | |

    the antcall is needed to test different urls. But I suspect it prevents the
    called target from updating a common property. I did use concat to create
    an errors.log file. If that file exists then the script fails. It tested
    ok, but is a bit awkward.

    8/3/06, Scot P. Floess <floess (AT) mindspring (DOT) comwrote:

    Sorry, maybe I am misunderstanding Do you want it to fail
    immediately or run to completion then fail if an error arose?

    Scot P. Floess wrote:
    How about instead of using antcall, have a target that has a depends
    on them all? So replace the ant-calls with a depends="xxx yyy xxx"

    Mathew Delong wrote:
    >I've done this in the past by making all of my tests create a resource
    >if they fail, and after all the tests are completed, check if that
    >resource exists. I am sure there are better ways to do this, though.
    >>

    >Message
    >From: glenn opdycke-hansen [mailto:glennoph (AT) gmail (DOT) com] Sent:
    >Thursday, August 03, 2006 10:52 AM
    >To: ant user
    >Subject: error from multiple antcalls, how to fail after all antcalls
    >run?
    >>

    >I have a question about how to code a script to multiple tests are run
    >and
    >fail at the end of the script.
    >I have a script that calls multiple targets via antcalls:
    ><antcall target="check-resource-test">
    ><param name="url" value="${url.bigip}"/>
    ></antcall>
    ><antcall target="check-resource-test">
    ><param name="url" value="${url.5r}"/>
    ></antcall>
    >>

    >I want to execute all of the antcall targets.
    >If any of the antcall targets get an error, then the script must fail.
    >>

    >How can this be done?
    >If each antcall target fails, then the script terminates.
    >>

    >I was thinking of using a touch or concat to create a file that
    >indicates an
    >error occurred. The script can test if the file exists at the end and
    >then
    >fail if needed.
    >>

    >suggestions?
    >>

    >Thanks,
    >Glenn
    >>
    >>
    >>

    >
    >To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    >For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
    >>
    >>
    >>

    >
    >
  • No.4 | | 352 bytes | |

    How do you create a resource?

    8/3/06, Mathew Delong <Mathew.Delong (AT) embarcadero (DOT) comwrote:

    I've done this in the past by making all of my tests create a resource
    if they fail, and after all the tests are completed, check if that
    resource exists. I am sure there are better ways to do this, though.
    --
  • No.5 | | 4130 bytes | |

    Why don't you macrodef the check-resource-test and perform a <fail
    internal to it?

    You could make the url and value as attributes for the macrodef

    Then you could do something like (assuming you name the macrodef
    check-resource-test):

    <check-resource-test url = "${url.bigip}"/>
    <check-resource-test url = "${url.5r}"/>

    glenn opdycke-hansen wrote:
    the antcall is needed to test different urls. But I suspect it
    prevents the
    called target from updating a common property. I did use concat to
    create
    an errors.log file. If that file exists then the script fails. It
    tested
    ok, but is a bit awkward.

    8/3/06, Scot P. Floess <floess (AT) mindspring (DOT) comwrote:
    >>

    >Sorry, maybe I am misunderstanding Do you want it to fail
    >immediately or run to completion then fail if an error arose?
    >>

    >Scot P. Floess wrote:
    >How about instead of using antcall, have a target that has a depends
    >on them all? So replace the ant-calls with a depends="xxx yyy xxx"
    >>

    >Mathew Delong wrote:
    >>I've done this in the past by making all of my tests create a

    >resource
    >>if they fail, and after all the tests are completed, check if that
    >>resource exists. I am sure there are better ways to do this, though.
    >>>

    >>Message
    >>From: glenn opdycke-hansen [mailto:glennoph (AT) gmail (DOT) com] Sent:
    >>Thursday, August 03, 2006 10:52 AM
    >>To: ant user
    >>Subject: error from multiple antcalls, how to fail after all antcalls
    >>run?
    >>>

    >>I have a question about how to code a script to multiple tests are

    >run
    >>and
    >>fail at the end of the script.
    >>I have a script that calls multiple targets via antcalls:
    >><antcall target="check-resource-test">
    >><param name="url" value="${url.bigip}"/>
    >></antcall>
    >><antcall target="check-resource-test">
    >><param name="url" value="${url.5r}"/>
    >></antcall>
    >>>

    >>I want to execute all of the antcall targets.
    >>If any of the antcall targets get an error, then the script must

    >fail.
    >>>

    >>How can this be done?
    >>If each antcall target fails, then the script terminates.
    >>>

    >>I was thinking of using a touch or concat to create a file that
    >>indicates an
    >>error occurred. The script can test if the file exists at the end

    >and
    >>then
    >>fail if needed.
    >>>

    >>suggestions?
    >>>

    >>Thanks,
    >>Glenn
    >>>
    >>>
    >>>

    >>
    >>To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    >>For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
    >>>
    >>>
    >>>

    >>
    >>

    >--
    >Scot P. Floess
    >27 Lake Royale
    >Louisburg, NC 27549
    >>

    >252-478-8087 (Home)
    >919-754-4592 (Work)
    >>

    >Chief Architect JPlate
    >Chief Architect JavaPIM
    >>
    >>

    >
    >To unsubscribe, e-mail: user-unsubscribe (AT) ant (DOT) apache.org
    >For additional commands, e-mail: user-help (AT) ant (DOT) apache.org
    >>
    >>

    >
  • No.6 | | 144 bytes | |

    It appears that a combination of <parallel failonany="false"and <fail>
    should/could/might work.
    Has anyone tried that?

Re: error from multiple antcalls, how to fail after all antcalls run?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 2 =
QUESTION ON "Java"

EMSDN.COM