Package org.springframework.oxm.mime

Examples of org.springframework.oxm.mime.MimeUnmarshaller.unmarshal()


        MimeMessage request = createMock("request", MimeMessage.class);
        MimeMessage response = createMock("response", MimeMessage.class);
        Source requestSource = new StringSource("<request/>");
        expect(request.getPayloadSource()).andReturn(requestSource);
        expect(factoryMock.createWebServiceMessage()).andReturn(response);
        expect(unmarshaller.unmarshal(eq(requestSource), isA(MimeContainer.class))).andReturn(42L);
        Result responseResult = new StringResult();
        expect(response.getPayloadResult()).andReturn(responseResult);
        marshaller.marshal(eq("result"), eq(responseResult), isA(MimeContainer.class));

        replay(factoryMock, unmarshaller, marshaller, request, response);
View Full Code Here


            return null;
        }
        else if (unmarshaller instanceof MimeUnmarshaller && message instanceof MimeMessage) {
            MimeUnmarshaller mimeUnmarshaller = (MimeUnmarshaller) unmarshaller;
            MimeMessageContainer container = new MimeMessageContainer((MimeMessage) message);
            return mimeUnmarshaller.unmarshal(payload, container);
        }
        else {
            return unmarshaller.unmarshal(payload);
        }
    }
View Full Code Here

        MimeMessage messageMock = createMock(MimeMessage.class);

        Source source = new StringSource("");
        Object unmarshalled = new Object();
        expect(messageMock.getPayloadSource()).andReturn(source);
        expect(unmarshallerMock.unmarshal(eq(source), isA(MimeContainer.class))).andReturn(unmarshalled);

        replay(unmarshallerMock, messageMock);

        Object result = MarshallingUtils.unmarshal(unmarshallerMock, messageMock);
        Assert.assertEquals("Invalid unmarshalled object", unmarshalled, result);
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.