Examples of StringDataSource


Examples of org.mule.util.StringDataSource

    @Test
    public void testMapAttachmentsOptional() throws Exception
    {
        //clear baz attachment
        Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
        attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
        attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
        muleMessage = createMessage(null, attachments);

        MuleClient client = muleContext.getClient();
        MuleMessage message = client.send("vm://attachmentsOptional", muleMessage);
        assertNotNull("return message from MuleClient.send() should not be null", message);
View Full Code Here

Examples of org.mule.util.StringDataSource

    @Test
    public void testListAttachmentsWithOptional() throws Exception
    {
        //clear baz attachment
        Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
        attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
        attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
        muleMessage = createMessage(null, attachments);

        MuleClient client = muleContext.getClient();
        MuleMessage message = client.send("vm://attachmentsListOptional", muleMessage);
        assertNotNull("return message from MuleClient.send() should not be null", message);
View Full Code Here

Examples of org.mule.util.StringDataSource

    @Test
    public void testListAttachmentsWithMissing() throws Exception
    {
        //clear bar attachment
        Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
        attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
        attachments.put("baz", new DataHandler(new StringDataSource("bazValue")));
        muleMessage = createMessage(null, attachments);

        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("vm://attachmentsListOptional", muleMessage);
        assertNotNull(result);
View Full Code Here

Examples of org.mule.util.StringDataSource

        muleMessage = new DefaultMuleMessage("test", props, muleContext);

        try
        {
            muleMessage.addOutboundAttachment("foo", new DataHandler(new StringDataSource("fooValue")));
            muleMessage.addOutboundAttachment("bar", new DataHandler(new StringDataSource("barValue")));
            muleMessage.addOutboundAttachment("baz", new DataHandler(new StringDataSource("bazValue")));
        }
        catch (Exception e)
        {
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

Examples of org.mule.util.StringDataSource

    public void testAttachments() throws Exception
    {
        String attachmentName = "the-attachment";

        MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
        DataHandler dataHandler = new DataHandler(new StringDataSource("attachment content"));
        message.addAttachment(attachmentName, dataHandler);

        MuleMessage deserializedMessage = serializationRoundtrip(message);

        assertEquals(1, deserializedMessage.getAttachmentNames().size());
View Full Code Here

Examples of org.mule.util.StringDataSource

        }

        if(attachments==null)
        {
            attachments = new HashMap<String, DataHandler>();
            attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
            attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
            attachments.put("baz", new DataHandler(new StringDataSource("bazValue")));
        }
        DefaultMuleMessage message;
        if(inboundScope)
        {
            message = new DefaultMuleMessage("test", null, attachments, muleContext);
View Full Code Here

Examples of org.mule.util.StringDataSource

    public Map<String, DataHandler> processUnmodifiableAttachments(@InboundAttachments("foo, bar") Map<String, DataHandler> attachments)
    {
        //Should throw UnsupportedOperationException
        //TODO auto wrap method on Map
        attachments.put("car", new DataHandler(new StringDataSource("carValue")));
        return attachments;
    }
View Full Code Here

Examples of org.mule.util.StringDataSource

    }

    public List<Object> processUnmodifiableAttachmentsList(@InboundAttachments("foo, bar") List<DataHandler> attachments)
    {
        //Should throw UnsupportedOperationException
        attachments.add(new DataHandler(new StringDataSource("carValue")));
        return readToList(attachments);
    }
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.