From ffd9f16b0795bac0417aef867a6baadbf7c25cde Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Tue, 3 Apr 2007 16:59:14 +0000 Subject: [PATCH] Marshaller-supports --- .../MarshallingPayloadEndpointTest.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java b/core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java index 7e52100c..4a886f1f 100644 --- a/core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java +++ b/core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java @@ -16,6 +16,7 @@ package org.springframework.ws.server.endpoint; +import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import javax.xml.transform.Result; @@ -57,7 +58,7 @@ public class MarshallingPayloadEndpointTest extends XMLTestCase { } public void testInvoke() throws Exception { - Unmarshaller unmarshaller = new Unmarshaller() { + Unmarshaller unmarshaller = new SimpleMarshaller() { public Object unmarshal(Source source) throws XmlMappingException { try { StringWriter writer = new StringWriter(); @@ -71,7 +72,7 @@ public class MarshallingPayloadEndpointTest extends XMLTestCase { } } }; - Marshaller marshaller = new Marshaller() { + Marshaller marshaller = new SimpleMarshaller() { public void marshal(Object graph, Result result) throws XmlMappingException { assertEquals("Invalid graph", "result", graph); try { @@ -104,7 +105,7 @@ public class MarshallingPayloadEndpointTest extends XMLTestCase { } public void testInvokeNullResponse() throws Exception { - Unmarshaller unmarshaller = new Unmarshaller() { + Unmarshaller unmarshaller = new SimpleMarshaller() { public Object unmarshal(Source source) throws XmlMappingException { try { StringWriter writer = new StringWriter(); @@ -118,7 +119,7 @@ public class MarshallingPayloadEndpointTest extends XMLTestCase { } } }; - Marshaller marshaller = new Marshaller() { + Marshaller marshaller = new SimpleMarshaller() { public void marshal(Object graph, Result result) throws XmlMappingException { fail("marshal not expected"); } @@ -138,4 +139,20 @@ public class MarshallingPayloadEndpointTest extends XMLTestCase { factoryControl.verify(); } + private abstract static class SimpleMarshaller implements Marshaller, Unmarshaller { + + public void marshal(Object graph, Result result) throws XmlMappingException, IOException { + fail("Not expected"); + } + + public Object unmarshal(Source source) throws XmlMappingException, IOException { + fail("Not expected"); + return null; + } + + public boolean supports(Class clazz) { + return false; + } + } + }