Search in sources :

Example 21 with NotifyBuilder

use of org.apache.camel.builder.NotifyBuilder in project camel by apache.

the class ZipkinSimpleFallbackRouteTest method testZipkinRoute.

@Test
public void testZipkinRoute() throws Exception {
    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    for (int i = 0; i < 5; i++) {
        template.sendBody("seda:dude", "Hello World");
    }
    assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Also used : NotifyBuilder(org.apache.camel.builder.NotifyBuilder) Test(org.junit.Test)

Example 22 with NotifyBuilder

use of org.apache.camel.builder.NotifyBuilder in project camel by apache.

the class ZipkinSimpleLogStreamsRouteTest method testZipkinRoute.

@Test
public void testZipkinRoute() throws Exception {
    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    for (int i = 0; i < 5; i++) {
        template.sendBody("seda:dude", "Hello World");
    }
    assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Also used : NotifyBuilder(org.apache.camel.builder.NotifyBuilder) Test(org.junit.Test)

Example 23 with NotifyBuilder

use of org.apache.camel.builder.NotifyBuilder in project camel by apache.

the class ZipkinSimpleRouteTest method testZipkinRoute.

@Test
public void testZipkinRoute() throws Exception {
    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    for (int i = 0; i < 5; i++) {
        template.sendBody("seda:dude", "Hello World");
    }
    assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Also used : NotifyBuilder(org.apache.camel.builder.NotifyBuilder) Test(org.junit.Test)

Example 24 with NotifyBuilder

use of org.apache.camel.builder.NotifyBuilder in project camel by apache.

the class ManagedZipkinSimpleRouteTest method testZipkinRoute.

@Test
public void testZipkinRoute() throws Exception {
    // JMX tests dont work well on AIX CI servers (hangs them)
    if (isPlatform("aix")) {
        return;
    }
    MBeanServer mbeanServer = getMBeanServer();
    ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=services,name=ZipkinTracer");
    assertNotNull(on);
    assertTrue(mbeanServer.isRegistered(on));
    Float rate = (Float) mbeanServer.getAttribute(on, "Rate");
    assertEquals("Should be 1.0f", 1.0f, rate.floatValue(), 0.1f);
    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    for (int i = 0; i < 5; i++) {
        template.sendBody("seda:dude", "Hello World");
    }
    assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Also used : NotifyBuilder(org.apache.camel.builder.NotifyBuilder) MBeanServer(javax.management.MBeanServer) ObjectName(javax.management.ObjectName) Test(org.junit.Test)

Example 25 with NotifyBuilder

use of org.apache.camel.builder.NotifyBuilder in project camel by apache.

the class SpringZipkinSimpleRouteTest method testZipkinRoute.

@Test
public void testZipkinRoute() throws Exception {
    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
    for (int i = 0; i < 5; i++) {
        template.sendBody("direct:start", "Hello World");
    }
    assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Also used : NotifyBuilder(org.apache.camel.builder.NotifyBuilder) Test(org.junit.Test)

Aggregations

NotifyBuilder (org.apache.camel.builder.NotifyBuilder)109 Test (org.junit.Test)72 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)30 File (java.io.File)24 Exchange (org.apache.camel.Exchange)10 RouteBuilder (org.apache.camel.builder.RouteBuilder)9 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 HashSet (java.util.HashSet)4 MBeanServer (javax.management.MBeanServer)4 ObjectName (javax.management.ObjectName)4 Processor (org.apache.camel.Processor)4 StopWatch (org.apache.camel.util.StopWatch)4 ConnectException (java.net.ConnectException)3 ExecutorService (java.util.concurrent.ExecutorService)3 Ignore (org.junit.Ignore)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Future (java.util.concurrent.Future)2 ZipFile (java.util.zip.ZipFile)2