Search in sources :

Example 71 with SampleResult

use of org.apache.jmeter.samplers.SampleResult 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 72 with SampleResult

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

the class AbstractOverTimeVisualizerTest method testAdd.

/**
 * Test of add method, of class AbstractOverTimeVisualizer.
 */
@Test
public void testAdd() {
    System.out.println("add");
    SampleResult sample = new SampleResult();
    AbstractOverTimeVisualizer instance = new AbstractOverTimeVisualizerImpl();
    instance.add(sample);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) Test(org.junit.Test)

Example 73 with SampleResult

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

the class AbstractVsThreadVisualizerTest method testAdd.

/**
 * Test of add method, of class AbstractVsThreadVisualizer.
 */
@Test
public void testAdd() {
    System.out.println("add");
    SampleResult sample = new SampleResult();
    AbstractVsThreadVisualizer instance = new AbstractVsThreadVisualizerImpl();
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) Test(org.junit.Test)

Example 74 with SampleResult

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

the class AbstractVsThreadVisualizerTest method testGetCurrentThreadCount.

/**
 * Test of getCurrentThreadCount method, of class AbstractVsThreadVisualizer.
 */
@Test
public void testGetCurrentThreadCount() {
    System.out.println("getCurrentThreadCount");
    long now = System.currentTimeMillis();
    SampleResult sample = new SampleResult();
    sample.setGroupThreads(3);
    sample.setThreadName("test_tg");
    sample.setStampAndTime(now, 300);
    AbstractVsThreadVisualizer instance = new AbstractVsThreadVisualizerImpl();
    instance.add(sample);
    int expResult = 3;
    int result = instance.getCurrentThreadCount(sample);
    assertEquals(expResult, result);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) Test(org.junit.Test)

Example 75 with SampleResult

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

the class AutoStopTest method testSampleOccurred_error.

/**
 * Test of sampleOccurred method, of class AutoStop.
 */
@Test
public void testSampleOccurred_error() throws InterruptedException {
    System.out.println("sampleOccurred error");
    SampleResult res = new SampleResult();
    SampleEvent se = new SampleEvent(res, "");
    AutoStop instance = new AutoStop();
    instance.setResponseTime("0");
    instance.setErrorRate("60.6");
    instance.setErrorRateSecs("3");
    instance.sampleOccurred(se);
    for (int n = 0; n < 5; n++) {
        synchronized (this) {
            wait(1000);
        }
        instance.sampleOccurred(se);
    }
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) SampleEvent(org.apache.jmeter.samplers.SampleEvent) Test(org.junit.Test)

Aggregations

SampleResult (org.apache.jmeter.samplers.SampleResult)379 Test (org.junit.Test)83 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)71 Test (org.junit.jupiter.api.Test)59 JMeterContext (org.apache.jmeter.threads.JMeterContext)47 BeforeEach (org.junit.jupiter.api.BeforeEach)36 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)34 SampleEvent (org.apache.jmeter.samplers.SampleEvent)30 Sampler (org.apache.jmeter.samplers.Sampler)30 AssertionResult (org.apache.jmeter.assertions.AssertionResult)27 ArrayList (java.util.ArrayList)26 CompoundVariable (org.apache.jmeter.engine.util.CompoundVariable)20 HTTPSamplerBase (org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)20 IOException (java.io.IOException)17 Arguments (org.apache.jmeter.config.Arguments)16 MethodSource (org.junit.jupiter.params.provider.MethodSource)13 CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)12 URL (java.net.URL)9 File (java.io.File)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7