Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » AGR: How to find out that ant build terminated
AGR: How to find out that ant build terminated [message #76308] Wed, 05 July 2006 07:44 Go to next message
Eclipse User
Originally posted by: ffr.softwareag.com

Hi,
I recorded a 'Run As' --> 'Ant Build' on a build.xml file with verification
hook (target is the Console view). My goal with the verification hook was to
recognize termination and success of the ant build (without doing anything
the test execution goes on after the build process is started without
waiting for the end of the build process). Unfortunately my implementation
of the verification hook blocks the ant build when the test suite comes to
the mentioned test case during execution and I don't know why. Could anybody
explain? Am I on the right way at all or are there better approaches to my
problem?
Here is the core code of my verification hook that is intended to recognize
the termination of the ant build. The max wait time of 20 seconds is always
exceeded and the assertion fails. After that, the so long blocked ant build
is going on.
long maxWaitForBuildTermination = 20000L;
long cumulatedWaitTime = 0L;
while (cumulatedWaitTime <= maxWaitForBuildTermination) {
if (consoleView.getTitle() != null &&
consoleView.getTitle().indexOf("<terminated>") > 0) {
break;
} else {
Thread.sleep(500L);
cumulatedWaitTime += 500L;
}
}
assertTrue(cumulatedWaitTime <= maxWaitForBuildTermination);
Re: How to find out that ant build terminated [message #76584 is a reply to message #76308] Thu, 06 July 2006 14:39 Go to previous message
No real name is currently offline No real name
Messages: 404
Registered: July 2009
Senior Member
You can insert wait statements inside your macro to ensure that a task is
completed before going to the next macro command.
Find the macro command that launches the Ant job. Insert the following
command after the process is launched:

<command type="wait" time-to-wait="10000"/>

The above statement does a 10 second wait before going to the next command.
You can adjust the time-to-wait attribute as you like.

Thanks.

"Frank Froehlich" <ffr@softwareag.com> wrote in message
news:e8g8mh$6lr$1@utils.eclipse.org...
> Hi,
> I recorded a 'Run As' --> 'Ant Build' on a build.xml file with
verification
> hook (target is the Console view). My goal with the verification hook was
to
> recognize termination and success of the ant build (without doing anything
> the test execution goes on after the build process is started without
> waiting for the end of the build process). Unfortunately my implementation
> of the verification hook blocks the ant build when the test suite comes to
> the mentioned test case during execution and I don't know why. Could
anybody
> explain? Am I on the right way at all or are there better approaches to my
> problem?
> Here is the core code of my verification hook that is intended to
recognize
> the termination of the ant build. The max wait time of 20 seconds is
always
> exceeded and the assertion fails. After that, the so long blocked ant
build
> is going on.
> long maxWaitForBuildTermination = 20000L;
> long cumulatedWaitTime = 0L;
> while (cumulatedWaitTime <= maxWaitForBuildTermination) {
> if (consoleView.getTitle() != null &&
> consoleView.getTitle().indexOf("<terminated>") > 0) {
> break;
> } else {
> Thread.sleep(500L);
> cumulatedWaitTime += 500L;
> }
> }
> assertTrue(cumulatedWaitTime <= maxWaitForBuildTermination);
>
>
Previous Topic:Running recorded test
Next Topic:Attaching to weblogic 8.1 using IAC
Goto Forum:
  


Current Time: Sat Aug 30 16:24:25 EDT 2014

Powered by FUDForum. Page generated in 0.01561 seconds