Package org.apache.jmeter.assertions

Examples of org.apache.jmeter.assertions.AssertionResult


    }

    private String getAssertionResult(SampleResult res) {
        if (res != null) {
            StringBuilder display = new StringBuilder();
            AssertionResult assertionResults[] = res.getAssertionResults();
            for (int i = 0; i < assertionResults.length; i++) {
                AssertionResult item = assertionResults[i];

                if (item.isFailure() || item.isError()) {
                    display.append("\n\t"); // $NON-NLS-1$
                    display.append(item.getName() != null ? item.getName() + " : " : "");// $NON-NLS-1$
                    display.append(item.getFailureMessage());
                }
            }
            return display.toString();
        }
        return "";
View Full Code Here


        }
    }

    public static AssertionResult getAssertionResult(Configuration config)
    {
        AssertionResult result = new AssertionResult();
        result.setError(config.getAttributeAsBoolean(ERROR, false));
        result.setFailure(config.getAttributeAsBoolean(FAILURE, false));
        result.setFailureMessage(config.getAttribute(FAILURE_MESSAGE, ""));
        return result;
    }
View Full Code Here

    private String getAssertionResult(SampleResult res)
    {
        if (res != null)
        {
            StringBuffer display = new StringBuffer();
            AssertionResult assertionResults[] = res.getAssertionResults();
            if (assertionResults != null)
            {
                for (int i = 0; i < assertionResults.length; i++)
                {
                    AssertionResult item = assertionResults[i];

                    if (item.isFailure() || item.isError())
                    {
                        display.append("\n\t\t");
                        display.append(item.getFailureMessage());
                    }
                }
            }
            return display.toString();
        }
View Full Code Here

        Iterator iter = assertions.iterator();
        while (iter.hasNext())
        {
          Assertion assertion= (Assertion)iter.next();
          if (assertion instanceof TestBean) ((TestBean)assertion).prepare();
            AssertionResult assertionResult = assertion.getResult(result);
            result.setSuccessful(
                result.isSuccessful()
                    && !(assertionResult.isError() || assertionResult.isFailure()));
            result.addAssertionResult(assertionResult);
        }
    }
View Full Code Here

        }
    }

    public static AssertionResult getAssertionResult(Configuration config)
    {
        AssertionResult result = new AssertionResult();
        result.setError(config.getAttributeAsBoolean(ERROR, false));
        result.setFailure(config.getAttributeAsBoolean(FAILURE, false));
        result.setFailureMessage(config.getAttribute(FAILURE_MESSAGE, ""));
        return result;
    }
View Full Code Here

                }
        }
       
        public static AssertionResult getAssertionResult(Configuration config)
        {
                AssertionResult result = new AssertionResult();
                result.setError(config.getAttributeAsBoolean(ERROR,false));
                result.setFailure(config.getAttributeAsBoolean(FAILURE,false));
                result.setFailureMessage(config.getAttribute(FAILURE_MESSAGE,""));
                return result;         
        }
View Full Code Here

    log.info("stopping "+threadName);
  }
  private void checkAssertions(List assertions, SampleResult result) {
    Iterator iter = assertions.iterator();
    while (iter.hasNext()) {
      AssertionResult assertion = ((Assertion)iter.next()).getResult(result);
      result.setSuccessful(result.isSuccessful() &&
          !(assertion.isError() || assertion.isFailure()));
      result.addAssertionResult(assertion);
    }
  }
View Full Code Here

      if(assertionResults != null)
      {
        Iterator iter = assertionResults.iterator();
        while(iter.hasNext())
        {
          AssertionResult item = (AssertionResult)iter.next();
          if(item.isFailure() || item.isError())
          {
            display.append("\n\t\t");
            display.append(item.getFailureMessage());
          }
        }
      }
      return display.toString();
    }
View Full Code Here

    private String getAssertionResult(SampleResult res)
    {
        if (res != null)
        {
            StringBuffer display = new StringBuffer();
            AssertionResult assertionResults[] = res.getAssertionResults();
            for (int i = 0; i < assertionResults.length; i++)
            {
                AssertionResult item = assertionResults[i];

                if (item.isFailure() || item.isError())
                {
                    display.append("\n\t\t");
                    display.append(item.getFailureMessage());
                }
            }
            return display.toString();
        }
        return "";
View Full Code Here

        Iterator iter = assertions.iterator();
        while (iter.hasNext())
        {
          Assertion assertion= (Assertion)iter.next();
          if (assertion instanceof TestBean) ((TestBean)assertion).prepare();
            AssertionResult assertionResult = assertion.getResult(result);
            result.setSuccessful(
                result.isSuccessful()
                    && !(assertionResult.isError() || assertionResult.isFailure()));
            result.addAssertionResult(assertionResult);
        }
        threadContext.getVariables().put(LAST_SAMPLE_OK,
            JOrphanUtils.booleanToString(result.isSuccessful()));
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.assertions.AssertionResult

Copyright © 2018 www.massapicom. 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.