jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <mark.o.mil...@gmail.com>
Subject Accessing and asserting remote file system resources using BeanShell
Date Fri, 04 Dec 2009 06:17:30 GMT
First off, a nod of appreciation to the contributors for this fantastic
tool.

I am using Jmeter to validate the integrity of some complex integrations.
For these tests I use LDAP, HTTP, JDBC, and SOAP samplers extensively. It is
providing great value.

There is one final piece of my vision that I am struggling to achieve: I
want to 'sample' from remotely running BeanShell servers by sending code
that will find, read, and send back the contents of configuration files (for
example) which I can then continue to evaluate in the sampler or with
subsequent assertions. I've proven with basic BeanShell that I can do this
in a crude, raw fashion outside of Jmeter.

I have tried two approaches inside Jmeter:

1) Using a TCPSampler and sending java to the BeanShell telnet port
(port+1).
2) Using a BeanShell sampler and directly invoking the bsh.Remote class.
(see code below)

import bsh.Remote;
i = new Remote();
ResponseMessage = (i.eval("bsh://localhost:9000","print(0);"));

The main crux, it seems, is that the connection returns nothing until the
BeanShell server itself exits. I also tried sending an exit() over to the
server which allows it to send an exit code back - but also terminates the
server process. So that doesn't do the trick. (Nor do I get the String data
I am looking for, just an exit code.)

I'm not quite on the right track with this. But I think the utility of the
idea is so obvious that someone may have crossed this bridge.

Anyone done anything like this and can provide some insights or point me in
the right direction?

I do appreciate your thoughts on this.

-- 
Mark Miller

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