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: [email protected]
For additional commands, e-mail: [email protected]