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 Kate Rosenbloom <ka...@rapidmoney.com> on 2002/04/10 19:22:38 UTC

Variable substitution in HTTP and JDBC requests

Attached is code that implements a new modifier... here's
the description that I posted to jdev-user:

-----------------------------------------------------------------
I recently used JMeter to test a servlet, where I needed to have
each test thread generate a unique test sample (the first thread
would create "Test Customer 1", and the second thread would create
"Test Customer 2", etc.). Also, I needed this unique number to be
used in both the web requests (where the data record was created),
and in JDBC requests that I used to clean up the database after testing.

To do this, I implemented a Modifier, called ThreadNumberModifier.
It will substitute in the numeric ID of the currently executing 
thread anywhere it sees the text tag $$JMETER-THREAD$$ in any 
HTTP request (parameters or path) or JDBC request (the query) 
it processes.

The prefix $$JMETER- is handled by a superclass of 
ThreadNumberModifier (called TagModifier), so it would be easy 
to add other variable-substituting modifiers, such as for random 
numbers, random words, email addressses from a list, etc.(I think 
I've seen requests for these in the user mailing list, and also 
an enhancement request in the bug database.)
-----------------------------------------------------------------

The files are:
   3 new files (ThreadNumberModifier, ThreadNumberModifierGui,
				TagModifier)
   Diffs of changed files (AbstractConfigElement, UrlConfig, 									
SqlConfig, messages.properties)
   Descriptive text for the user manual

Respectfully submitted as a candidate new feature, with thanks
for the extremely useful project!

                Kate Rosenbloom
                RapidMoney Corp.
                Santa Cruz, CA

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