Package org.apache.jmeter.samplers

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


    SampleResult res = new SampleResult();
    boolean isSuccessful = false;
    res.setSampleLabel(getName());// Use the test element name for the
                    // label
    res.setSamplerData("Host: " + getServer() + " Port: " + getPort());
    res.sampleStart();
    try {
      Socket sock = getSocket();
      if (sock == null) {
        res.setResponseCode("500");
        res.setResponseMessage(getError());
View Full Code Here


      results.setResponseData(resultData.getBytes());
      results.setDataType(SampleResult.TEXT);
    }

    // Record sample start time.
    results.sampleStart();

    long sleep = sleepTime;
    if (sleepTime > 0 && sleepMask > 0) { // / Only do the calculation if
                        // it is needed
      long start = System.currentTimeMillis();
View Full Code Here

  public SampleResult runTest(JavaSamplerContext context) {
    SampleResult results = new SampleResult();

    try {
      // Record sample start time.
      results.sampleStart();

      // Generate a random value using the current time.
      long start = System.currentTimeMillis();
      long sleep = getSleepTime() + (start % getSleepMask());
View Full Code Here

        throw new SOAPException("Could not create document", null);
      }
      Envelope msgEnv = Envelope.unmarshall(rdoc);
      // create a new message
      Message msg = new Message();
      result.sampleStart();
      SOAPHTTPConnection spconn = null;
      // if a blank HeaderManager exists, try to
      // get the SOAPHTTPConnection. After the first
      // request, there should be a connection object
      // stored with the cookie header info.
View Full Code Here

                + getPropertyAsString(COMPAREDN));
        xmlBuffer.tag("comparedn",getPropertyAsString(COMPAREDN)); // $NON-NLS-1$
        xmlBuffer.tag("comparefilter",getPropertyAsString(COMPAREFILT)); // $NON-NLS-1$
                NamingEnumeration cmp;
        try {
          res.sampleStart();
          cmp = temp_client.compare(dirContext, getPropertyAsString(COMPAREFILT),
              getPropertyAsString(COMPAREDN));
        } finally {
          res.sampleEnd();
        }       
View Full Code Here

        xmlBuffer.tag("countlimit",countLimit); // $NON-NLS-1$
        xmlBuffer.tag("timelimit",timeLimit); // $NON-NLS-1$

                NamingEnumeration srch;
        try {
          res.sampleStart();
          srch = temp_client.searchTest(
              dirContext, searchBase, searchFilter,
              scope, getCountlimAsLong(),
              getTimelimAsInt(),
              getRequestAttributes(getAttrs()),
View Full Code Here

        SampleResult res = new SampleResult();
        res.setSampleLabel(getName());
        res.setSamplerData(getContent());
        res.setSuccessful(false); // Assume failure
        res.setDataType(SampleResult.TEXT);
        res.sampleStart();

        try {
            TextMessage msg = createMessage();
            if (isOneway()) {
                producer.send(msg);
View Full Code Here

        // Assume we will be successful
        res.setSuccessful(true);


    res.sampleStart();
    DataSourceComponent pool = (DataSourceComponent) getThreadContext().getVariables().getObject(getDataSource());
    log.debug("DataSourceComponent: " + pool);
    Connection conn = null;
    Statement stmt = null;
View Full Code Here

  public SampleResult sample(Entry entry) {
    SampleResult res = new SampleResult();
    res.setSampleLabel(getName());
    res.setSamplerData(getContent());
    res.setDataType(SampleResult.TEXT);
    res.sampleStart();

    try {
      TextMessage msg = createMessage();

      if (isOneway()) {
View Full Code Here

    if (this.PUB == null) {
      this.initClient();
    }
    int loop = this.getIterationCount();
    if (this.PUB != null) {
      result.sampleStart();
      for (int idx = 0; idx < loop; idx++) {
        String tmsg = this.getMessageContent();
        this.PUB.publish(tmsg);
        this.BUFFER.append(tmsg);
      }
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.