use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class AbstractGraphPanelVisualizerTest method testIncludeExcludeRegex_exclude_include.
@Test
public void testIncludeExcludeRegex_exclude_include() {
CorrectedResultCollector instance = new CorrectedResultCollector();
instance.setExcludeLabels("[T-Z][0-9].*");
instance.setIncludeLabels("[P-T][0-9].*");
instance.setProperty(CorrectedResultCollector.EXCLUDE_REGEX_CHECKBOX_STATE, true);
instance.setProperty(CorrectedResultCollector.INCLUDE_REGEX_CHECKBOX_STATE, true);
instance.testStarted();
DebugVisualizer vis = new DebugVisualizer();
vis.configure(instance);
instance.setListener(vis);
vis.lastLabel = null;
SampleResult res = new SampleResult();
res.setSampleLabel("Z1_TEST");
instance.sampleOccurred(new SampleEvent(res, "tg"));
assertNull(vis.lastLabel);
vis.lastLabel = null;
SampleResult res2 = new SampleResult();
res2.setSampleLabel("P1_TEST");
instance.sampleOccurred(new SampleEvent(res2, "tg"));
assertEquals("P1_TEST", vis.lastLabel);
vis.lastLabel = null;
SampleResult res3 = new SampleResult();
res3.setSampleLabel("T1_TEST");
instance.sampleOccurred(new SampleEvent(res3, "tg"));
assertNull(vis.lastLabel);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class AbstractGraphPanelVisualizerTest method testIncludeExcludeRegex_exclude_only.
@Test
public void testIncludeExcludeRegex_exclude_only() {
CorrectedResultCollector instance = new CorrectedResultCollector();
instance.setProperty(CorrectedResultCollector.EXCLUDE_SAMPLE_LABELS, "P[0-9].*");
instance.setProperty(CorrectedResultCollector.EXCLUDE_REGEX_CHECKBOX_STATE, true);
instance.testStarted();
DebugVisualizer vis = new DebugVisualizer();
instance.setListener(vis);
vis.configure(instance);
vis.lastLabel = null;
SampleResult res = new SampleResult();
res.setSampleLabel("P1_TEST");
instance.sampleOccurred(new SampleEvent(res, "tg"));
assertNull(vis.lastLabel);
vis.lastLabel = null;
SampleResult res1 = new SampleResult();
res1.setSampleLabel("T1_TEST");
instance.sampleOccurred(new SampleEvent(res1, "tg"));
assertEquals("T1_TEST", vis.lastLabel);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class AutoStopTest method testSampleOccurred.
/**
* Test of sampleOccurred method, of class AutoStop.
*/
@Test
public void testSampleOccurred() throws InterruptedException {
System.out.println("sampleOccurred");
SampleResult res = new SampleResult();
res.setLatency(500);
SampleEvent se = new SampleEvent(res, "");
AutoStop instance = new AutoStop();
instance.setResponseTime("10");
instance.setResponseTimeSecs("3");
instance.setErrorRate("0");
instance.sampleOccurred(se);
for (int n = 0; n < 5; n++) {
synchronized (this) {
wait(1000);
}
instance.sampleOccurred(se);
}
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class AbstractDynamicThreadGroupModel method saveLogRecord.
protected void saveLogRecord(String marker, String threadName, String arrivalID) {
SampleResult res = new SampleResult();
res.sampleStart();
res.setSampleLabel(arrivalID);
res.setResponseMessage(marker);
res.setThreadName(threadName);
res.sampleEnd();
SampleEvent evt = new SampleEvent(res, getName());
logFile.sampleOccurred(evt);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class MonitoringResultsCollectorTest method testMonitoringSampleOccurred.
/**
* Test of monitoringSampleOccurred method, of class MonitoringResultsCollector.
*/
@Test
public void testMonitoringSampleOccurred() {
System.out.println("monitoringSampleOccurred");
SampleEvent event = new SampleEvent(new SampleResult(), "test");
MonitoringResultsCollector instance = new MonitoringResultsCollector();
instance.monitoringSampleOccurred(event);
// TODO review the generated test code and remove the default call to fail.
}
Aggregations