Package org.mule.api

Examples of org.mule.api.MuleMessage.addAttachment()


                props.put("doubleParam", 12345.6);
                props.put("integerParam", 12345);
                props.put("longParam", (long) 123456789);
                props.put("booleanParam", Boolean.TRUE);
                MuleMessage msg = new DefaultMuleMessage(context.getMessageAsString(), props, muleContext);
                msg.addAttachment("test1", new DataHandler(new DataSource()
                {
                    public InputStream getInputStream() throws IOException
                    {
                        return null;
                    }
View Full Code Here


    public void eventReceived(MuleEventContext context, Object component) throws Exception
    {
        MuleMessage message = context.getMessage();
        // add an attachment, named after the componentname...
        message.addAttachment(context.getFlowConstruct().getName(), new DataHandler(
            new PlainTextDataSource("text/plain", "<content>")));

        // return the list of attachment names
        FunctionalTestComponent fc = (FunctionalTestComponent) component;
        fc.setReturnData(message.getAttachmentNames().toString());
View Full Code Here

    {
        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());
        assertTrue(deserializedMessage.getAttachmentNames().contains(attachmentName));
View Full Code Here

                props.put("doubleParam", 12345.6);
                props.put("integerParam", 12345);
                props.put("longParam", (long) 123456789);
                props.put("booleanParam", Boolean.TRUE);
                MuleMessage msg = new DefaultMuleMessage(context.getMessageAsString(), props, muleContext);
                msg.addAttachment("test1", new DataHandler(new DataSource()
                {
                    @Override
                    public InputStream getInputStream() throws IOException
                    {
                        return null;
View Full Code Here

    {
        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());
        assertTrue(deserializedMessage.getAttachmentNames().contains(attachmentName));
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.