@Test public void sample() { LOG.info("TestExampleSampler::sample()"); final SampleResult res = exampleSampler.sample(null); assertNotNull(res); final String sampleData = res.getSamplerData(); assertEquals(sampleData, "Example Data"); final String repData = res.getResponseDataAsString(); assertEquals(repData, "REPData"); final String repMsg = res.getResponseMessage(); assertEquals(repMsg, "OK"); }
@Override public SampleResult sample(Entry entry) { if (isDbgEnabled) { LOG.debug("Creating SampleResult"); } SampleResult res = new SampleResult(); res.setSampleLabel(this.getName()); boolean isOK = false; String rep = ""; res.sampleStart(); try { rep = getPropertyAsString(REP_DATA); if (isDbgEnabled) { LOG.debug("ExampleSampler REP_DATA = " + rep); } res.setSamplerData("Example Data"); res.setResponseData(rep, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); isOK = true; } catch (Exception ex) { if (isDbgEnabled) { LOG.debug("", ex); } res.setResponseCode("500"); res.setResponseMessage(ex.toString()); isOK = false; } res.sampleEnd(); res.setSuccessful(isOK); return res; }
ExampleSampler extends AbstractSampler { @Override public SampleResult sample(Entry entry) { if (isDbgEnabled) { LOG.debug("Creating SampleResult"); } SampleResult res = new SampleResult(); res.setSampleLabel(this.getName()); boolean isOK = false; String rep = ""; res.sampleStart(); try { rep = getPropertyAsString(REP_DATA); if (isDbgEnabled) { LOG.debug("ExampleSampler REP_DATA = " + rep); } res.setSamplerData("Example Data"); res.setResponseData(rep, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); isOK = true; } catch (Exception ex) { if (isDbgEnabled) { LOG.debug("", ex); } res.setResponseCode("500"); res.setResponseMessage(ex.toString()); isOK = false; } res.sampleEnd(); res.setSuccessful(isOK); return res; } }
ExampleSampler extends AbstractSampler { @Override public SampleResult sample(Entry entry) { if (isDbgEnabled) { LOG.debug("Creating SampleResult"); } SampleResult res = new SampleResult(); res.setSampleLabel(this.getName()); boolean isOK = false; String rep = ""; res.sampleStart(); try { rep = getPropertyAsString(REP_DATA); if (isDbgEnabled) { LOG.debug("ExampleSampler REP_DATA = " + rep); } res.setSamplerData("Example Data"); res.setResponseData(rep, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); isOK = true; } catch (Exception ex) { if (isDbgEnabled) { LOG.debug("", ex); } res.setResponseCode("500"); res.setResponseMessage(ex.toString()); isOK = false; } res.sampleEnd(); res.setSuccessful(isOK); return res; } ExampleSampler(); }
ExampleSampler extends AbstractSampler { @Override public SampleResult sample(Entry entry) { if (isDbgEnabled) { LOG.debug("Creating SampleResult"); } SampleResult res = new SampleResult(); res.setSampleLabel(this.getName()); boolean isOK = false; String rep = ""; res.sampleStart(); try { rep = getPropertyAsString(REP_DATA); if (isDbgEnabled) { LOG.debug("ExampleSampler REP_DATA = " + rep); } res.setSamplerData("Example Data"); res.setResponseData(rep, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); isOK = true; } catch (Exception ex) { if (isDbgEnabled) { LOG.debug("", ex); } res.setResponseCode("500"); res.setResponseMessage(ex.toString()); isOK = false; } res.sampleEnd(); res.setSuccessful(isOK); return res; } ExampleSampler(); @Override SampleResult sample(Entry entry); }
ExampleSampler extends AbstractSampler { @Override public SampleResult sample(Entry entry) { if (isDbgEnabled) { LOG.debug("Creating SampleResult"); } SampleResult res = new SampleResult(); res.setSampleLabel(this.getName()); boolean isOK = false; String rep = ""; res.sampleStart(); try { rep = getPropertyAsString(REP_DATA); if (isDbgEnabled) { LOG.debug("ExampleSampler REP_DATA = " + rep); } res.setSamplerData("Example Data"); res.setResponseData(rep, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); isOK = true; } catch (Exception ex) { if (isDbgEnabled) { LOG.debug("", ex); } res.setResponseCode("500"); res.setResponseMessage(ex.toString()); isOK = false; } res.sampleEnd(); res.setSuccessful(isOK); return res; } ExampleSampler(); @Override SampleResult sample(Entry entry); static final String REP_DATA; }