This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,6 @@ package org.springframework.ws.soap.server.endpoint.interceptor;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.Locale;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.soap.MessageFactory;
|
||||
@@ -37,8 +36,6 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.ws.MockWebServiceMessage;
|
||||
import org.springframework.ws.MockWebServiceMessageFactory;
|
||||
import org.springframework.ws.WebServiceMessage;
|
||||
import org.springframework.ws.transport.TransportInputStream;
|
||||
import org.springframework.ws.transport.MockTransportInputStream;
|
||||
import org.springframework.ws.context.DefaultMessageContext;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.soap.SoapMessage;
|
||||
@@ -49,6 +46,8 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
|
||||
import org.springframework.ws.soap.saaj.support.SaajUtils;
|
||||
import org.springframework.ws.soap.soap11.Soap11Fault;
|
||||
import org.springframework.ws.soap.soap12.Soap12Fault;
|
||||
import org.springframework.ws.transport.MockTransportInputStream;
|
||||
import org.springframework.ws.transport.TransportInputStream;
|
||||
import org.springframework.xml.xsd.SimpleXsdSchema;
|
||||
|
||||
public class PayloadValidatingInterceptorTest extends XMLTestCase {
|
||||
@@ -282,12 +281,13 @@ public class PayloadValidatingInterceptorTest extends XMLTestCase {
|
||||
interceptor.handleRequestValidationErrors(messageContext, exceptions);
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
messageContext.getResponse().writeTo(os);
|
||||
assertXMLEqual("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
|
||||
"<soapenv:Body>" + "<soapenv:Fault>" + "<faultcode>soapenv:Client</faultcode>" +
|
||||
"<faultstring xml:lang='en'>Validation error</faultstring>" + "<detail>" +
|
||||
"<spring-ws:ValidationError xmlns:spring-ws=\"http://springframework.org/spring-ws\">Message 1</spring-ws:ValidationError>" +
|
||||
"<spring-ws:ValidationError xmlns:spring-ws=\"http://springframework.org/spring-ws\">Message 2</spring-ws:ValidationError>" +
|
||||
"</detail>" + "</soapenv:Fault>" + "</soapenv:Body>" + "</soapenv:Envelope>", os.toString());
|
||||
assertXMLEqual(
|
||||
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soapenv:Body>" +
|
||||
"<soapenv:Fault>" + "<faultcode>soapenv:Client</faultcode>" +
|
||||
"<faultstring xml:lang='en'>Validation error</faultstring>" + "<detail>" +
|
||||
"<spring-ws:ValidationError xmlns:spring-ws=\"http://springframework.org/spring-ws\">Message 1</spring-ws:ValidationError>" +
|
||||
"<spring-ws:ValidationError xmlns:spring-ws=\"http://springframework.org/spring-ws\">Message 2</spring-ws:ValidationError>" +
|
||||
"</detail>" + "</soapenv:Fault>" + "</soapenv:Body>" + "</soapenv:Envelope>", os.toString());
|
||||
|
||||
}
|
||||
|
||||
@@ -310,7 +310,6 @@ public class PayloadValidatingInterceptorTest extends XMLTestCase {
|
||||
public void testAxiom() throws Exception {
|
||||
AxiomSoapMessageFactory messageFactory = new AxiomSoapMessageFactory();
|
||||
messageFactory.setPayloadCaching(true);
|
||||
interceptor.setValidateRequest(true);
|
||||
messageFactory.afterPropertiesSet();
|
||||
|
||||
PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
|
||||
@@ -320,9 +319,9 @@ public class PayloadValidatingInterceptorTest extends XMLTestCase {
|
||||
Resource resource = new ClassPathResource("axiom.xml", getClass());
|
||||
TransportInputStream tis = new MockTransportInputStream(resource.getInputStream());
|
||||
WebServiceMessage message = messageFactory.createWebServiceMessage(tis);
|
||||
MessageContext messageContext = new DefaultMessageContext(message, messageFactory);
|
||||
MessageContext messageContext = new DefaultMessageContext(message, messageFactory);
|
||||
interceptor.handleRequest(messageContext, null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user