Package org.apache.jmeter.samplers

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


        Thread.sleep(0, 50);
      } catch (Exception e) {
        log.info(e.getMessage());
      }
    }
    result.sampleEnd();
    result.setResponseMessage(loop + " samples messages recieved");
    if (this.getReadResponseAsBoolean()) {
      result.setResponseData(this.BUFFER.toString().getBytes());
    } else {
      result.setBytes(this.BUFFER.toString().getBytes().length);
View Full Code Here


        Thread.sleep(0, 50);
      } catch (Exception e) {
        log.info(e.getMessage());
      }
    }
    result.sampleEnd();
    result.setResponseMessage(loop + " samples messages recieved");
    if (this.getReadResponseAsBoolean()) {
      result.setResponseData(this.SUBSCRIBER.getMessage().getBytes());
    } else {
      result.setBytes(this.SUBSCRIBER.getMessage().getBytes().length);
View Full Code Here

            isSuccessful=setupSampleResult(res, "", ex, protocolHandler.getCharset());
            closeSocket(socketKey);
        } finally {
            currentSocket = null;
            // Calculate response time
            res.sampleEnd();

            // Set if we were successful or not
            res.setSuccessful(isSuccessful);

            if (!isReUseConnection()) {
View Full Code Here

        } catch (Exception ex) {
            log.debug("", ex);
            res.setResponseCode("500");// $NON-NLS-1$
            res.setResponseMessage(ex.toString());
        }
        res.sampleEnd(); // End timimg

        res.setSuccessful(isOK);

        return res;
    }
View Full Code Here

        } finally {
            close(conn);
        }

        // TODO: process warnings? Set Code and Message to success?
        res.sampleEnd();
        return res;
    }

    /**
     * @see org.apache.jmeter.samplers.AbstractSampler#applies(org.apache.jmeter.config.ConfigTestElement)
View Full Code Here

                result.setEncodingAndType(contentType);
                int length=0;
                if (getReadResponse()) {
                    StringWriter sw = new StringWriter();
                    length=IOUtils.copy(br, sw);
                    result.sampleEnd();
                    result.setResponseData(sw.toString().getBytes(result.getDataEncodingWithDefault()));
                } else {
                    // by not reading the response
                    // for real, it improves the
                    // performance on slow clients
View Full Code Here

                } else {
                    // by not reading the response
                    // for real, it improves the
                    // performance on slow clients
                    length=br.read();
                    result.sampleEnd();
                    result.setResponseData(JMeterUtils.getResString("read_response_message"), null); //$NON-NLS-1$
                }
                // It is not possible to access the actual HTTP response code, so we assume no data means failure
                if (length > 0){
                    result.setSuccessful(true);
View Full Code Here

                    result.setSuccessful(false);
                    result.setResponseCode("999");
                    result.setResponseMessage("Empty response");
                }
            } else {
                result.sampleEnd();
                result.setSuccessful(false);
                final String contentType = spconn.getResponseSOAPContext().getContentType();
                result.setContentType(contentType);
                result.setEncodingAndType(contentType);
                result.setResponseData(spconn.getResponseSOAPContext().toString().getBytes(result.getDataEncodingWithDefault()));
View Full Code Here

            {
                result.sampleStart();
            }
            if (result.getEndTime() == 0)
            {
                result.sampleEnd();
            }
        }
        return result;
    }
View Full Code Here

            } else {
                res.setResponseMessage("Other Exception: " + ex.toString());
            }
        }

        res.sampleEnd();

        try {
            // process the sampler result
            InputStream is = message.getInputStream();
            StringBuilder sb = new StringBuilder();
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.