Examples of invoke()


Examples of org.mule.api.model.EntryPointResolverSet.invoke()

        EntryPointResolverSet resolverSet = new LegacyEntryPointResolverSet();

        try
        {
            RequestContext.setEvent(getTestEvent("Hello"));
            resolverSet.invoke(new MultiplePayloadsTestObject(), RequestContext.getEventContext());
            fail("Should have failed to find entrypoint.");
        }
        catch (EntryPointNotFoundException itex)
        {
            // expected
View Full Code Here

Examples of org.mule.api.processor.policy.AroundPolicy.invoke()

                {
                    return doProcess(event);
                }
            });
            final AroundPolicy entryPoint = activePolicies.get(0);
            result = entryPoint.invoke(invocation);
        }
        else
        {
            // direct invocation
            result = doProcess(event);
View Full Code Here

Examples of org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.invoke()

        AnnotatedEntryPointResolver resolver = new AnnotatedEntryPointResolver();
        AnnotatedComponent component = new AnnotatedComponent();
        MuleEventContext context = getTestEventContext(TEST_PAYLOAD);
        //Since AnnotatedComponent2 has two annotated methods we need to set the method to call
        context.getMessage().setProperty(MuleProperties.MULE_METHOD_PROPERTY, "doStuff", PropertyScope.INVOCATION);
        InvocationResult result = resolver.invoke(component, context);
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
        assertTrue(result.getResult() instanceof Map);
        Map<?, ?> map = (Map<?, ?>)result.getResult();
        assertEquals(3, map.size());
        assertTrue(map.get("foo") instanceof Element);
View Full Code Here

Examples of org.mule.model.resolvers.AbstractArgumentEntryPointResolver.invoke()

public class ArrayEntryPointResolverTestCase extends AbstractMuleTestCase
{
    public void testArrayMatch() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new ArrayEntryPointResolver();
        InvocationResult ctx = resolver.invoke(new FruitBowl(), getTestEventContext(new Fruit[]{new Apple(), new Orange()}));
        assertEquals(ctx.getState(), InvocationResult.State.SUCCESSFUL);

    }

    public void testArrayMatchGenericFail() throws Exception
View Full Code Here

Examples of org.mule.model.resolvers.ArrayEntryPointResolver.invoke()

public class ArrayEntryPointResolverTestCase extends AbstractMuleTestCase
{
    public void testArrayMatch() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new ArrayEntryPointResolver();
        InvocationResult ctx = resolver.invoke(new FruitBowl(), getTestEventContext(new Fruit[]{new Apple(), new Orange()}));
        assertEquals(ctx.getState(), InvocationResult.State.SUCCESSFUL);

    }

    public void testArrayMatchGenericFail() throws Exception
View Full Code Here

Examples of org.mule.model.resolvers.CallableEntryPointResolver.invoke()

public class CallableEntryPointDiscoveryTestCase extends AbstractMuleTestCase
{
    public void testBadMatch() throws Exception
    {
        CallableEntryPointResolver resolver = new CallableEntryPointResolver();
        InvocationResult result = resolver.invoke(new WaterMelon(), getTestEventContext(new StringBuffer("foo")));
        assertEquals("Service doesn't implement Callable", result.getState(), InvocationResult.State.NOT_SUPPORTED);
    }

    public void testGoodMatch() throws Exception
    {
View Full Code Here

Examples of org.mule.model.resolvers.ExplicitMethodEntryPointResolver.invoke()

{
    public void testMethodSetPass() throws Exception
    {
        ExplicitMethodEntryPointResolver resolver = new ExplicitMethodEntryPointResolver();
        resolver.addMethod("someBusinessMethod");
        InvocationResult result = resolver.invoke(new MultiplePayloadsTestObject(), getTestEventContext("blah"));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }

    public void testMethodSetMatchFirst() throws Exception
    {
View Full Code Here

Examples of org.mule.model.resolvers.LegacyEntryPointResolverSet.invoke()

    public void testExplicitMethodMatch() throws Exception
    {
        try
        {
            LegacyEntryPointResolverSet resolver = new LegacyEntryPointResolverSet();
            resolver.invoke(new WaterMelon(), getTestEventContext("blah"));
        }
        catch (MuleException e)
        {
            fail("Test should have passed: " + e);
        }
View Full Code Here

Examples of org.mule.model.resolvers.NoArgumentsEntryPointResolver.invoke()

{
    public void testExplicitMethodMatch() throws Exception
    {
        AbstractArgumentEntryPointResolver resolver = new NoArgumentsEntryPointResolver();
        resolver.addMethod("bite");
        InvocationResult result = resolver.invoke(new InvalidSatsuma(), getTestEventContext("blah"));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }

    public void testExplicitMethodMatch2() throws Exception
    {
View Full Code Here

Examples of org.mule.model.resolvers.ReflectionEntryPointResolver.invoke()

{

    public void testExplicitMethodMatch() throws Exception
    {
        ReflectionEntryPointResolver resolver = new ReflectionEntryPointResolver();
        InvocationResult result = resolver.invoke(new WaterMelon(), getTestEventContext("blah"));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
    }

    public void testExplicitMethodMatchComplexObject() throws Exception
    {
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.