Package org.apache.jmeter.samplers

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


        res.setSamplerData(myStringProperty);
        res.sampleStart();
        // Do something ...
        res.setResponseData(myStringProperty.toLowerCase().getBytes());
        res.setDataType(SampleResult.TEXT);
        res.sampleEnd();
        res.setSuccessful(true);
        return res;
  }

    private String myStringProperty;
View Full Code Here


              child.setResponseData(cdata.toString().getBytes());
              child.setDataType(SampleResult.TEXT);
              child.setResponseCodeOK();
              child.setResponseMessage("OK"); // $NON-NLS-1$
              child.setSuccessful(true);
              child.sampleEnd();
              parent.addSubResult(child);
      }

      // Close connection
      folder.close(true);
View Full Code Here

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

    res.sampleEnd();
    return res;
  }
}
View Full Code Here

    boolean isSuccessful = false;
    res.setSampleLabel(getLabel());
    res.sampleStart();
    final BeanShellInterpreter bshInterpreter = getBeanShellInterpreter();
    if (bshInterpreter == null) {
      res.sampleEnd();
      res.setResponseCode("503");//$NON-NLS-1$
      res.setResponseMessage("BeanShell Interpreter not found");
      res.setSuccessful(false);
      return res;
    }
View Full Code Here

      log.warn(ex.toString());
      res.setResponseCode("500");//$NON-NLS-1$
      res.setResponseMessage(ex.toString());
    }

    res.sampleEnd();

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

    return res;
View Full Code Here

      close(stmt);
      close(conn);
    }

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

  private String resultSetsToString(PreparedStatement pstmt, boolean result, int[] out) throws SQLException {
    StrBuilder sb = new StrBuilder();
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

       
        res.setResponseData(sb.toString().getBytes());
        res.setDataType(SampleResult.TEXT);
        res.setSamplerData(rd.toString());
        res.setSuccessful(true);
        res.sampleEnd();
        return res;
  }

  private void formatSet(StringBuffer sb, Set s) {
    ArrayList al = new ArrayList(s);
View Full Code Here

      res.setResponseCode("500");
      res.setResponseMessage(ex.toString());
            closeSocket();
    } finally {
        // Calculate response time
        res.sampleEnd();
   
        // Set if we were successful or not
        res.setSuccessful(isSuccessful);

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

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

    if (getLogger().isDebugEnabled()) {
      getLogger().debug(whoAmI() + "\trunTest()" + "\tTime:\t" + results.getTime());
      listParameters(context);
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.