You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Johannes van der Merwe <jp...@iafrica.com> on 2001/12/24 08:09:16 UTC

TelnetTask.java

I have added regular expression capabilities to TelnetTask.java so that one
can build more sophisticated sequences-I also made some new attributes:
flags defaults to RE.MULTILINE, and verbose to false. One can specify either
a string or regex. I have changed the while loops a bit in the
waitForRegex() function(please check whether this kind of logic make more
sense), and made it return a string - this helps a lot with debugging
sequences. The default flags is 8, meaning multiline recognition.

Kind regards
Jo van der Merwe

Re: TelnetTask.java

Posted by Steve Loughran <st...@iseran.com>.
Johannes, adding regexp support would indeed make telnet more robust.

why dont you submit it to ant-dev, having a look at the ant task guidelines
first about a) how to submit changes to a task, b) what is expected in
documentation and changes, c) why tabs are not allowed in the source.

Looking at the code, I think it'd be critical to copy the regexp mapper and
use the regexp library support found in org.apache.tools.ant.util.regexp,
particularly:
org.apache.tools.ant.util.regexp.RegexpMatcher;
org.apache.tools.ant.util.regexp.RegexpMatcherFactory;

This regexp package provides a layer of indirection and will pick up on any
of the supported regexp implementations found on the classpath, rather than
have support for a single one hard coded into a task.

If you can add that, and still ensure that telnet runs without any regexp
package being present (dont want to break someone elses build), then you
would probably stand a good chance of getting it into the build.



----- Original Message -----
From: "Johannes van der Merwe" <jp...@iafrica.com>
To: <an...@jakarta.apache.org>
Sent: Sunday, December 23, 2001 23:09
Subject: TelnetTask.java


> I have added regular expression capabilities to TelnetTask.java so that
one
> can build more sophisticated sequences-I also made some new attributes:
> flags defaults to RE.MULTILINE, and verbose to false. One can specify
either
> a string or regex. I have changed the while loops a bit in the
> waitForRegex() function(please check whether this kind of logic make more
> sense), and made it return a string - this helps a lot with debugging
> sequences. The default flags is 8, meaning multiline recognition.
>
> Kind regards
> Jo van der Merwe
>


----------------------------------------------------------------------------
----


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


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