Package org.apache.camel.builder

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


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

        assertTrue(notify.matchesMockWaitTime());

        int inflight = context.getInflightRepository().size();
        assertEquals(0, inflight);
    }
View Full Code Here


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

        assertTrue(notify.matchesMockWaitTime());

        int inflight = context.getInflightRepository().size();
        assertEquals(0, inflight);
    }
View Full Code Here

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

        assertTrue(notify.matchesMockWaitTime());

        int inflight = context.getInflightRepository().size();
        assertEquals(0, inflight);
    }
View Full Code Here

        // should be 1 completed and 1 failed
        NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();

        template.sendBody("activemq:queue:foo", "blah");

        notify.matchesMockWaitTime();

        assertTrue("Expected only 2 calls to process() (1 failure, 1 success) but encountered "
                   + getConditionalExceptionProcessor().getCount() + "."
                   , getConditionalExceptionProcessor().getCount() == 2);
    }
View Full Code Here

    public void testJmsInOnlyHttpPostIssue() throws Exception {
        NotifyBuilder notify = new NotifyBuilder(context).whenCompleted(1).from("jms*").create();

        template.sendBody("jms:queue:in", "Hello World");

        assertTrue("Should complete the JMS route", notify.matchesMockWaitTime());
    }

    @Test
    public void testJmsInOutHttpPostIssue() throws Exception {
        String out = template.requestBody("jms:queue:in", "Hello World", String.class);
View Full Code Here

        template.sendBodyAndHeader("file://target/file2file/in", "Hello World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();

        notify.matchesMockWaitTime();

        File file = new File("./target/file2file/out/hello.txt");
        file = file.getAbsoluteFile();
        assertTrue("The file should exists", file.exists());
    }
View Full Code Here

        NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();

        ProducerTemplate template = camelContext.createProducerTemplate();
        template.sendBody("seda:foo", "test");

        notify.matchesMockWaitTime();

        exchangesCompleted = statistics.getRouteStatistic(camelContext, list.get(0).getId(), "ExchangesCompleted");
        assertEquals("JMX value incorrect, should be 1", new Long(1), exchangesCompleted);
    }
View Full Code Here

        for (int i = 0; i < 10; ++i) {
            template.sendBodyAndHeader("file://target/file-batch1/", "CIAO", "CamelFileName", "CIAO" + i);
        }

        Assert.assertTrue("Timeout waiting for match" + nb.toString(), nb.matchesMockWaitTime());
        context.stop();

        InputStream in = null;
        try {
            in = new URL("file:///" + file.toUri()).openStream();
View Full Code Here

        for (int i = 0; i < 10; ++i) {
            template.sendBodyAndHeader("file://target/file-batch2", "CIAO", "CamelFileName", "CIAO" + i);
        }

        Assert.assertTrue("Timeout waiting for match" + nb.toString(), nb.matchesMockWaitTime());
        context.stop();

        Configuration conf = new Configuration();
        Path file1 = new Path("file:///" + file.toUri());
        FileSystem fs1 = FileSystem.get(file1.toUri(), conf);
View Full Code Here

        for (int i = 0; i < 10; ++i) {
            template.sendBodyAndHeader("file://target/file-batch3", "CIAO", "CamelFileName", "CIAO" + i);
        }

        Assert.assertTrue("Timeout waiting for match" + nb.toString(), nb.matchesMockWaitTime());
        context.stop();

        Configuration conf = new Configuration();
        Path file1 = new Path("file:///" + file.toUri());
        FileSystem fs1 = FileSystem.get(file1.toUri(), conf);
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.