Package org.springframework.oxm

Examples of org.springframework.oxm.Marshaller


    }


    @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


        verify(connectionMock, marshallerMock, unmarshallerMock);
    }

    @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

  @Test
    public void marshalSendAndReceiveResponse() throws TransformerConfigurationException {
        final Transformer transformer = TransformerFactory.newInstance().newTransformer();
        final Object requestObject = new Object();
        Marshaller marshaller = new Marshaller() {

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
View Full Code Here

  @Test
    public void marshalSendAndReceiveNoResponse() throws TransformerConfigurationException {
        final Transformer transformer = TransformerFactory.newInstance().newTransformer();
        final Object requestObject = new Object();
        Marshaller marshaller = new Marshaller() {

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
View Full Code Here

  @Test
    public void marshalSendAndReceiveResponse() throws TransformerConfigurationException {
        final Transformer transformer = TransformerFactory.newInstance().newTransformer();
        final Object requestObject = new Object();
        Marshaller marshaller = new Marshaller() {

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
View Full Code Here

  @Test
    public void marshalSendAndReceiveNoResponse() throws TransformerConfigurationException {
        final Transformer transformer = TransformerFactory.newInstance().newTransformer();
        final Object requestObject = new Object();
        Marshaller marshaller = new Marshaller() {

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
View Full Code Here

                    Assert.fail(e.getMessage());
                    return null;
                }
            }
        };
        Marshaller marshaller = new SimpleMarshaller() {
            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException {
                Assert.fail("marshal not expected");
            }
        };
View Full Code Here

                    Assert.fail(e.getMessage());
                    return null;
                }
            }
        };
        Marshaller marshaller = new SimpleMarshaller() {
            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException {
                Assert.assertEquals("Invalid graph", "result", graph);
                try {
                    transformer.transform(new StreamSource(new StringReader("<result/>")), result);
View Full Code Here

        return argument;
    }

    @Override
    protected boolean supportsResponsePayloadReturnType(MethodParameter returnType) {
        Marshaller marshaller = getMarshaller();
        if (marshaller == null) {
            return false;
        }
        else if (marshaller instanceof GenericMarshaller) {
            GenericMarshaller genericMarshaller = (GenericMarshaller) marshaller;
            return genericMarshaller.supports(returnType.getGenericParameterType());
        }
        else {
            return marshaller.supports(returnType.getParameterType());
        }
    }
View Full Code Here

    public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
            throws Exception {
      if (returnValue == null) {
        return;
      }
        Marshaller marshaller = getMarshaller();
        Assert.state(marshaller != null, "marshaller must not be null");

        if (logger.isDebugEnabled()) {
            logger.debug("Marshalling [" + returnValue + "] to response payload");
        }
View Full Code Here

TOP

Related Classes of org.springframework.oxm.Marshaller

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.