Package org.apache.jmeter.samplers

Examples of org.apache.jmeter.samplers.SampleResult.sampleEnd()


            result.setSampleCount(loop);
            result.setRequestHeaders(propBuffer.toString());
        } catch (Exception e) {
            result.setResponseMessage(e.toString());
        } finally {
            result.sampleEnd();           
        }
        return result;
    }

    private Map<String, Object> getMapContent() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
View Full Code Here


        } catch (Exception e) {
            LOG.error("JavaTest: error during sample", e);
            results.setSuccessful(false);
        } finally {
            // Record end time and populate the results.
            results.sampleEnd();
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug(whoAmI() + "\trunTest()" + "\tTime:\t" + results.getTime());
            listParameters(context);
View Full Code Here

        } catch (Exception e) {
            LOG.error("SleepTest: error during sample", e);
            results.setSuccessful(false);
            results.setResponseMessage(e.toString());
        } finally {
            results.sampleEnd();
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug(whoAmI() + "\trunTest()" + "\tTime:\t" + results.getTime());
            listParameters(context);
View Full Code Here

        SampleResult result = new SampleResult();
        result.setDataType(SampleResult.TEXT);
        result.setSampleLabel(getName());
        result.sampleStart();
        if (exceptionDuringInit != null) {
            result.sampleEnd();
            result.setSuccessful(false);
            result.setResponseCode("000");
            result.setResponseMessage(exceptionDuringInit.toString());
            return result;
        }
View Full Code Here

            } catch (JMSException e) {
                log.warn("Error "+e.toString());
            }
            now = System.currentTimeMillis();
        }
        result.sampleEnd();
        result.setResponseMessage(read + " samples messages received");
        if (getReadResponseAsBoolean()) {
            result.setResponseData(buffer.toString().getBytes()); // TODO - charset?
        } else {
            result.setBytes(buffer.toString().getBytes().length); // TODO - charset?
View Full Code Here

                res.setResponseMessage(thrown.toString());
            } else {               
                res.setResponseMessage(e.getLocalizedMessage());
            }
        }
        res.sampleEnd();
        return res;
    }

    private TextMessage createMessage() throws JMSException {
        if (session == null) {
View Full Code Here

                        m.invoke(theClazz,new Class[0]);
                    }
                };
                tr.runProtected(theClazz, p);
                tr.endTest(this.TEST_INSTANCE);
                sresult.sampleEnd();
               
                if (!getDoNotSetUpTearDown() && TDOWN_METHOD != null){
                    TDOWN_METHOD.invoke(TEST_INSTANCE,new Class[0]);
                }
            } catch (InvocationTargetException e) {
View Full Code Here

      log.warn("Problem evaluating the script", ex);
      res.setSuccessful(false);
      res.setResponseCode("500"); // $NON-NLS-1$
      res.setResponseMessage(ex.toString());
    } finally {
      res.sampleEnd();
      IOUtils.closeQuietly(is);
// Will be done by mgr.terminate() anyway
//      if (bsfEngine != null) {
//          bsfEngine.terminate();
//      }
View Full Code Here

        res.setSamplerData(myStringProperty);
        res.sampleStart();
        // Do something ...
        res.setResponseData(myStringProperty.toUpperCase().getBytes());
        res.setDataType(SampleResult.TEXT);
        res.sampleEnd();
        res.setSuccessful(true);
        return res;
  }
    private String myStringProperty;
   
View Full Code Here

      for (int idx = 0; idx < loop; idx++) {
        String tmsg = this.getMessageContent();
        this.PUB.publish(tmsg);
        this.BUFFER.append(tmsg);
      }
      result.sampleEnd();
      String content = this.BUFFER.toString();
      result.setBytes(content.getBytes().length);
      result.setResponseCode("message published successfully");
      result.setResponseMessage(loop + " messages published");
      result.setSuccessful(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.