Search in sources :

Example 11 with CorrectedResultCollector

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

the class AbstractGraphPanelVisualizerTest method testIncludeExclude_include_only.

@Test
public void testIncludeExclude_include_only() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.setProperty(CorrectedResultCollector.INCLUDE_SAMPLE_LABELS, "boom1,test,boom2");
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    instance.setListener(vis);
    vis.configure(instance);
    SampleResult res = new SampleResult();
    res.setSampleLabel("test");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertEquals("test", vis.lastLabel);
    vis.lastLabel = null;
    SampleResult res2 = new SampleResult();
    res2.setSampleLabel("test1");
    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 12 with CorrectedResultCollector

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

the class AbstractGraphPanelVisualizerTest method testIncludeExcludeRegex_none.

@Test
public void testIncludeExcludeRegex_none() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.setProperty(CorrectedResultCollector.INCLUDE_SAMPLE_LABELS, "P[0-9].*");
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    instance.setListener(vis);
    vis.configure(instance);
    vis.lastLabel = null;
    SampleResult res2 = new SampleResult();
    res2.setSampleLabel("P1_TEST");
    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 13 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector 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 14 with CorrectedResultCollector

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

the class MergeResultsServiceTest method testMergeSamples.

@Test
public void testMergeSamples() throws Exception {
    String fname = "test-merge.csv";
    CorrectedResultCollector crc = new CorrectedResultCollector();
    crc.getSaveConfig().setAsXml(false);
    crc.setFilename(fname);
    MergeResultsService instance = new MergeResultsService();
    instance.mergeSamples(crc, SAMPLES);
    File f = new File(fname);
    assertEquals(true, f.exists());
    f.delete();
}
Also used : File(java.io.File) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Example 15 with CorrectedResultCollector

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

the class MergeResultsServiceTest method testMergeSamples_XML.

@Test
public void testMergeSamples_XML() throws Exception {
    String fname = "test-merge.csv";
    CorrectedResultCollector crc = new CorrectedResultCollector();
    crc.getSaveConfig().setAsXml(true);
    crc.setFilename(fname);
    MergeResultsService instance = new MergeResultsService();
    instance.mergeSamples(crc, SAMPLES);
    File f = new File(fname);
    assertEquals(true, f.exists());
    f.delete();
}
Also used : File(java.io.File) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

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