Issues with Grinder and Regular Expressions

View: New views
3 Messages — Rating Filter:   Alert me  

Issues with Grinder and Regular Expressions

by Ron Brennan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am having an issue with reglar expressions.  Grinder
keeps loging that:

 Error running worker process (SyntaxError: ('invalid
syntax',
('/home/grinder/grinder-3.0.1/projects/scripts/login.py',
29, 13, '    Pattern p = Pattern.compile("string")'))


I tried to use import re but I was getting error that
it could not be imported, so I am using the java
regex.

Here is my code:
from java.util import regex

connectionDefaults =
HTTPPluginControl.getConnectionDefaults()
httpUtilities = HTTPPluginControl.getHTTPUtilities()
log = grinder.logger.output
out = grinder.logger.TERMINAL

request = HTTPRequest(url = "http://nicoledev:80")

def pattern(httpText):

    Pattern p = Pattern.compile("string")
    Matcher m = p.matcher(variable)
    return m

Thoughts?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: Issues with Grinder and Regular Expressions

by Trilok Khairnar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Ron,

Please try doing the same on Jython command prompt first. The
advantage is that you get immediate feedback using one liners.

Thanks,
Trilok.

On 6/2/08, Ron Brennan <brennan007@...> wrote:

> Hello,
>
>  I am having an issue with reglar expressions.  Grinder
>  keeps loging that:
>
>   Error running worker process (SyntaxError: ('invalid
>  syntax',
>  ('/home/grinder/grinder-3.0.1/projects/scripts/login.py',
>  29, 13, '    Pattern p = Pattern.compile("string")'))
>
>
>  I tried to use import re but I was getting error that
>  it could not be imported, so I am using the java
>  regex.
>
>  Here is my code:
>  from java.util import regex
>
>  connectionDefaults =
>  HTTPPluginControl.getConnectionDefaults()
>  httpUtilities = HTTPPluginControl.getHTTPUtilities()
>  log = grinder.logger.output
>  out = grinder.logger.TERMINAL
>
>  request = HTTPRequest(url = "http://nicoledev:80")
>
>  def pattern(httpText):
>
>     Pattern p = Pattern.compile("string")
>     Matcher m = p.matcher(variable)
>     return m
>
>  Thoughts?
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  grinder-use mailing list
>  grinder-use@...
>  https://lists.sourceforge.net/lists/listinfo/grinder-use
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: Issues with Grinder and Regular Expressions

by Calum Fitzgerald :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First off make sure that you have the full version of jython installed
and set up on your classpath before you try to import modules. The
version of jython with the grinder does not have all the libraries.

A couple of links for you:

http://grinder.sourceforge.net/faq.html#re-problems
http://grinder.sourceforge.net/g3/scripts.html (bottom of the page)

i appreciate that this is not helping you with your java re problem
but it may help you to get the jython re module working.

Cheers
Cal



2008/6/2 Ron Brennan <brennan007@...>:

> Hello,
>
> I am having an issue with reglar expressions.  Grinder
> keeps loging that:
>
>  Error running worker process (SyntaxError: ('invalid
> syntax',
> ('/home/grinder/grinder-3.0.1/projects/scripts/login.py',
> 29, 13, '    Pattern p = Pattern.compile("string")'))
>
>
> I tried to use import re but I was getting error that
> it could not be imported, so I am using the java
> regex.
>
> Here is my code:
> from java.util import regex
>
> connectionDefaults =
> HTTPPluginControl.getConnectionDefaults()
> httpUtilities = HTTPPluginControl.getHTTPUtilities()
> log = grinder.logger.output
> out = grinder.logger.TERMINAL
>
> request = HTTPRequest(url = "http://nicoledev:80")
>
> def pattern(httpText):
>
>    Pattern p = Pattern.compile("string")
>    Matcher m = p.matcher(variable)
>    return m
>
> Thoughts?
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
LightInTheBox - Buy quality products at wholesale price