Search in sources :

Example 21 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector 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);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Example 22 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testMinMax_max_only.

@Test
public void testMinMax_max_only() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    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);
    instance.testEnded();
    instance.setEndOffset("20a");
    instance.testStarted();
    vis.configure(instance);
    instance.setListener(vis);
    vis.lastLabel = null;
    SampleResult res2 = SampleResult.createTestSample(31000, 32000);
    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)

Aggregations

CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)22 SampleEvent (org.apache.jmeter.samplers.SampleEvent)12 SampleResult (org.apache.jmeter.samplers.SampleResult)12 File (java.io.File)4 IOException (java.io.IOException)1 AbstractGraphPanelVisualizer (kg.apc.jmeter.graphs.AbstractGraphPanelVisualizer)1 SampleSaveConfiguration (org.apache.jmeter.samplers.SampleSaveConfiguration)1 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)1 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)1 NullProperty (org.apache.jmeter.testelement.property.NullProperty)1