Package org.mule.api.model

Examples of org.mule.api.model.InvocationResult


    }

    @Test
    public void testMapAttachmentsAll() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsAll", eventContext);
        assertTrue("Message payload should be a Map", response.getResult() instanceof Map);
        Map<String, DataHandler> result = (Map<String, DataHandler>) response.getResult();
        //Will include all Mule attachments too
        assertTrue(result.size() >= 3);
        assertEquals("fooValue", readAttachment(result.get("foo")));
        assertEquals("barValue", readAttachment(result.get("bar")));
        assertEquals("bazValue", readAttachment(result.get("baz")));
View Full Code Here


    }

    @Test
    public void testMapAttachmentsWildcard() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsWildcard", eventContext);
        assertTrue("Message payload should be a Map", response.getResult() instanceof Map);
        Map<String, DataHandler> result = (Map<String, DataHandler>) response.getResult();
        //Will match on ba*
        assertEquals(2, result.size());
        assertNull(result.get("foo"));
        assertNotNull(result.get("bar"));
        assertNotNull(result.get("baz"));
View Full Code Here

    }

    @Test
    public void testMapAttachmentsMultiWildcard() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsMultiWildcard", eventContext);
        assertTrue("Message payload should be a Map", response.getResult() instanceof Map);
        Map<String, DataHandler> result = (Map<String, DataHandler>) response.getResult();
        //Will match on ba*, f*
        assertEquals(3, result.size());

        assertNotNull(result.get("foo"));
        assertNotNull(result.get("bar"));
View Full Code Here

    }

    @Test
    public void testListAttachments() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsList", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        assertEquals(3, result.size());
    }
View Full Code Here

        Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
        attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
        attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
        eventContext = createEventContext(null, attachments);

        InvocationResult response = invokeResolver("processAttachmentsListOptional", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        assertEquals(2, result.size());
    }
View Full Code Here

    @Test
    public void testListAttachmentsWithAllOptional() throws Exception
    {
        eventContext = createEventContext(null, new HashMap<String, DataHandler>());

        InvocationResult response = invokeResolver("processAttachmentsListAllOptional", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        assertEquals(0, result.size());
    }
View Full Code Here

    }

    @Test
    public void testSingleListAttachment() throws Exception
    {
        InvocationResult response = invokeResolver("processSingleAttachmentList", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        assertEquals(1, result.size());
    }
View Full Code Here

    }

    @Test
    public void testListAttachmentsAll() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsListAll", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        assertEquals(3, result.size());
    }
View Full Code Here

    }

    @Test
    public void testListAttachmentsWilcard() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsListWildcard", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        //Will match all attachments with ba*
        assertEquals(2, result.size());

    }
View Full Code Here

    }

    @Test
    public void testListAttachmentsMultiWilcard() throws Exception
    {
        InvocationResult response = invokeResolver("processAttachmentsListMultiWildcard", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<DataHandler> result = (List<DataHandler>) response.getResult();
        //Will match all attachments with ba* and f*
        assertEquals(3, result.size());
    }
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.