@Test public void testSample() { System.out.println("sample"); Entry entry = null; AbstractIPSampler instance = new AbstractIPSamplerImpl(); SampleResult result = instance.sample(entry); assertNotNull(result); }
@Override public SampleResult sample(Entry entry) { SampleResult res = new SampleResult(); res.setSampleLabel(getName()); res.setSamplerData(getRequestData()); res.sampleStart(); res.setDataType(SampleResult.TEXT); res.setSuccessful(true); res.setResponseCode(RC200); try { res.setResponseData(processIO(res)); } catch (Exception ex) { if (!(ex instanceof SocketTimeoutException)) { log.error(getHostName(), ex); } res.sampleEnd(); res.setSuccessful(false); res.setResponseCode(RC500); res.setResponseMessage(ex.toString()); res.setResponseData((ex.toString() + CRLF + ExceptionUtils.getStackTrace(ex)).getBytes()); } return res; }
AbstractIPSampler extends AbstractSampler implements Serializable, Cloneable, Interruptible { @Override public SampleResult sample(Entry entry) { SampleResult res = new SampleResult(); res.setSampleLabel(getName()); res.setSamplerData(getRequestData()); res.sampleStart(); res.setDataType(SampleResult.TEXT); res.setSuccessful(true); res.setResponseCode(RC200); try { res.setResponseData(processIO(res)); } catch (Exception ex) { if (!(ex instanceof SocketTimeoutException)) { log.error(getHostName(), ex); } res.sampleEnd(); res.setSuccessful(false); res.setResponseCode(RC500); res.setResponseMessage(ex.toString()); res.setResponseData((ex.toString() + CRLF + ExceptionUtils.getStackTrace(ex)).getBytes()); } return res; } }
AbstractIPSampler extends AbstractSampler implements Serializable, Cloneable, Interruptible { @Override public SampleResult sample(Entry entry) { SampleResult res = new SampleResult(); res.setSampleLabel(getName()); res.setSamplerData(getRequestData()); res.sampleStart(); res.setDataType(SampleResult.TEXT); res.setSuccessful(true); res.setResponseCode(RC200); try { res.setResponseData(processIO(res)); } catch (Exception ex) { if (!(ex instanceof SocketTimeoutException)) { log.error(getHostName(), ex); } res.sampleEnd(); res.setSuccessful(false); res.setResponseCode(RC500); res.setResponseMessage(ex.toString()); res.setResponseData((ex.toString() + CRLF + ExceptionUtils.getStackTrace(ex)).getBytes()); } return res; } AbstractIPSampler(); }
AbstractIPSampler extends AbstractSampler implements Serializable, Cloneable, Interruptible { @Override public SampleResult sample(Entry entry) { SampleResult res = new SampleResult(); res.setSampleLabel(getName()); res.setSamplerData(getRequestData()); res.sampleStart(); res.setDataType(SampleResult.TEXT); res.setSuccessful(true); res.setResponseCode(RC200); try { res.setResponseData(processIO(res)); } catch (Exception ex) { if (!(ex instanceof SocketTimeoutException)) { log.error(getHostName(), ex); } res.sampleEnd(); res.setSuccessful(false); res.setResponseCode(RC500); res.setResponseMessage(ex.toString()); res.setResponseData((ex.toString() + CRLF + ExceptionUtils.getStackTrace(ex)).getBytes()); } return res; } AbstractIPSampler(); ByteBuffer getRecvBuf(); final String getHostName(); String getPort(); String getRequestData(); String getTimeout(); void setHostName(String text); void setPort(String text); void setRequestData(String text); void setTimeout(String text); @Override SampleResult sample(Entry entry); }
AbstractIPSampler extends AbstractSampler implements Serializable, Cloneable, Interruptible { @Override public SampleResult sample(Entry entry) { SampleResult res = new SampleResult(); res.setSampleLabel(getName()); res.setSamplerData(getRequestData()); res.sampleStart(); res.setDataType(SampleResult.TEXT); res.setSuccessful(true); res.setResponseCode(RC200); try { res.setResponseData(processIO(res)); } catch (Exception ex) { if (!(ex instanceof SocketTimeoutException)) { log.error(getHostName(), ex); } res.sampleEnd(); res.setSuccessful(false); res.setResponseCode(RC500); res.setResponseMessage(ex.toString()); res.setResponseData((ex.toString() + CRLF + ExceptionUtils.getStackTrace(ex)).getBytes()); } return res; } AbstractIPSampler(); ByteBuffer getRecvBuf(); final String getHostName(); String getPort(); String getRequestData(); String getTimeout(); void setHostName(String text); void setPort(String text); void setRequestData(String text); void setTimeout(String text); @Override SampleResult sample(Entry entry); static final String RECV_BUFFER_LEN_PROPERTY; static final String RESULT_DATA_LIMIT; static final String HOSTNAME; static final String PORT; static final String TIMEOUT; static final String DATA; static final String CRLF; static final String EMPTY; static final String RC200; static final String RC500; }