jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: Jmeter and Beanshell
Date Thu, 19 Apr 2012 22:57:00 GMT
Beansheell doesnt support generics

On Thu, Apr 19, 2012 at 3:52 PM, 5942marine <jlukensow@gmail.com> wrote:

> I'm getting a error, and not sure why this is erroring out. If I run the
> same
> java in Eclipse, it works just fine. First, here is my code:
>
> import java.net.URI;
> import java.net.URISyntaxException;
> import java.util.List;
> import org.apache.http.NameValuePair;
> import org.apache.http.client.utils.URLEncodedUtils;
>
> String tripItURl = vars.get("tripItUrl");
> URI urlt = null;
> urlt = new URI(tripItURl);
> String tripItDomain = urlt.getHost();
> String tripItPath = urlt.getPath();
> String tripItQuery = urlt.getQuery();
>
> List<NameValuePair> params = null;
>
> try {
>
> params = URLEncodedUtils.parse(new URI(tripItURl), "UTF-8");
>
> } catch (URISyntaxException e) {
>
> // TODO Auto-generated catch block
>
> e.printStackTrace();
>
> }
>
>
> String oauth_token = params.get(0).getValue();
> String oauth_callback = params.get(1).getValue();
>
> log.info("*****************************");
> log.info(oauth_token);
> log.info("*****************************");
>
> vars.put("domain",tripItDomain);
> vars.put("path",tripItPath);
> vars.put("oauth_token", oauth_token);
> vars.put("oauth_callback", oauth_callback);
>
> Now, in the log viewer, here is the error:
>
> 2012/04/19 15:32:31 ERROR - jmeter.util.BeanShellInterpreter: Error
> invoking
> bsh method: eval        In file: inline evaluation of: ``import
> java.net.URI;
> import java.net.URISyntaxException; import java.util.List;  . . . ''
> Encountered "=" at line 14, column 28.
>
> So the issue has to do with: List<NameValuePair> params = null;
>
> But again, the following code when ran, works just fine in Eclipse.
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Jmeter-and-Beanshell-tp5652979p5652979.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message