Refactored SAAJ implementation from two separate class hierarchies (SAAJ 1.2 and SAAJ 1.3) into one single hierarchy, using bridge pattern (SaajImplementation).
This commit is contained in:
@@ -35,8 +35,8 @@ import org.springframework.ws.context.DefaultMessageContext;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.soap.SoapMessage;
|
||||
import org.springframework.ws.soap.SoapVersion;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
|
||||
import org.springframework.ws.soap.saaj.saaj13.Saaj13SoapMessage;
|
||||
import org.springframework.ws.soap.saaj.support.SaajUtils;
|
||||
import org.springframework.ws.soap.soap11.Soap11Fault;
|
||||
import org.springframework.ws.soap.soap12.Soap12Fault;
|
||||
@@ -49,8 +49,6 @@ public class PayloadValidatingInterceptorTest extends TestCase {
|
||||
|
||||
private SaajSoapMessageFactory soap11Factory;
|
||||
|
||||
private MessageFactory messageFactory;
|
||||
|
||||
private SaajSoapMessageFactory soap12Factory;
|
||||
|
||||
private Transformer transformer;
|
||||
@@ -178,7 +176,7 @@ public class PayloadValidatingInterceptorTest extends TestCase {
|
||||
MessageFactory messageFactory = MessageFactory.newInstance();
|
||||
SOAPMessage saajMessage =
|
||||
SaajUtils.loadMessage(new ClassPathResource("validSoapMessage.xml", getClass()), messageFactory);
|
||||
context = new DefaultMessageContext(new Saaj13SoapMessage(saajMessage),
|
||||
context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
|
||||
new SaajSoapMessageFactory(messageFactory));
|
||||
|
||||
boolean result = interceptor.handleRequest(context, null);
|
||||
|
||||
@@ -28,8 +28,8 @@ import junit.framework.TestCase;
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.ws.context.DefaultMessageContext;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
|
||||
import org.springframework.ws.soap.saaj.saaj13.Saaj13SoapMessage;
|
||||
import org.springframework.ws.soap.soap11.Soap11Fault;
|
||||
import org.springframework.ws.soap.soap12.Soap12Fault;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setMustUnderstand(true);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(true);
|
||||
@@ -82,7 +82,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setRole(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_2_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(true);
|
||||
@@ -105,7 +105,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setMustUnderstand(true);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(false);
|
||||
@@ -138,7 +138,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setRole(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_2_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(false);
|
||||
@@ -178,7 +178,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setMustUnderstand(true);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(true);
|
||||
@@ -202,7 +202,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
header.setMustUnderstand(true);
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_2_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorMock.understands(null);
|
||||
interceptorControl.setMatcher(MockControl.ALWAYS_MATCHER);
|
||||
interceptorControl.setReturnValue(true);
|
||||
@@ -222,7 +222,7 @@ public class SoapMessageDispatcherTest extends TestCase {
|
||||
request.getSOAPHeader().detachNode();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(request), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(request), factory);
|
||||
interceptorControl.replay();
|
||||
|
||||
SoapEndpointInvocationChain chain = new SoapEndpointInvocationChain(new Object(),
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.soap.SoapMessage;
|
||||
import org.springframework.ws.soap.SoapMessageException;
|
||||
import org.springframework.ws.soap.SoapVersion;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
|
||||
import org.springframework.ws.soap.saaj.saaj13.Saaj13SoapMessage;
|
||||
import org.springframework.ws.soap.soap11.Soap11Fault;
|
||||
import org.springframework.ws.soap.soap12.Soap12Fault;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SoapFaultMappingExceptionResolverTest extends XMLTestCase {
|
||||
SOAPMessage message = messageFactory.createMessage();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(message), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);
|
||||
|
||||
boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
|
||||
assertTrue("resolveException returns false", result);
|
||||
@@ -87,7 +87,7 @@ public class SoapFaultMappingExceptionResolverTest extends XMLTestCase {
|
||||
SOAPMessage message = messageFactory.createMessage();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_2_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(message), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);
|
||||
|
||||
boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
|
||||
assertTrue("resolveException returns false", result);
|
||||
@@ -111,7 +111,7 @@ public class SoapFaultMappingExceptionResolverTest extends XMLTestCase {
|
||||
SOAPMessage message = messageFactory.createMessage();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(message), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);
|
||||
|
||||
boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
|
||||
assertTrue("resolveException returns false", result);
|
||||
@@ -135,7 +135,7 @@ public class SoapFaultMappingExceptionResolverTest extends XMLTestCase {
|
||||
SOAPMessage message = messageFactory.createMessage();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_2_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(message), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);
|
||||
|
||||
boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
|
||||
assertTrue("resolveException returns false", result);
|
||||
@@ -161,7 +161,7 @@ public class SoapFaultMappingExceptionResolverTest extends XMLTestCase {
|
||||
SOAPMessage message = messageFactory.createMessage();
|
||||
factory.setSoapProtocol(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
factory.afterPropertiesSet();
|
||||
MessageContext context = new DefaultMessageContext(new Saaj13SoapMessage(message), factory);
|
||||
MessageContext context = new DefaultMessageContext(new SaajSoapMessage(message), factory);
|
||||
|
||||
boolean result = resolver.resolveException(context, null, new IllegalArgumentException("bla"));
|
||||
assertTrue("resolveException returns false", result);
|
||||
|
||||
Reference in New Issue
Block a user