use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class UDPSamplerTest method testReal.
// @Test
public void testReal() {
System.out.println("real");
instance = new UDPSampler();
instance.setHostName("8.8.8.8");
instance.setPort("53");
instance.setRequestData("f11b0100000100000000000004636f646506676f6f676c6503636f6d00001c0001");
instance.setEncoderClass(HexStringUDPDecoder.class.getCanonicalName());
instance.threadStarted();
instance.setWaitResponse(true);
instance.setTimeout("500");
SampleResult res = instance.sample(null);
assertTrue(res.isSuccessful());
assertTrue(res.getResponseDataAsString().length() > 0);
SampleResult res2 = instance.sample(null);
assertTrue(res2.isSuccessful());
assertTrue(res2.getResponseDataAsString().length() > 0);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class PerfMonSampleResultTest method testGetValue_SampleResult.
/**
* Test of getValue method, of class PerfMonSampleResult.
*/
@Test
public void testGetValue_SampleResult() {
System.out.println("getValue");
SampleResult res = new SampleResult(1000000, 123 * 1000);
double expResult = 123;
double result = PerfMonSampleResult.getValue(res);
assertEquals(expResult, result, 0.0);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class ThreadsStateOverTimeGuiTest method testAdd.
/**
* Test of add method, of class ThreadsStateOverTimeGui.
*/
@Test
public void testAdd() {
System.out.println("add");
SampleResult res = new SampleResult();
res.sampleStart();
res.setAllThreads(1);
res.setThreadName("test 1-2");
res.sampleEnd();
instance.add(res);
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(ThreadsStateOverTimeGuiTest.class.getName()).log(Level.SEVERE, null, ex);
}
SampleResult res2 = new SampleResult(res);
res2.setAllThreads(1);
res2.setThreadName("test 1-2");
instance.add(res);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class ConnectTimesOverTimeGuiTest method testAdd.
@Test
public void testAdd() {
ConnectTimesOverTimeGui obj = new ConnectTimesOverTimeGui();
SampleResult res = new SampleResult();
obj.add(res);
}
use of org.apache.jmeter.samplers.SampleResult in project jmeter-plugins by undera.
the class HitsPerSecondGuiTest method testAdd_issue48.
@Test
public void testAdd_issue48() {
System.out.println("add48");
SampleResult res = new SampleResult();
res.setAllThreads(0);
res.setThreadName("test 1-2");
res.setResponseMessage(null);
SampleResult subres = new SampleResult();
subres.sampleStart();
subres.sampleEnd();
res.sampleStart();
res.addSubResult(subres);
try {
Thread.sleep(10);
} catch (InterruptedException ex) {
}
HitsPerSecondGui instance = new HitsPerSecondGui();
instance.add(res);
}
Aggregations