Search in sources :

Example 1 with InvalidExpressionException

use of org.mule.runtime.core.api.expression.InvalidExpressionException in project mule by mulesoft.

the class AssertionMessageProcessor method start.

@Override
public void start() throws InitialisationException {
    ValidationResult result = this.expressionManager.validate(expression);
    if (!result.isSuccess()) {
        throw new InvalidExpressionException(expression, result.errorMessage().orElse("Invalid exception"));
    }
    latch = new CountDownLatch(count);
    addAssertion(getRootContainerLocation().toString(), this);
}
Also used : InvalidExpressionException(org.mule.runtime.core.api.expression.InvalidExpressionException) ValidationResult(org.mule.runtime.api.el.ValidationResult) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 2 with InvalidExpressionException

use of org.mule.runtime.core.api.expression.InvalidExpressionException in project mule by mulesoft.

the class ResponseAssertionMessageProcessor method start.

@Override
public void start() throws InitialisationException {
    super.start();
    ValidationResult result = this.expressionManager.validate(responseExpression);
    if (!result.isSuccess()) {
        throw new InvalidExpressionException(expression, result.errorMessage().orElse("Invalid expression"));
    }
    responseLatch = new CountDownLatch(responseCount);
    addAssertion(getLocation().getRootContainerName(), this);
}
Also used : InvalidExpressionException(org.mule.runtime.core.api.expression.InvalidExpressionException) ValidationResult(org.mule.runtime.api.el.ValidationResult) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)2 ValidationResult (org.mule.runtime.api.el.ValidationResult)2 InvalidExpressionException (org.mule.runtime.core.api.expression.InvalidExpressionException)2