Hi Just check that there is a new file in the backup folder. And its file content is as expected.
On Tue, Apr 13, 2010 at 11:06 AM, ankelee <[email protected]> wrote: > > Hello > > Using Camel 2.3.0 SNAPSHOT I've made a route where I use a wireTap to back > up any incoming files and timestamp the filename like so: > > from("file://" + props.getProperty("directory.incoming")) > .routeId("processing") > > .setHeader("backupFileName").simple("${date:now:yyyyMMddHH}/${file:name}.bak") > .wireTap("file://" + > props.getProperty("directory.incoming.backup")+ > "?fileName=${in.header.backupFileName}")...and so on. > > I want to test that the backups are created and would like to do something > like this: > > String filename; > RouteDefinition route = > context.getRouteDefinition("processing"); > route.adviceWith(new RouteBuilder() { > public void configure() throws Exception { > intercept().process(new Processor() { > �...@override > public void process(Exchange ex) > throws Exception { > filename = > ex.getIn().getHeader("backupFileName", String.class); > } > }); > } > }); > > Obviously this doesn't work since 'filename' is out of scope for the > Processor. Can I access the header using normal Java or do you have any > ideas how to do this? Maybe I have to reconsider how to test the backup > part? > -- > View this message in context: > http://old.nabble.com/Testing-and-dynamic-filenames.-tp28221755p28221755.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
