Package org.apache.jmeter.samplers

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


                int returnCode = nativeCommand.run(cmds);
                if(log.isDebugEnabled()) {
                    log.debug("Ran :"+cmdLine + " using working directory:"+directory.getAbsolutePath()+
                            " with execution environment:"+nativeCommand.getExecutionEnvironment());
                }
                results.sampleEnd();

                if (checkReturnCode && (returnCode != expectedReturnCode)) {
                    results.setSuccessful(false);
                    responseData = "System did not return expected return code.  Expected ["+expectedReturnCode+"]. Returned ["+returnCode+"].";
                    results.setSampleLabel("FAILED: " + getName());
View Full Code Here


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

View Full Code Here

            }
            IOUtils.closeQuietly(input);
            IOUtils.closeQuietly(output);
        }

        res.sampleEnd();
        return res;
    }

    /** {@inheritDoc} */
    public boolean interrupt() {
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

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

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

                        res.setResponseCode("5"); // $NON-NLS-1$
                        res.setResponseMessage("compareFalse");
                        isSuccessful = false;
                    }
                } finally {
                    res.sampleEnd();
                    if (cmp != null) {
                        cmp.close();
                    }
                }
            } else if (testType.equals(ADD)) {
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

                    }
                } finally {
                    if (srch != null){
                        srch.close();
                    }
                    res.sampleEnd();
                }

            }

        } catch (NamingException ex) {
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

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.