You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by David La France <da...@silveregg.co.jp> on 2002/01/30 02:59:21 UTC

HTML parameter mask

Hi,

I wrote a modifier called HTML Parameter Mask - so, on the off chance that someone else can use it, here it is. If this is not the correct procedure for code 
submission, I apologize....

A short description:

-------------
This modifier will replace any single http sampler's url parameter value with a value
from a given range - thereby "masking" the value set in the http sampler. The parameter names
must match exactly, and the parameter value must be preset to "*" to diferentiate between
duplicate parameter names.

For example, if you set up the modifier with a lower bound of 1, an upper bound of 10, and
an increment of 2, and run the loop 12 times, the parameter will have the following values
(one per loop): 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, 1, 3
--------------


I tried my best to follow the Jmeter model in doing things, but this is my first time with Jmeter, so some things might be strange ;)

Also, I was holding off on submitting this because I wanted to make some structural changes.  But lately I am busy, so I will just run them by you guys to see what you 
think.  I originally was going to write the modifier gui so that with one modifier panel you could "mask" multiple parameters (I didn't get that far).  However, I got to 
thinking that perhaps I should give it the ability to use different implementations of the modifier instead.  So I could make the "ParamMask" object (which contains all 
the data and methods for actually manipulating the parameter values) an interface and provide an abstract base class.  Then you could write a new Mask by 
simply creating an object that extends the base class, or if you want to radically change the functionality, you can create your own implementation of the interface.  
Then, when the gui loads up, it would search for all classes that implement the interface, and list them - allowing you to choose which "mask" you wish to use.

What do you guys think?

Anyway, here is the code, and the paths where put the files

org.apache.jmeter.protocol.http.modifier.ParamModifier : The main modifier implementation
org.apache.jmeter.protocol.http.modifier.ParamMask     : Abstracts the value-changing code
org.apache.jmeter.protocol.http.modifier.gui.ParamModifierGui : The swing panel 
org.apache.jmeter.protocol.http.save : ParamMaskHandler: The handler to save/load ParamMask objects to/from xml format

Everything compiles, but beyond that I make no promises :)

Dave