Package org.apache.camel.component.mock

Examples of org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied()


        String jsonString = context.getTypeConverter().convertTo(String.class, json);
        JSONObject obj = (JSONObject) JSONSerializer.toJSON(jsonString);
        assertEquals("JSON must contain 1 top-level element", 1, obj.entrySet().size());
        assertTrue("Top-level element must be named root", obj.has("root"));

        mockJSON.assertIsSatisfied();
    }

    @Test
    public void testSomeOptionsToXML() throws Exception {
        InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage1.json");
View Full Code Here


        // would be converted to
        // <number>1</number><number>2</number><number>3</number>, if number is
        // set as an expandable property
        assertEquals("The number of direct child elements of newRoot with tag d (expandable property) is not 3", 3, document.getDocumentElement().getElementsByTagName("d").getLength());
        assertEquals("The number of direct child elements of newRoot with tag e (expandable property) is not 3", 3, document.getDocumentElement().getElementsByTagName("e").getLength());
        mockXML.assertIsSatisfied();
    }

    @Test
    public void testNamespacesDropped() throws Exception {
        InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage2-namespaces.xml");
View Full Code Here

        // a namespace prefix exists
        for (Object key : obj.getJSONObject("root").keySet()) {
            assertFalse("A key contains a colon", ((String) key).contains(":"));
        }

        mockJSON.assertIsSatisfied();
    }

    @Test
    public void testCustomNamespaceMappings() throws Exception {
        InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage2-namespaces.json");
View Full Code Here

        assertEquals("Element surname must be qualified in the default namespace", "http://camel.apache.org/default", document.getDocumentElement().getElementsByTagName("surname").item(0)
                .getNamespaceURI());
        assertEquals("Root element must be qualified in the default namespace", "http://camel.apache.org/default", document.getDocumentElement().getNamespaceURI());
        assertEquals("Element surname must have namespace attributes", 2, document.getDocumentElement().getElementsByTagName("surname").item(0).getAttributes().getLength());
        assertEquals("Root element must have namespace attributes", 2, document.getDocumentElement().getAttributes().getLength());
        mockXML.assertIsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

        MockEndpoint resultEndpoint = context.getEndpoint("mock:decrypted", MockEndpoint.class);
        resultEndpoint.setExpectedMessageCount(0);
        // verify that the message was encrypted before checking that it is decrypted
        xmlsecTestHelper.testEncryption(TestHelper.XML_FRAGMENT, context);
       
        resultEndpoint.assertIsSatisfied(100);
    }
   
    @Test
    public void testAsymmetricEncryptionAlgorithmPartialPayload() throws Exception {
                     
View Full Code Here

        MockEndpoint resultEndpoint = context.getEndpoint("mock:decrypted", MockEndpoint.class);
        resultEndpoint.setExpectedMessageCount(0);
        // verify that the message was encrypted before checking that it is decrypted
        xmlsecTestHelper.testEncryption(TestHelper.XML_FRAGMENT, context);
       
        resultEndpoint.assertIsSatisfied(100);
    }
   
    @Test
    public void testAsymmetricEncryptionAlgorithmPartialPayloadElement() throws Exception {
                     
View Full Code Here

        MockEndpoint resultEndpoint = context.getEndpoint("mock:decrypted", MockEndpoint.class);
        resultEndpoint.setExpectedMessageCount(0);
        // verify that the message was encrypted before checking that it is decrypted
        xmlsecTestHelper.testEncryption(TestHelper.XML_FRAGMENT, context);
       
        resultEndpoint.assertIsSatisfied(100);
    }
}
View Full Code Here

            template.sendBodyAndHeader("jms:queue:loanRequestQueue",
                                       "Quote for the lowerst rate of loaning bank",
                                       Constants.PROPERTY_SSN, "Client-A" + i);
            Thread.sleep(100);
        }
        endpoint.assertIsSatisfied();

        // check the response from the mock endpoint
        List<Exchange> exchanges = endpoint.getExchanges();
        int index = 0;
        for (Exchange exchange : exchanges) {
View Full Code Here

        for (int i = 1; i <= messageCount; i++) {
            String body = "message:" + i;
            template.sendBodyAndHeader("direct:a", body, "cheese", 123);
        }

        resultEndpoint.assertIsSatisfied();
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
View Full Code Here

            template.sendBody("seda:a", "<message>" + i + "</message>");
        }

        // lets pause to give the requests time to be processed
        // to check that the throttle really does kick in
        resultEndpoint.assertIsSatisfied();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
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.