Package org.apache.jmeter.samplers

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


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

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


      if (st != null && st.receive() != null) {
        br = st.receive();
        if (getReadResponse()) {
          StringWriter sw = new StringWriter();
          IOUtils.copy(br, sw);
          result.sampleEnd();
          // set the response
          result.setResponseData(sw.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
View Full Code Here

        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          result.sampleEnd();
          result.setResponseData(JMeterUtils.getResString("read_response_message").getBytes()); //$NON-NLS-1$
        }
        result.setSuccessful(true);
        result.setResponseCodeOK();
        result.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
View Full Code Here

        }
        result.setSuccessful(true);
        result.setResponseCodeOK();
        result.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        result.sampleEnd();
        result.setSuccessful(false);
        if (st != null){
            result.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        }
        result.setResponseHeaders("error");
View Full Code Here

        try {
          res.sampleStart();
          cmp = temp_client.compare(dirContext, getPropertyAsString(COMPAREFILT),
              getPropertyAsString(COMPAREDN));
        } finally {
          res.sampleEnd();
        }       
        if (!cmp.hasMore()) {
          res.setResponseCode("5"); // $NON-NLS-1$
          res.setResponseMessage("compareFalse");
          isSuccessful = false;
View Full Code Here

              getTimelimAsInt(),
              getRequestAttributes(getAttrs()),
              isRetobj(),
              isDeref());
        } finally {
          res.sampleEnd();
        }       

                if (isParseFlag()) {
          try {
            xmlBuffer.openTag("searchresults"); // $NON-NLS-1$
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

    } finally {
      close(stmt);
      close(conn);
    }

    res.sampleEnd();
    return res;
  }

  private String resultSetsToString(PreparedStatement pstmt, boolean result) throws SQLException {
    StringBuffer sb = new StringBuffer();
View Full Code Here

    } catch (Exception e) {
      LOGGER.warn(e.getLocalizedMessage(), e);
      res.setResponseData(new byte[0]);
      res.setSuccessful(false);
    }
    res.sampleEnd();
    return res;
  }

  private TextMessage createMessage() throws JMSException {
    if (session == null) {
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.