Spring Web Services Framework

org.springframework.ws.test.server
Class ResponseMatchers

java.lang.Object
  extended by org.springframework.ws.test.server.ResponseMatchers

public abstract class ResponseMatchers
extends Object

Factory methods for ResponseMatcher classes. Typically used to provide input for ResponseActions.andExpect(ResponseMatcher).

Since:
2.0
Author:
Arjen Poutsma

Method Summary
static ResponseMatcher clientOrSenderFault()
          Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.
static ResponseMatcher clientOrSenderFault(String faultStringOrReason)
          Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault with a particular fault string or reason.
static ResponseMatcher mustUnderstandFault()
          Expects a MustUnderstand fault.
static ResponseMatcher mustUnderstandFault(String faultStringOrReason)
          Expects a MustUnderstand fault with a particular fault string or reason.
static ResponseMatcher noFault()
          Expects the response not to contain a SOAP fault.
static ResponseMatcher payload(Resource payload)
          Expects the given Resource XML payload.
static ResponseMatcher payload(Source payload)
          Expects the given Source XML payload.
static ResponseMatcher serverOrReceiverFault()
          Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.
static ResponseMatcher serverOrReceiverFault(String faultStringOrReason)
          Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault with a particular fault string or reason.
static ResponseMatcher soapEnvelope(Resource soapEnvelope)
          Expects the given Resource XML SOAP envelope.
static ResponseMatcher soapEnvelope(Source soapEnvelope)
          Expects the given Source XML SOAP envelope.
static ResponseMatcher soapHeader(QName soapHeaderName)
          Expects the given SOAP header in the outgoing message.
static ResponseMatcher validPayload(Resource schema, Resource... furtherSchemas)
          Expects the payload to validate against the given XSD schema(s).
static ResponseMatcher versionMismatchFault()
          Expects a VersionMismatch fault.
static ResponseMatcher versionMismatchFault(String faultStringOrReason)
          Expects a VersionMismatch fault with a particular fault string or reason.
static ResponseXPathExpectations xpath(String xpathExpression)
          Expects the given XPath expression to (not) exist or be evaluated to a value.
static ResponseXPathExpectations xpath(String xpathExpression, Map<String,String> namespaceMapping)
          Expects the given XPath expression to (not) exist or be evaluated to a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

payload

public static ResponseMatcher payload(Source payload)
Expects the given Source XML payload.

Parameters:
payload - the XML payload
Returns:
the response matcher

payload

public static ResponseMatcher payload(Resource payload)
                               throws IOException
Expects the given Resource XML payload.

Parameters:
payload - the XML payload
Returns:
the response matcher
Throws:
IOException

validPayload

public static ResponseMatcher validPayload(Resource schema,
                                           Resource... furtherSchemas)
                                    throws IOException
Expects the payload to validate against the given XSD schema(s).

Parameters:
schema - the schema
furtherSchemas - further schemas, if necessary
Returns:
the response matcher
Throws:
IOException

xpath

public static ResponseXPathExpectations xpath(String xpathExpression)
Expects the given XPath expression to (not) exist or be evaluated to a value.

Parameters:
xpathExpression - the XPath expression
Returns:
the XPath expectations, to be further configured

xpath

public static ResponseXPathExpectations xpath(String xpathExpression,
                                              Map<String,String> namespaceMapping)
Expects the given XPath expression to (not) exist or be evaluated to a value.

Parameters:
xpathExpression - the XPath expression
namespaceMapping - the namespaces
Returns:
the XPath expectations, to be further configured

soapEnvelope

public static ResponseMatcher soapEnvelope(Source soapEnvelope)
Expects the given Source XML SOAP envelope.

Parameters:
soapEnvelope - the XML SOAP envelope
Returns:
the response matcher
Since:
2.1.1

soapEnvelope

public static ResponseMatcher soapEnvelope(Resource soapEnvelope)
                                    throws IOException
Expects the given Resource XML SOAP envelope.

Parameters:
soapEnvelope - the XML SOAP envelope
Returns:
the response matcher
Throws:
IOException
Since:
2.1.1

soapHeader

public static ResponseMatcher soapHeader(QName soapHeaderName)
Expects the given SOAP header in the outgoing message.

Parameters:
soapHeaderName - the qualified name of the SOAP header to expect
Returns:
the request matcher

noFault

public static ResponseMatcher noFault()
Expects the response not to contain a SOAP fault.

Returns:
the response matcher

mustUnderstandFault

public static ResponseMatcher mustUnderstandFault()
Expects a MustUnderstand fault.

See Also:
SoapBody.addMustUnderstandFault(String, Locale)

mustUnderstandFault

public static ResponseMatcher mustUnderstandFault(String faultStringOrReason)
Expects a MustUnderstand fault with a particular fault string or reason.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
See Also:
SoapBody.addMustUnderstandFault(String, Locale)

clientOrSenderFault

public static ResponseMatcher clientOrSenderFault()
Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.

See Also:
SoapBody.addClientOrSenderFault(String, Locale)

clientOrSenderFault

public static ResponseMatcher clientOrSenderFault(String faultStringOrReason)
Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault with a particular fault string or reason.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
See Also:
SoapBody.addClientOrSenderFault(String, Locale)

serverOrReceiverFault

public static ResponseMatcher serverOrReceiverFault()
Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.

See Also:
SoapBody.addServerOrReceiverFault(String, java.util.Locale)

serverOrReceiverFault

public static ResponseMatcher serverOrReceiverFault(String faultStringOrReason)
Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault with a particular fault string or reason.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
See Also:
SoapBody.addClientOrSenderFault(String, Locale)

versionMismatchFault

public static ResponseMatcher versionMismatchFault()
Expects a VersionMismatch fault.

See Also:
SoapBody.addVersionMismatchFault(String, java.util.Locale)

versionMismatchFault

public static ResponseMatcher versionMismatchFault(String faultStringOrReason)
Expects a VersionMismatch fault with a particular fault string or reason.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
See Also:
SoapBody.addClientOrSenderFault(String, Locale)

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.