Search in sources :

Example 21 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testMinMax_none.

@Test
public void testMinMax_none() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    vis.configure(instance);
    instance.setListener(vis);
    SampleResult res = SampleResult.createTestSample(21000, 30000);
    res.setSampleLabel("test");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertEquals("test", vis.lastLabel);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Example 22 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testMinMax_min_only.

@Test
public void testMinMax_min_only() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.setStartOffset("10");
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    vis.configure(instance);
    instance.setListener(vis);
    vis.startTimeRef = 10300;
    vis.startTimeInf = 10000;
    vis.startTimeSup = 11000;
    vis.lastLabel = null;
    SampleResult res = SampleResult.createTestSample(19000, 20000);
    res.setSampleLabel("test");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertNull(vis.lastLabel);
    vis.lastLabel = null;
    SampleResult res1 = SampleResult.createTestSample(21000, 22000);
    res1.setSampleLabel("test1");
    instance.sampleOccurred(new SampleEvent(res1, "tg"));
    assertEquals("test1", vis.lastLabel);
    instance.testEnded();
    instance.setStartOffset("10a");
    instance.testStarted();
    vis.configure(instance);
    instance.setListener(vis);
    vis.lastLabel = null;
    SampleResult res2 = SampleResult.createTestSample(19000, 20000);
    res2.setSampleLabel("test2");
    instance.sampleOccurred(new SampleEvent(res2, "tg"));
    assertEquals("test2", vis.lastLabel);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Example 23 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testIncludeExclude_none.

@Test
public void testIncludeExclude_none() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    vis.configure(instance);
    instance.setListener(vis);
    SampleResult res = new SampleResult();
    res.setSampleLabel("test");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertEquals("test", vis.lastLabel);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Example 24 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testMinMax_min_max.

@Test
public void testMinMax_min_max() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.setStartOffset("10");
    instance.setEndOffset("20");
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    vis.configure(instance);
    instance.setListener(vis);
    vis.startTimeRef = 10300;
    vis.startTimeInf = 10000;
    vis.startTimeSup = 11000;
    vis.lastLabel = null;
    SampleResult res = SampleResult.createTestSample(31500, 32000);
    res.setSampleLabel("test");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertNull(vis.lastLabel);
    vis.lastLabel = null;
    SampleResult res1 = SampleResult.createTestSample(29000, 30000);
    res1.setSampleLabel("test1");
    instance.sampleOccurred(new SampleEvent(res1, "tg"));
    assertEquals("test1", vis.lastLabel);
    vis.lastLabel = null;
    SampleResult res2 = SampleResult.createTestSample(19000, 20000);
    res2.setSampleLabel("test2");
    instance.sampleOccurred(new SampleEvent(res2, "tg"));
    assertNull(vis.lastLabel);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Example 25 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.

the class MonitoringResultsCollector method generateSample.

@Override
public void generateSample(double value, String label) {
    MonitoringSampleResult res = new MonitoringSampleResult();
    res.setSampleLabel(label);
    res.setValue(value);
    res.setSuccessful(true);
    SampleEvent e = new SampleEvent(res, getPrefix());
    monitoringSampleOccurred(e);
}
Also used : SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Aggregations

SampleEvent (org.apache.jmeter.samplers.SampleEvent)58 SampleResult (org.apache.jmeter.samplers.SampleResult)30 Test (org.junit.Test)17 CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)12 Test (org.junit.jupiter.api.Test)10 File (java.io.File)5 JMeterSerialTest (org.apache.jorphan.test.JMeterSerialTest)4 SampleSaveConfiguration (org.apache.jmeter.samplers.SampleSaveConfiguration)3 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)3 IOException (java.io.IOException)2 ResultCollector (org.apache.jmeter.reporters.ResultCollector)2 StatisticalSampleResult (org.apache.jmeter.samplers.StatisticalSampleResult)2 ArrivalsThreadGroupTest (com.blazemeter.jmeter.threads.arrivals.ArrivalsThreadGroupTest)1 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1