Package org.springframework.oxm

Examples of org.springframework.oxm.Marshaller.marshal()


    @Test
    public void testSendAndReceiveMarshalResponse() throws Exception {
        Marshaller marshallerMock = createMock(Marshaller.class);
        template.setMarshaller(marshallerMock);
        marshallerMock.marshal(isA(Object.class), isA(Result.class));

        Unmarshaller unmarshallerMock = createMock(Unmarshaller.class);
        template.setUnmarshaller(unmarshallerMock);
        Object unmarshalled = new Object();
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(unmarshalled);
View Full Code Here


    @Test
    public void testSendAndReceiveMarshalNoResponse() throws Exception {
        Marshaller marshallerMock = createMock(Marshaller.class);
        template.setMarshaller(marshallerMock);
        marshallerMock.marshal(isA(Object.class), isA(Result.class));

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(null);
        connectionMock.close();
View Full Code Here

        WebServiceMessage messageMock = createMock(WebServiceMessage.class);

        Result result = new StringResult();
        Object marshalled = new Object();
        expect(messageMock.getPayloadResult()).andReturn(result);
        marshallerMock.marshal(marshalled, result);

        replay(marshallerMock, messageMock);

        MarshallingUtils.marshal(marshallerMock, marshalled, messageMock);
View Full Code Here

       
        //Marshall to XML
        final Marshaller marshaller = dataExporter.getMarshaller();
       
        final StringWriter result = new StringWriter();
        marshaller.marshal(dataExport, new StreamResult(result));
       
        //Compare the exported XML data with the imported XML data, they should match
        final String resultString = result.toString();
        try {
          XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

            return null;
        }
       
        final Marshaller marshaller = portalDataExporter.getMarshaller();
        try {
            marshaller.marshal(data, result);
            return portalDataExporter.getFileName(data);
        }
        catch (XmlMappingException e) {
            throw new RuntimeException("Failed to map provided portal data to XML", e);
        }
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.