Search in sources :

Example 11 with JMeterError

use of org.apache.jorphan.util.JMeterError in project jmeter by apache.

the class JMeterThread method processAssertion.

private void processAssertion(SampleResult result, Assertion assertion) {
    AssertionResult assertionResult;
    try {
        assertionResult = assertion.getResult(result);
    } catch (ThreadDeath e) {
        throw e;
    } catch (JMeterError e) {
        log.error("Error processing Assertion.", e);
        assertionResult = new AssertionResult("Assertion failed! See log file.");
        assertionResult.setError(true);
        assertionResult.setFailureMessage(e.toString());
    } catch (Exception e) {
        log.error("Exception processing Assertion.", e);
        assertionResult = new AssertionResult("Assertion failed! See log file.");
        assertionResult.setError(true);
        assertionResult.setFailureMessage(e.toString());
    }
    result.setSuccessful(result.isSuccessful() && !(assertionResult.isError() || assertionResult.isFailure()));
    result.addAssertionResult(assertionResult);
}
Also used : AssertionResult(org.apache.jmeter.assertions.AssertionResult) JMeterError(org.apache.jorphan.util.JMeterError) JMeterStopTestException(org.apache.jorphan.util.JMeterStopTestException) JMeterStopThreadException(org.apache.jorphan.util.JMeterStopThreadException) JMeterStopTestNowException(org.apache.jorphan.util.JMeterStopTestNowException)

Aggregations

JMeterError (org.apache.jorphan.util.JMeterError)11 IOException (java.io.IOException)4 FileInputStream (java.io.FileInputStream)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Map (java.util.Map)2 Properties (java.util.Properties)2 AssertionResult (org.apache.jmeter.assertions.AssertionResult)2 SampleResult (org.apache.jmeter.samplers.SampleResult)2 JMeterStopTestException (org.apache.jorphan.util.JMeterStopTestException)2 JMeterStopTestNowException (org.apache.jorphan.util.JMeterStopTestNowException)2 JMeterStopThreadException (org.apache.jorphan.util.JMeterStopThreadException)2 Component (java.awt.Component)1 BufferedInputStream (java.io.BufferedInputStream)1 BufferedReader (java.io.BufferedReader)1 EOFException (java.io.EOFException)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1 ObjectInputStream (java.io.ObjectInputStream)1