Package org.mule

Examples of org.mule.DefaultMuleMessage$SerializedDataHandler


    public void testPayloadTypeFilterNoExpectedType()
    {
        PayloadTypeFilter filter = new PayloadTypeFilter();
        assertNull(filter.getExpectedType());
        assertFalse(filter.accept(new DefaultMuleMessage("test", muleContext)));

        filter.setExpectedType(String.class);
        assertTrue(filter.accept(new DefaultMuleMessage("test", muleContext)));

        filter.setExpectedType(null);
        assertFalse(filter.accept(new DefaultMuleMessage("test", muleContext)));
    }
View Full Code Here


    public void testPayloadTypeFilter()
    {
        PayloadTypeFilter filter = new PayloadTypeFilter(Exception.class);
        assertNotNull(filter.getExpectedType());
        assertTrue(filter.accept(new DefaultMuleMessage(new Exception("test"), muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("test", muleContext)));

        filter.setExpectedType(String.class);
        assertTrue(filter.accept(new DefaultMuleMessage("test", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage(new Exception("test"), muleContext)));
    }
View Full Code Here

    public void testHeaderFilter() throws Exception
    {
        ExpressionFilter filter = new ExpressionFilter("header", "foo=bar");
        filter.setMuleContext(muleContext);
        MuleMessage message = new DefaultMuleMessage("blah", muleContext);
        assertTrue(!filter.accept(message));
        message.setOutboundProperty("foo", "bar");
        assertTrue(filter.accept(message));
    }
View Full Code Here

   
    public void testVariableFilter() throws Exception
    {
        ExpressionFilter filter = new ExpressionFilter("variable", "foo=bar");
        filter.setMuleContext(muleContext);
        MuleMessage message = new DefaultMuleMessage("blah", muleContext);
        assertTrue(!filter.accept(message));
        message.setInvocationProperty("foo", "bar");
        assertTrue(filter.accept(message));
    }
View Full Code Here

    public void testHeaderFilterWithNot() throws Exception
    {
        ExpressionFilter filter = new ExpressionFilter("header", "foo!=bar");
        filter.setMuleContext(muleContext);

        MuleMessage message = new DefaultMuleMessage("blah", muleContext);

        assertTrue(filter.accept(message));
        message.setOutboundProperty("foo", "bar");
        assertTrue(!filter.accept(message));
        message.setOutboundProperty("foo", "car");
        assertTrue(filter.accept(message));
    }
View Full Code Here

    public void testVariableFilterWithNot() throws Exception
    {
        ExpressionFilter filter = new ExpressionFilter("variable", "foo!=bar");
        filter.setMuleContext(muleContext);

        MuleMessage message = new DefaultMuleMessage("blah", muleContext);

        assertTrue(filter.accept(message));
        message.setInvocationProperty("foo", "bar");
        assertTrue(!filter.accept(message));
        message.setInvocationProperty("foo", "car");
        assertTrue(filter.accept(message));
    }
View Full Code Here

    }

    public void testName() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage msg = new DefaultMuleMessage("Hi", client.getMuleContext());
        client.dispatch("jms://Myflow.input?connector=simpleJmsConnector", msg);
        MuleMessage result = client.request("jms://Myflow.finishedOriginal?connector=simpleJmsConnector", 10000);
        assertNotNull(result);
    }
View Full Code Here

    }

    public void testNoComponentFails() throws Exception
    {
        MuleClient muleClient = new MuleClient(muleContext);
        MuleMessage message = new DefaultMuleMessage("thePayload", muleContext);
        MuleMessage result = muleClient.send("vm://incomingPass", message);
        assertNull("Shouldn't have any exceptions", result.getExceptionPayload());
        assertEquals("thePayload Received component1 Received component2Pass", result.getPayloadAsString());
    }
View Full Code Here

    protected MuleMessage createTestRequestMessage()
    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("prop1", "value1");
        return new DefaultMuleMessage(TEST_MESSAGE, props, muleContext);
    }
View Full Code Here

        assertEquals("thePayload Received component1 Received component2Pass", result.getPayloadAsString());
    }

    public void testLastComponentFails() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage("thePayload", muleContext);
        try
        {
            muleContext.getClient().send("vm://incomingLastFail", message);
            fail("Exception expected");
        }
View Full Code Here

TOP

Related Classes of org.mule.DefaultMuleMessage$SerializedDataHandler

Copyright © 2018 www.massapicom. 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.