use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class MarkerFileExclusiveReadLockStrategyUnlockTest method testUnlocking.
public void testUnlocking() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
writeFiles();
boolean done = notify.matches(5, TimeUnit.SECONDS);
assertTrue("Route should be done processing 1 exchanges", done);
assertFileNotExists("target/marker-unlock/input-a/file1.dat.camelLock");
assertFileNotExists("target/marker-unlock/input-b/file2.dat.camelLock");
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class SedaUnitOfWorkTest method testSedaUOWWithException.
public void testSedaUOWWithException() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();
template.sendBodyAndHeader("direct:start", "Hello World", "kaboom", "yes");
notify.matchesMockWaitTime();
assertEquals("onFailureA", sync);
assertEquals("onFailureA", lastOne);
assertEquals("Should have propagated the header inside the Synchronization.onFailure() callback", "yes", kaboom);
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class SedaUnitOfWorkTest method testSedaUOW.
public void testSedaUOW() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
template.sendBodyAndHeader("direct:start", "Hello World", "foo", "bar");
assertMockEndpointsSatisfied();
notify.matchesMockWaitTime();
assertEquals("onCompleteA", sync);
assertEquals("onCompleteA", lastOne);
assertEquals("Should have propagated the header inside the Synchronization.onComplete() callback", "bar", foo);
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipDataFormatFileUnmarshalDeleteTest method testZipFileUnmarshalDelete.
public void testZipFileUnmarshalDelete() throws Exception {
// there are 2 exchanges
NotifyBuilder event = event().whenDone(2).create();
getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
template.sendBodyAndHeader("file:target/zip", "Hello World", Exchange.FILE_NAME, "hello.txt");
assertMockEndpointsSatisfied();
event.matchesMockWaitTime();
File in = new File("target/zip/hello.txt");
assertFalse("Should have been deleted " + in, in.exists());
File out = new File("target/zip/out/hello.txt.zip");
assertFalse("Should have been deleted " + out, out.exists());
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class GzipDataFormatFileUnmarshalDeleteTest method testGzipFileUnmarshalDelete.
public void testGzipFileUnmarshalDelete() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();
getMockEndpoint("mock:result").expectedBodiesReceived("Hello World");
template.sendBodyAndHeader("file:target/gzip", "Hello World", Exchange.FILE_NAME, "hello.txt");
assertMockEndpointsSatisfied();
notify.matchesMockWaitTime();
File in = new File("target/gzip/hello.txt");
assertFalse("Should have been deleted " + in, in.exists());
File out = new File("target/gzip/out/hello.txt.gz");
assertFalse("Should have been deleted " + out, out.exists());
}
Aggregations