xmlData is a field in my implementation of AbstactSampler.
Sampler Code:
public class TibcoSampler extends AbstractSampler implements TestBean,
TestListener {
private static Logger LOG = LoggingManager.getLoggerForClass();
transient String daemon;
transient String service;
transient String network;
transient String subject;
transient String dataName;
> transient String xmlData;
Preprocessor Code:
public void process() {
LOG.debug("---------------- [" + this.getName()
+ "] --------------------");
TibrvMsg rvResponse = null;
String previousXml = null;
SampleResult previousResult =
getThreadContext().getPreviousResult();
try {
rvResponse = new
TibrvMsg(previousResult.getResponseData());
previousXml = (String) rvResponse.get("DATA");
} catch (TibrvException ex) {
LOG.error(ex.getMessage(), ex);
}
int index = previousXml.indexOf(this.getSessionId())
+ this.getSessionId().length();
value = previousXml.substring(index,
previousXml.indexOf("\"", index))
.trim();
TibcoSampler currentSampler = (TibcoSampler)
getThreadContext()
.getCurrentSampler();
> LOG.debug("XML DATA = "+currentSampler.getXmlData());
currentSampler.setXmlData(currentSampler.getXmlData().replaceAll(
"REPLACE", value));
}
When does JMeter populate the Sampler implementations? At the time my
Preprocessor is called the xmlData field is null.
At no point to I programmatically call setXmlData(). From reading the
jmeter.log it looks like these fields are populated when
the test begins, but maybe I am wrong. So basically I expect the fields in
the Sampler to be populated by the time the Preprocessor for
the given Sampler is called. Is this correct, and if not do you have any
suggestions
-Jerry
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates