use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class ConsoleStatusLoggerTest method testSampleStopped.
/**
* Test of sampleStopped method, of class ConsoleStatusLogger.
*/
@Test
public void testSampleStopped() {
System.out.println("sampleStopped");
SampleEvent se = null;
ConsoleStatusLogger instance = new ConsoleStatusLogger();
instance.sampleStopped(se);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class ConsoleStatusLoggerTest method testSampleStarted.
/**
* Test of sampleStarted method, of class ConsoleStatusLogger.
*/
@Test
public void testSampleStarted() {
System.out.println("sampleStarted");
SampleEvent se = null;
ConsoleStatusLogger instance = new ConsoleStatusLogger();
instance.sampleStarted(se);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class FlexibleFileWriterTest method testSampleOccurred_null.
@Test
public void testSampleOccurred_null() throws IOException {
System.out.println("sampleOccurred null");
SampleResult res = new SampleResult();
// res.setResponseData("test".getBytes());
SampleEvent e = new SampleEvent(res, "Test");
FlexibleFileWriter instance = new FlexibleFileWriter();
instance.setColumns(FlexibleFileWriter.AVAILABLE_FIELDS.replace(' ', '|'));
String tmpFile = File.createTempFile("ffw_test_", ".txt").getAbsolutePath();
instance.setFilename(tmpFile);
instance.testStarted();
for (int n = 0; n < 10; n++) {
res.sampleStart();
res.sampleEnd();
instance.sampleOccurred(e);
}
instance.testEnded();
assertTrue(tmpFile.length() > 0);
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class FlexibleFileWriterTest method testSampleOccurred_phout.
@Test
public void testSampleOccurred_phout() throws IOException {
System.out.println("sampleOccurred_phout");
SampleResult res = new SampleResult();
res.sampleStart();
res.setResponseData("test".getBytes());
res.setResponseCode("200");
res.setLatency(4);
res.setSuccessful(true);
res.sampleEnd();
SampleEvent e = new SampleEvent(res, "Test");
FlexibleFileWriter instance = new FlexibleFileWriter();
instance.setFilename(File.createTempFile("ffw_test_", ".txt").getAbsolutePath());
instance.setColumns("endTimeMillis|\\t\\t|responseTimeMicros|\\t|latencyMicros|\\t|sentBytes|\\t|receivedBytes|\\t|isSuccsessful|\\t|responseCode|\\t|connectTime|\\r\\n");
instance.testStarted();
instance.sampleOccurred(e);
// String written = JMeterPluginsUtils.byteBufferToString(instance.fileEmul.getWrittenBytes());
// System.out.println(written);
// assertEquals(8, written.split("\t").length);
instance.testEnded();
}
use of org.apache.jmeter.samplers.SampleEvent in project jmeter-plugins by undera.
the class DbMonCollectorTest method testDbMonSampleOccurred.
/**
* Test of dbMonSampleOccurred method, of class DbMonCollector.
*/
@Test
public void testDbMonSampleOccurred() {
System.out.println("dbMonSampleOccurred");
SampleEvent event = new SampleEvent(new SampleResult(), "test");
DbMonCollector instance = new DbMonCollector();
instance.dbMonSampleOccurred(event);
// TODO review the generated test code and remove the default call to fail.
}
Aggregations