Package org.apache.camel.builder

Examples of org.apache.camel.builder.NotifyBuilder.matches()


    // disabled due manual test
    public void xxxtestSplitParallelBigFile() throws Exception {
        StopWatch watch = new StopWatch();

        NotifyBuilder builder = new NotifyBuilder(context).whenDone(lines + 1).create();
        boolean done = builder.matches(120, TimeUnit.SECONDS);

        log.info("Took " + TimeUtils.printDuration(watch.stop()));

        if (!done) {
            throw new CamelException("Could not split file in 2 minutes");
View Full Code Here


        template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "fail");

        assertMockEndpointsSatisfied();

        // wait until its done before we stop and check that retry was invoked
        boolean matches = event.matches(10, TimeUnit.SECONDS);
        assertTrue(matches);

        context.stop();

        assertEquals(3, invoked.get());
View Full Code Here

        template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "fail,direct:foo");

        assertMockEndpointsSatisfied();

        // wait until its done before we stop and check that retry was invoked
        boolean matches = event.matches(10, TimeUnit.SECONDS);
        assertTrue(matches);

        context.stop();

        assertEquals(3, invoked.get());
View Full Code Here

        NotifyBuilder notify = new NotifyBuilder(context).whenExactlyDone(1).create();

        log.debug("------------Beginning CacheProducer Add Test---------------");
        sendOriginalFile();

        notify.matches(10, TimeUnit.SECONDS);
        assertNotNull(fetchElement("10"));
    }

    @Test
    public void testAddingDataElementEternal() throws Exception {
View Full Code Here

        for (int i = 0; i < 10; i++) {
            template.sendBody("seda:throttleCount", "Message " + i);
        }

        assertTrue(notifier.matches(2, TimeUnit.SECONDS));
        Integer throttledMessages = (Integer) mbeanServer.getAttribute(throttlerName, "ThrottledCount");

        // we are expecting this to be > 0
        assertTrue(throttledMessages.intValue() > 0);
View Full Code Here

        for (int i = 0; i < 10; i++) {
            template.sendBody("seda:throttleCountAsync", "Message " + i);
        }

        assertTrue(notifier.matches(2, TimeUnit.SECONDS));
        Integer throttledMessages = (Integer) mbeanServer.getAttribute(throttlerName, "ThrottledCount");

        // we are expecting this to be > 0
        assertTrue(throttledMessages.intValue() > 0);
View Full Code Here

        for (int i = 0; i < 10; i++) {
            template.sendBody("seda:throttleCountAsyncException", "Message " + i);
        }

        assertTrue(notifier.matches(2, TimeUnit.SECONDS));
        Integer throttledMessages = (Integer) mbeanServer.getAttribute(throttlerName, "ThrottledCount");

        // we are expecting this to be > 0
        assertTrue(throttledMessages.intValue() > 0);
View Full Code Here

        getMockEndpoint("mock:file").expectedBodiesReceived("Hello World");

        template.sendBodyAndHeader(endpoint, "Hello World", Exchange.FILE_NAME, "hello.txt");
        assertMockEndpointsSatisfied();

        oneExchangeDone.matches(5, TimeUnit.SECONDS);

        resetMocks();
        getMockEndpoint("mock:file").expectedBodiesReceived("Hello World Again");

        template.sendBodyAndHeader(endpoint, "Hello World Again", Exchange.FILE_NAME, "hello.txt");
View Full Code Here

        NotifyBuilder builder = new NotifyBuilder(context).whenDone(1).create();

        String out = template.requestBody("http://localhost:{{port}}/myserver", body, String.class);
        assertEquals(body2, out);

        assertTrue(builder.matches(5, TimeUnit.SECONDS));

        // the temporary files should have been deleted
        File file = new File("target/cachedir");
        String[] files = file.list();
        assertEquals("There should be no files", 0, files.length);
View Full Code Here

                }
            });
            responses.put(index, out);
        }

        notify.matches(2, TimeUnit.MINUTES);
        log.info("Took " + watch.taken() + " millis to process " + files + " messages using " + poolSize + " client threads.");
        assertEquals(files, responses.size());

        // get all responses
        Set<String> unique = new HashSet<String>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.