Package org.mule.api.model

Examples of org.mule.api.model.InvocationResult


    @Test
    public void testDynamicMethodMatchPass() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new NoArgumentsEntryPointResolver();
        InvocationResult result = resolver.invoke(new InvalidSatsuma(), getTestEventContext("blah"));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }
View Full Code Here


    @Test
    public void testDynamicMethodMatchFailOnWildcardMatch() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new NoArgumentsEntryPointResolver();
        assertTrue(resolver.removeIgnoredMethod("is*"));
        InvocationResult result = resolver.invoke(new InvalidSatsuma(), getTestEventContext("blah"));
        assertEquals("Satsuma service has a number of matching method, so should have failed",
                result.getState(), InvocationResult.State.FAILED);
    }
View Full Code Here

    @Test
    public void testExplicitMethodMatchAndNullPayload() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new NoArgumentsEntryPointResolver();
        resolver.addMethod("wash");
        InvocationResult result = resolver.invoke(new Apple(), getTestEventContext(NullPayload.getInstance()));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }
View Full Code Here

    @Test
    public void testBadMatch() throws Exception
    {
        CallableEntryPointResolver resolver = new CallableEntryPointResolver();
        InvocationResult result = resolver.invoke(new WaterMelon(), getTestEventContext(new StringBuilder("foo")));
        assertEquals("Service doesn't implement Callable", result.getState(), InvocationResult.State.NOT_SUPPORTED);
    }
View Full Code Here

    @Test
    public void testGoodMatch() throws Exception
    {
        CallableEntryPointResolver resolver = new CallableEntryPointResolver();
        InvocationResult result = resolver.invoke(new Apple(), getTestEventContext("blah"));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }
View Full Code Here

    public void testMethodSetPass() throws Exception
    {
        MuleEventContext ctx = getTestEventContext("blah");
        ctx.getMessage().setProperty("method", "someBusinessMethod", PropertyScope.INBOUND);

        InvocationResult result = resolver.invoke(new MultiplePayloadsTestObject(), ctx);
        assertInvocationWasSuccessful(result);
    }
View Full Code Here

    public void testMethodSetWithNoArgsPass() throws Exception
    {
        MuleEventContext ctx = getTestEventContext(NullPayload.getInstance());
        ctx.getMessage().setProperty("method", "wash", PropertyScope.INBOUND);

        InvocationResult result = resolver.invoke(new Apple(), ctx);
        assertInvocationWasSuccessful(result);
        assertEquals("wash", result.getMethodCalled());
    }
View Full Code Here

        resolver.setMethodProperty("serviceMethod");

        MuleEventContext ctx = getTestEventContext("blah");
        ctx.getMessage().setProperty("serviceMethod", "someBusinessMethod", PropertyScope.INBOUND);

        InvocationResult result = resolver.invoke(new MultiplePayloadsTestObject(), ctx);
        assertInvocationWasSuccessful(result);
    }
View Full Code Here

        resolver.setMethodProperty("serviceMethod");

        MuleEventContext ctx = getTestEventContext("blah");
        ctx.getMessage().setProperty("serviceMethod", "noMethod", PropertyScope.INBOUND);

        InvocationResult result = resolver.invoke(new MultiplePayloadsTestObject(), ctx);
        assertInvocationFailed(result);
    }
View Full Code Here

        resolver.setMethodProperty("serviceMethod");

        MuleEventContext ctx = getTestEventContext("blah");
        ctx.getMessage().setProperty("myMethod", "someBusinessMethod", PropertyScope.INBOUND);

        InvocationResult result = resolver.invoke(new MultiplePayloadsTestObject(), ctx);
        assertInvocationFailed(result);
    }
View Full Code Here

TOP

Related Classes of org.mule.api.model.InvocationResult

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.