Search in sources :

Example 16 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter by apache.

the class TestResultAction method testOnFailureStopThread.

@Test
public void testOnFailureStopThread() {
    sampleResult.setSuccessful(false);
    resultAction.setErrorAction(ResultAction.ON_ERROR_STOPTHREAD);
    resultAction.sampleOccurred(new SampleEvent(sampleResult, "JUnit-TG"));
    Assert.assertFalse(sampleResult.isStopTest());
    Assert.assertFalse(sampleResult.isStopTestNow());
    Assert.assertTrue(sampleResult.isStopThread());
    Assert.assertFalse(sampleResult.isStartNextThreadLoop());
}
Also used : SampleEvent(org.apache.jmeter.samplers.SampleEvent) Test(org.junit.Test)

Example 17 with SampleEvent

use of org.apache.jmeter.samplers.SampleEvent in project jmeter by apache.

the class TestResultAction method testOnFailureStartNextThreadLoop.

@Test
public void testOnFailureStartNextThreadLoop() {
    sampleResult.setSuccessful(false);
    resultAction.setErrorAction(ResultAction.ON_ERROR_START_NEXT_THREAD_LOOP);
    resultAction.sampleOccurred(new SampleEvent(sampleResult, "JUnit-TG"));
    Assert.assertFalse(sampleResult.isStopTest());
    Assert.assertFalse(sampleResult.isStopTestNow());
    Assert.assertFalse(sampleResult.isStopThread());
    Assert.assertTrue(sampleResult.isStartNextThreadLoop());
}
Also used : SampleEvent(org.apache.jmeter.samplers.SampleEvent) Test(org.junit.Test)

Aggregations

SampleEvent (org.apache.jmeter.samplers.SampleEvent)17 Test (org.junit.Test)10 File (java.io.File)3 SampleResult (org.apache.jmeter.samplers.SampleResult)3 SampleSaveConfiguration (org.apache.jmeter.samplers.SampleSaveConfiguration)2 StatisticalSampleResult (org.apache.jmeter.samplers.StatisticalSampleResult)2 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Collection (java.util.Collection)1 Date (java.util.Date)1 Arguments (org.apache.jmeter.config.Arguments)1 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)1 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)1