use of org.apache.jmeter.samplers.SampleResult in project jmeter by apache.
the class ViewResultsFullVisualizer method valueChanged.
/** {@inheritDoc} */
@Override
public void valueChanged(TreeSelectionEvent e) {
lastSelectionEvent = e;
DefaultMutableTreeNode node;
synchronized (this) {
node = (DefaultMutableTreeNode) jTree.getLastSelectedPathComponent();
}
if (node != null) {
// to restore last tab used
if (rightSide.getTabCount() > selectedTab) {
resultsRender.setLastSelectedTab(rightSide.getSelectedIndex());
}
Object userObject = node.getUserObject();
resultsRender.setSamplerResult(userObject);
// Processes Assertions
resultsRender.setupTabPane();
// display a SampleResult
if (userObject instanceof SampleResult) {
SampleResult sampleResult = (SampleResult) userObject;
if (isTextDataType(sampleResult)) {
resultsRender.renderResult(sampleResult);
} else {
byte[] responseBytes = sampleResult.getResponseData();
if (responseBytes != null) {
resultsRender.renderImage(sampleResult);
}
}
}
}
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter by apache.
the class AbstractScopedTestElement method getSampleList.
/**
* Generate a list of qualifying sample results,
* depending on the scope.
*
* @param result current sample
* @return list containing the current sample and/or its child samples
*/
protected List<SampleResult> getSampleList(SampleResult result) {
List<SampleResult> sampleList = new ArrayList<>();
String scope = fetchScope();
if (isScopeParent(scope) || isScopeAll(scope)) {
sampleList.add(result);
}
if (isScopeChildren(scope) || isScopeAll(scope)) {
for (SampleResult subResult : result.getSubResults()) {
sampleList.add(subResult);
}
}
return sampleList;
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class JSONToXMLConverterTest method testSample.
/**
* Test of sample method, of class JSONToXMLConverter.
*/
@Test
public void testSample() {
System.out.println("sample");
Entry e = null;
JSONToXMLConverter instance = new JSONToXMLConverter();
SampleResult expResult = null;
SampleResult result = instance.sample(e);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class JSONFormatterTest method testProcess_float.
@Test
public void testProcess_float() {
System.out.println("process float");
JSONFormatter instance = new JSONFormatter();
JMeterContext threadContext = JMeterContextService.getContext();
SampleResult res = new SampleResult();
res.setResponseData("3.14", "UTF8");
threadContext.setPreviousResult(res);
instance.process();
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class JSONFormatterTest method testProcess_array.
@Test
public void testProcess_array() {
System.out.println("process array");
JSONFormatter instance = new JSONFormatter();
JMeterContext threadContext = JMeterContextService.getContext();
SampleResult res = new SampleResult();
res.setResponseData("[]", "UTF8");
threadContext.setPreviousResult(res);
instance.process();
}
Aggregations