On 17/10/2007, Juraj Tomasov <[EMAIL PROTECTED]> wrote:
>
> 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);
>     }

Great catch Juraj!

Patch applied with huge thanks!

-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com

Reply via email to