You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Chris Logan <cl...@grx.com> on 2002/10/07 18:33:13 UTC

newbie needs help with adding new sampler

Howdy,

I'm trying to test an application that requires posts of content-type of text/xml.  I have tried using the HTTPSampler, and then was told about the SOAPSampler.  Once I get things working, I intend to modify the SoapSampler as necessary.  I found the SOAP sampler source code in the latest daily build, but not in the 1.7B3.

I could not get the daily build to run, so I have resorted to taking code from the daily build and putting it into the released build as an extension.

So, from the daily build I compiled org.apache.jmeter.protocol.http.SoapSampler & org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui, and put them in a jar in the ext directory of jmeter.  I then configured it this way:

search_paths=ApacheJMeter.jar;classes;../ext/jmeter-ext.jar

I also copied a couple of messages from the message.properties file in the daily build into the jmeter build.

After doing all of this, I EXPECTED to see "Add SoapRequest" under the "Add\Generative Controller" menu of the thread group, however, I haven't noticed any changes.

I'm not at all sure if my approach is valid.  Any help would be great.

Thanks,
Chris

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


Re: newbie needs help with adding new sampler

Posted by Michal Kostrzewa <M....@pentacomp.com.pl>.
Dnia pon 7. październik 2002 18:33, Chris Logan napisał:
> After doing all of this, I EXPECTED to see "Add SoapRequest" under the
> "Add\Generative Controller" menu of the thread group, however, I haven't
> noticed any changes.

Hi,
I don't know if it helps, but here is how I added new sampler to JMeter:
1) I've created public class MyTestSampler which extends AbstractSampler 
2) I've created public class TestTestSampleGui which extends 
AbstractSamplerGui. Important methods are: createTestElement (I've returned 
instance of MyTestSampler) and getStaticLabel (I've returned a string with 
name of sampler.
3) I made sure that Jmeter saw that.

It's all. To show sampler in menu, you have to have a class extended from 
JMeterGUIComponent. I recommend you to look into the class 
org.apache.jmeter.gui.util.MenuFactory, method initializeMenus() to see how 
the menus are populated. It simply does 

List guiClasses = ClassFinder.findClassesThatExtend(new Class[]
					{JMeterGUIComponent.class});

and thet iterates on that list and adds appropriate menus.

The sad thing is that I'm describing the latest CVS version (or nightly build) 
of jmeter. I didn't use the release you mentioned. Latest versions compile 
and run succesfully with jdk 1.4.1 linux/win2k (no problems, I've tested it)

best regards
Michal Kostrzewa


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