Hi,

I develop a unit to detect if an error has been raised during the parsing of
a file through Camel-bindy. In this unit test, I don't use a template to
produce message as they will be generated by the file endpoint.

        try {
            // cannot be used as we work with a fileEndpoint -->
template.sendBody("direct:start", "");
            fail("Exception has been throwed");
        } catch (CamelExecutionException ex) {
            ...
        }


How can I check the error generated during file parsing (camel-bindy) ?

Here is the route

from(uriFile).unmarshal(oinpDataFormat).to(uriMockResult);

Error to be catched :

2009-09-11 13:53:48,308 DEBUG GenericFileOnCompletion - Done processing
file: GenericFile[OINP_Example-bad_date_format.csv] using exchange:
Exchange[GenericFileMessage with file:
GenericFile[OINP_Example-bad_date_format.csv]]
2009-09-11 13:53:48,308 ERROR GenericFileOnCompletion - Date provided does
not fit the pattern defined, position : 43, line nber : 1
java.lang.IllegalArgumentException: Date provided does not fit the pattern
defined, position : 43, line nber : 1


Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com

Reply via email to