Examples of assertIsSatisfied()


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

       
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
        mock.reset();
        context.stopRoute("tailableCursorConsumer2");
        while (context.getRouteStatus("tailableCursorConsumer2") != ServiceStatus.Stopped) { }
        context.startRoute("tailableCursorConsumer2");
       
View Full Code Here

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

        });
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
       
        // check that the first message received in this second batch corresponds to increasing=301
        Object firstBody = mock.getExchanges().get(0).getIn().getBody();
        assertTrue(firstBody instanceof DBObject);
        assertEquals(301, ((DBObject) firstBody).get("increasing"));
View Full Code Here

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

       
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
        mock.reset();
        // ensure that the persisted lastVal is startTimestamp + 300min
        Calendar cal300 = (Calendar) startTimestamp.clone();
        cal300.add(Calendar.MINUTE, 300);
        context.stopRoute("tailableCursorConsumer2");
View Full Code Here

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

        });
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
        Object firstBody = mock.getExchanges().get(0).getIn().getBody();
        assertTrue(firstBody instanceof DBObject);
        Calendar cal301 = (Calendar) startTimestamp.clone();
        cal301.add(Calendar.MINUTE, 301);
        assertEquals(cal301.getTime(), ((DBObject) firstBody).get("increasing"));
View Full Code Here

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

       
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
        mock.reset();
       
        // stop the route to ensure that our lastVal is persisted, and check it
        context.stopRoute("tailableCursorConsumer3");
        // ensure that the persisted lastVal is 300, newton is the name of the trackingField we are using
View Full Code Here

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

        });
        // start the data pumping
        t.start();
        // before we continue wait for the data pump to end
        t.join();
        mock.assertIsSatisfied();
        // check that the first received body contains increasing=301 and not increasing=1, i.e. it's not starting from the top
        Object firstBody = mock.getExchanges().get(0).getIn().getBody();
        assertTrue(firstBody instanceof DBObject);
        assertEquals(301, ((DBObject) firstBody).get("increasing"));
        // check that the persisted lastVal after stopping the route is 600, newton is the name of the trackingField we are using
View Full Code Here

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

    @Test
    public void testDoCatchWithTimeOutException() throws Exception {
        MockEndpoint error = context.getEndpoint("mock:error", MockEndpoint.class);
        error.expectedMessageCount(1);
        sendTimeOutMessage("direct:doCatch");
        error.assertIsSatisfied();
    }
   
    protected void sendTimeOutMessage(String endpointUri) throws Exception {
        Exchange reply = sendJaxWsMessage(endpointUri);
        Exception e = reply.getException();
View Full Code Here

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

        assertEquals("JSONObject doesn't contain 7 keys", 7, obj.entrySet().size());

        template.sendBody("direct:unmarshal", jsonString);

        mockJSON.assertIsSatisfied();
        mockXML.assertIsSatisfied();
    }

    @Test
    public void testUnmarshalJSONObject() throws Exception {
        InputStream inStream = getClass().getResourceAsStream("testMessage1.json");
View Full Code Here

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

        Object marshalled = template.requestBody("direct:unmarshal", json);
        Document document = context.getTypeConverter().convertTo(Document.class, marshalled);
        assertEquals("The XML document has an unexpected root node", "o", document.getDocumentElement().getLocalName());

        mockXML.assertIsSatisfied();
    }

    @Test
    public void testMarshalXMLSources() throws Exception {
        InputStream inStream = getClass().getResourceAsStream("testMessage1.xml");
View Full Code Here

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

        JSONObject obj = (JSONObject) JSONSerializer.toJSON(jsonString);
        assertEquals("JSONObject doesn't contain 7 keys", 7, obj.entrySet().size());
        template.requestBody("direct:marshal", inSAX);
        template.requestBody("direct:marshal", inDocument);

        mockJSON.assertIsSatisfied();
    }
   
    @Test
    public void testMarshalAndUnmarshalInline() throws Exception {
        InputStream inStream = getClass().getResourceAsStream("testMessage1.xml");
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.