use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class FifoPutTest method testExecute.
@Test
public void testExecute() throws Exception {
System.out.println("execute");
SampleResult previousResult = null;
Sampler currentSampler = null;
FifoPut instance = new FifoPut();
String expResult = "FifoPuttest";
LinkedList<CompoundVariable> list = new LinkedList<>();
list.add(new CompoundVariable("FifoPuttest"));
list.add(new CompoundVariable("FifoPuttest"));
instance.setParameters(list);
String result = instance.execute(null, null);
Assert.assertEquals(expResult, result);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class FifoSizeTest method testExecute.
/**
* Test of execute method, of class FifoSize.
*/
@Test
public void testExecute() throws Exception {
System.out.println("execute");
SampleResult previousResult = null;
Sampler currentSampler = null;
LinkedList<CompoundVariable> list;
list = new LinkedList<>();
list.add(new CompoundVariable("test"));
list.add(new CompoundVariable("test"));
FifoSize instance = new FifoSize();
instance.setParameters(list);
String expResult = "0";
String result = instance.execute(null, null);
Assert.assertEquals(expResult, result);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class AggregateReportGuiTest method testAdd.
/**
* Test of add method, of class StatVisualizerAccessorGui.
*/
@Test
public void testAdd() throws IOException {
System.out.println("add");
AggregateReportGui instance = new AggregateReportGui();
SampleResult res = new SampleResult();
instance.add(res);
SampleResult res2 = new SampleResult();
instance.add(res2);
ResultCollector rc = new ResultCollector();
rc.setListener(instance);
rc.sampleOccurred(new SampleEvent(res, ""));
rc.sampleOccurred(new SampleEvent(res2, ""));
File f = File.createTempFile("test", ".csv");
instance.getGraphPanelChart().saveGraphToCSV(f);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class SynthesisReportGuiTest method testAdd.
/**
* Test of add method, of class SynthesisReportGui.
*/
@Test
public void testAdd() throws IOException {
System.out.println("add");
SynthesisReportGui instance = new SynthesisReportGui();
SampleResult res = new SampleResult();
instance.add(res);
SampleResult res2 = new SampleResult();
instance.add(res2);
ResultCollector rc = new ResultCollector();
rc.setListener(instance);
rc.sampleOccurred(new SampleEvent(res, ""));
rc.sampleOccurred(new SampleEvent(res2, ""));
File f = File.createTempFile("test", ".csv");
instance.getGraphPanelChart().saveGraphToCSV(f);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class WebDriverSamplerTest method shouldReturnFailureSampleResultWhenScriptSetsSampleResultToFailure.
@Test
public void shouldReturnFailureSampleResultWhenScriptSetsSampleResultToFailure() throws MalformedURLException {
sampler.setScript("WDS.sampleResult.setSuccessful(false);");
final SampleResult sampleResult = sampler.sample(null);
assertThat(sampleResult.isSuccessful(), is(false));
assertThat(sampleResult.getResponseCode(), is("500"));
assertThat(sampleResult.getResponseMessage(), not("OK"));
assertThat(sampleResult.getResponseDataAsString(), is("page source"));
assertThat(sampleResult.getURL(), is(new URL("http://google.com.au")));
verify(browser, times(1)).getPageSource();
verify(browser, times(1)).getCurrentUrl();
}
Aggregations