Package org.mule

Examples of org.mule.DefaultMuleMessage$SerializedDataHandler


        }
    }

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


        public TestSecurityEvent(MuleContext muleContext)
        {
            super(
                new UnauthorisedException(CoreMessages.createStaticMessage("dummy"), new DefaultMuleEvent(
                    new DefaultMuleMessage(NullPayload.getInstance(), muleContext), MessageExchangePattern.REQUEST_RESPONSE,
                    null)), 0);
        }
View Full Code Here

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

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

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

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

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

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

        ExpressionFilter filter = new ExpressionFilter("regex", "The quick (.*)");
        filter.setMuleContext(muleContext);

        assertNotNull(filter.getExpression());

        assertTrue(filter.accept(new DefaultMuleMessage("The quick brown fox", muleContext)));
        assertTrue(filter.accept(new DefaultMuleMessage("The quick ", muleContext)));

        assertTrue(!filter.accept(new DefaultMuleMessage("The quickbrown fox", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("he quick brown fox", muleContext)));
    }
View Full Code Here

        ExpressionFilter filter = new ExpressionFilter("#[regex:The number is [1-9]]");
        filter.setMuleContext(muleContext);

        assertNotNull(filter.getExpression());

        assertTrue(filter.accept(new DefaultMuleMessage("The number is 4", muleContext)));
        assertFalse(filter.accept(new DefaultMuleMessage("Say again?", muleContext)));

        assertFalse(filter.accept(new DefaultMuleMessage("The number is 0", muleContext)));
    }
View Full Code Here

    public void testExceptionTypeFilter()
    {
        ExpressionFilter filter = new ExpressionFilter("exception-type:java.lang.Exception");
        filter.setMuleContext(muleContext);

        MuleMessage m = new DefaultMuleMessage("test", muleContext);
        assertTrue(!filter.accept(m));
        m.setExceptionPayload(new DefaultExceptionPayload(new IllegalArgumentException("test")));
        assertTrue(filter.accept(m));

        filter = new ExpressionFilter("exception-type:java.io.IOException");
        assertTrue(!filter.accept(m));
        m.setExceptionPayload(new DefaultExceptionPayload(new IOException("test")));
        assertTrue(filter.accept(m));
    }
View Full Code Here

    public void testPayloadTypeFilter()
    {
        ExpressionFilter filter = new ExpressionFilter("payload-type:org.mule.tck.testmodels.fruit.Apple");
        filter.setMuleContext(muleContext);

        assertTrue(filter.accept(new DefaultMuleMessage(new Apple(), muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("test", muleContext)));

        filter = new ExpressionFilter("payload-type:java.lang.String");
        assertTrue(filter.accept(new DefaultMuleMessage("test", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage(new Exception("test"), muleContext)));
    }
View Full Code Here

    public void testWildcardFilterMultiplePatterns()
    {
        ExpressionFilter filter = new ExpressionFilter("wildcard:* brown*, The*");
        filter.setMuleContext(muleContext);

        assertTrue(filter.accept(new DefaultMuleMessage("The quick brown fox", muleContext)));
        assertTrue(filter.accept(new DefaultMuleMessage(" brown fox", muleContext)));
        assertTrue(filter.accept(new DefaultMuleMessage("The quickbrown fox", muleContext)));
    }
View Full Code Here

        ExpressionFilter filter = new ExpressionFilter("payload:");
        filter.setMuleContext(muleContext);

        filter.setNullReturnsTrue(true);

        assertTrue(filter.accept(new DefaultMuleMessage("true", muleContext)));
        assertTrue(filter.accept(new DefaultMuleMessage("TRUE", muleContext)));
        assertTrue(filter.accept(new DefaultMuleMessage("tRuE", muleContext)));
    }
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.