Examples of sendBodyAndHeader()


Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

       
        String expectedBody = "<matched/>";

        resultEndpoint.expectedBodiesReceived(expectedBody);

        template.sendBodyAndHeader("direct:start", expectedBody, "foo", "bar");

        resultEndpoint.assertIsSatisfied();
       
        resultEndpoint.reset();
       
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

       
        resultEndpoint.reset();
       
        resultEndpoint.expectedMessageCount(0);

        template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo", "notMatchedHeaderValue");

        resultEndpoint.assertIsSatisfied();
    }

}
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

    private void validMockes() throws Exception {
        assertNotNull(resultEndpoint);
        resultEndpoint.reset();       

        ProducerTemplate template = camelContext.createProducerTemplate();
        template.sendBodyAndHeader("jetty:http://localhost:9000/test", "Hello form Willem", "Operation", "greetMe");

        // Sleep a while and wait for the message whole processing
        Thread.sleep(4000);
        template.stop();
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        template.sendBodyAndHeader("direct:start", expectedBody, "foo", "bar");
        resultEndpoint.assertIsSatisfied();
       
        resultEndpoint.reset();
        resultEndpoint.expectedMessageCount(0);
        template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo", "notMatchedHeaderValue");
        resultEndpoint.assertIsSatisfied();
    }

}
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        MockEndpoint resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class);
        ProducerTemplate template = context.createProducerTemplate();
       
        String expectedBody = "<matched/>";
        resultEndpoint.expectedBodiesReceived(expectedBody);
        template.sendBodyAndHeader("direct:start", expectedBody, "foo", "bar");
        resultEndpoint.assertIsSatisfied();
       
        resultEndpoint.reset();
        resultEndpoint.expectedMessageCount(0);
        template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo", "notMatchedHeaderValue");
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintJcloudsTestBundle)", 20000);

        MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);
        template.sendBodyAndHeader("direct:start", new SimpleObject("1", "Test 1"), JcloudsConstants.BLOB_NAME, "blob1");
        template.sendBodyAndHeader("direct:start", new SimpleObject("2", "Test 2"), JcloudsConstants.BLOB_NAME, "blob2");
        assertMockEndpointsSatisfied();
    }

    @Configuration
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);
        template.sendBodyAndHeader("direct:start", new SimpleObject("1", "Test 1"), JcloudsConstants.BLOB_NAME, "blob1");
        template.sendBodyAndHeader("direct:start", new SimpleObject("2", "Test 2"), JcloudsConstants.BLOB_NAME, "blob2");
        assertMockEndpointsSatisfied();
    }

    @Configuration
    public static Option[] configure() throws Exception {
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintKratiTestBundle)", 10000);
        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintKratiTestBundle)", 10000);
        MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);
        template.sendBodyAndHeader("direct:put", new SomeObject("1", "Test 1"), KratiConstants.KEY, "1");
        template.sendBodyAndHeader("direct:put", new SomeObject("2", "Test 2"), KratiConstants.KEY, "2");
        template.sendBodyAndHeader("direct:put", new SomeObject("3", "Test 3"), KratiConstants.KEY, "1");
        assertMockEndpointsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintKratiTestBundle)", 10000);
        MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);
        template.sendBodyAndHeader("direct:put", new SomeObject("1", "Test 1"), KratiConstants.KEY, "1");
        template.sendBodyAndHeader("direct:put", new SomeObject("2", "Test 2"), KratiConstants.KEY, "2");
        template.sendBodyAndHeader("direct:put", new SomeObject("3", "Test 3"), KratiConstants.KEY, "1");
        assertMockEndpointsSatisfied();
    }

    @Configuration
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBodyAndHeader()

        MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);
        template.sendBodyAndHeader("direct:put", new SomeObject("1", "Test 1"), KratiConstants.KEY, "1");
        template.sendBodyAndHeader("direct:put", new SomeObject("2", "Test 2"), KratiConstants.KEY, "2");
        template.sendBodyAndHeader("direct:put", new SomeObject("3", "Test 3"), KratiConstants.KEY, "1");
        assertMockEndpointsSatisfied();
    }

    @Configuration
    public static Option[] configure() throws Exception {
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.