I have encountered improper behavior of this class: warnings, errors and
fatalErrors lists are never cleared, so after unsuccessfull validation every
attempt to validate is 'unsuccessfull' because of not empty above mentioned
lists.

Reset method should look like:

public void reset() {
        warnings.clear();
        errors.clear();
        fatalErrors.clear();
    }

and also ValidationTest should be extended with test scenario like:

public void testValidMessage() throws Exception {
        validEndpoint.expectedMessageCount(1);
        invalidEndpoint.expectedMessageCount(1);

        template.sendBodyAndHeader("direct:start", "<invalid/>", "foo",
"notMatchedHeaderValue");
        template.sendBodyAndHeader("direct:start", "<valid/>", "foo",
"bar");

        MockEndpoint.assertIsSatisfied(validEndpoint, invalidEndpoint);
    }


-- 
View this message in context: 
http://www.nabble.com/org.apache.camel.processor.validation.DefaultValidationErrorHandler-tf4639101s22882.html#a13249847
Sent from the Camel - Development mailing list archive at Nabble.com.

Reply via email to