You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Emmanuel Sciara <an...@yahoo.com> on 2002/04/05 18:05:06 UTC

can telnet task make build fail in specified conditions

Hi all,

I am using the telnet task to start and stop my remote weblogic server. I
would like to make my build fail if the server does not start up.

Looking at the doc, the telnet task does not have any feature to do that.
Right? If yes is there a work around? or do I need to write my own telnet
task?

E


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: can telnet task make build fail in specified conditions

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "stephan beal" <st...@wanderinghorse.net>
To: "Ant Users List" <an...@jakarta.apache.org>; "Emmanuel Sciara"
<an...@yahoo.com>
Sent: Friday, April 05, 2002 8:55 AM
Subject: Re: can telnet task make build fail in specified conditions


> On Friday 05 April 2002 18:05 pm, Emmanuel Sciara wrote:
> > Hi all,
> >
> > I am using the telnet task to start and stop my remote weblogic server.
I
> > would like to make my build fail if the server does not start up.
> >
> > Looking at the doc, the telnet task does not have any feature to do
that.
>
> It's not a limit of the task, but of telnet - it only passes text back and
> forth, not program return values.
>
> > Right? If yes is there a work around? or do I need to write my own
telnet
> > task?
>
> if i may venture a guess, you could edit/subclass the telnet class and
fudge
> the way it handles <read>, and check that text for some specific failure
> text, then throw a build exception if you find it. Not pretty, but it
could
> very be done generically with some additions to <telnet>:


you dont need to alter telnet

1. you can have it wait (with a timeout) to read some success message; the
build fails on timeout when the text you want aint read, everything
propagates.

2. you can use <waitfor> to spin waiting for a remote URL to be visible;
that is the best test for your app server running...




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: can telnet task make build fail in specified conditions

Posted by stephan beal <st...@wanderinghorse.net>.
On Friday 05 April 2002 18:05 pm, Emmanuel Sciara wrote:
> Hi all,
>
> I am using the telnet task to start and stop my remote weblogic server. I
> would like to make my build fail if the server does not start up.
>
> Looking at the doc, the telnet task does not have any feature to do that.

It's not a limit of the task, but of telnet - it only passes text back and 
forth, not program return values.

> Right? If yes is there a work around? or do I need to write my own telnet
> task?

if i may venture a guess, you could edit/subclass the telnet class and fudge 
the way it handles <read>, and check that text for some specific failure 
text, then throw a build exception if you find it. Not pretty, but it could 
very be done generically with some additions to <telnet>:


<telnet failonread="error starting Weblogic!">
...
</telnet>

Then have telnet (or <read>) look for that text on new input.
Even better would probably be:

<telnet...>
...
  <read failonread="error starting Weblogic!">....</read>
</telnet>



----- stephan
Generic Unix Computer Guy
stephan@einsurance.de - http://www.einsurance.de
Office: +49 (89)  552 92 862 Handy:  +49 (179) 211 97 67
"Wenn ich weniger Bock haette, wuerde ich nicht Atmen."

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>