net.javacrumbs.smock.common.client
Class AbstractCommonWebServiceClientTest

java.lang.Object
  extended by net.javacrumbs.smock.common.client.AbstractCommonWebServiceClientTest
Direct Known Subclasses:
AbstractCommonSmockClientTest

public abstract class AbstractCommonWebServiceClientTest
extends Object


Constructor Summary
AbstractCommonWebServiceClientTest()
           
 
Method Summary
 org.springframework.ws.test.client.RequestMatcher anything()
          Expects any request.
 org.springframework.ws.test.client.RequestMatcher connectionTo(String uri)
          Expects a connection to the given URI.
 org.springframework.ws.test.client.RequestMatcher connectionTo(URI uri)
          Expects a connection to the given URI.
 org.springframework.ws.test.client.RequestMatcher payload(org.springframework.core.io.Resource payload)
          Expects the given Resource XML payload.
 org.springframework.ws.test.client.RequestMatcher payload(Source payload)
          Expects the given Source XML payload.
 org.springframework.ws.test.client.RequestMatcher soapHeader(QName soapHeaderName)
          Expects the given SOAP header in the outgoing message.
 org.springframework.ws.test.client.RequestMatcher validPayload(org.springframework.core.io.Resource schema, org.springframework.core.io.Resource... furtherSchemas)
          Expects the payload to validate against the given XSD schema(s).
 org.springframework.ws.test.client.ResponseCreator withClientOrSenderFault(String faultStringOrReason, Locale locale)
          Respond with a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.
 org.springframework.ws.test.client.ResponseCreator withError(String errorMessage)
          Respond with an error.
 org.springframework.ws.test.client.ResponseCreator withException(IOException ioException)
          Respond with an IOException.
 org.springframework.ws.test.client.ResponseCreator withException(RuntimeException ex)
          Respond with an RuntimeException.
 org.springframework.ws.test.client.ResponseCreator withMustUnderstandFault(String faultStringOrReason, Locale locale)
          Respond with a MustUnderstand fault.
 org.springframework.ws.test.client.ResponseCreator withPayload(org.springframework.core.io.Resource payload)
          Respond with the given Resource XML as payload response.
 org.springframework.ws.test.client.ResponseCreator withPayload(Source payload)
          Respond with the given Source XML as payload response.
 org.springframework.ws.test.client.ResponseCreator withServerOrReceiverFault(String faultStringOrReason, Locale locale)
          Respond with a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.
 org.springframework.ws.test.client.ResponseCreator withVersionMismatchFault(String faultStringOrReason, Locale locale)
          Respond with a VersionMismatch fault.
 org.springframework.ws.test.client.RequestXPathExpectations xpath(String xpathExpression)
          Expects the given XPath expression to (not) exist or be evaluated to a value.
 org.springframework.ws.test.client.RequestXPathExpectations 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
 

Constructor Detail

AbstractCommonWebServiceClientTest

public AbstractCommonWebServiceClientTest()
Method Detail

withPayload

public org.springframework.ws.test.client.ResponseCreator withPayload(Source payload)
Respond with the given Source XML as payload response.

Parameters:
payload - the response payload
Returns:
the response callback

withPayload

public org.springframework.ws.test.client.ResponseCreator withPayload(org.springframework.core.io.Resource payload)
                                                               throws IOException
Respond with the given Resource XML as payload response.

Parameters:
payload - the response payload
Returns:
the response callback
Throws:
IOException

withError

public org.springframework.ws.test.client.ResponseCreator withError(String errorMessage)
Respond with an error.

Parameters:
errorMessage - the error message
Returns:
the response callback
See Also:
WebServiceConnection.hasError(), WebServiceConnection.getErrorMessage()

withException

public org.springframework.ws.test.client.ResponseCreator withException(IOException ioException)
Respond with an IOException.

Parameters:
ioException - the exception to be thrown
Returns:
the response callback

withException

public org.springframework.ws.test.client.ResponseCreator withException(RuntimeException ex)
Respond with an RuntimeException.

Parameters:
ex - the runtime exception to be thrown
Returns:
the response callback

withMustUnderstandFault

public org.springframework.ws.test.client.ResponseCreator withMustUnderstandFault(String faultStringOrReason,
                                                                                  Locale locale)
Respond with a MustUnderstand fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addMustUnderstandFault(String, java.util.Locale)

withClientOrSenderFault

public org.springframework.ws.test.client.ResponseCreator withClientOrSenderFault(String faultStringOrReason,
                                                                                  Locale locale)
Respond with a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addClientOrSenderFault(String, Locale)

withServerOrReceiverFault

public org.springframework.ws.test.client.ResponseCreator withServerOrReceiverFault(String faultStringOrReason,
                                                                                    Locale locale)
Respond with a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addServerOrReceiverFault(String, Locale)

withVersionMismatchFault

public org.springframework.ws.test.client.ResponseCreator withVersionMismatchFault(String faultStringOrReason,
                                                                                   Locale locale)
Respond with a VersionMismatch fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addVersionMismatchFault(String, Locale)

anything

public org.springframework.ws.test.client.RequestMatcher anything()
Expects any request.

Returns:
the request matcher

payload

public org.springframework.ws.test.client.RequestMatcher payload(Source payload)
Expects the given Source XML payload.

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

payload

public org.springframework.ws.test.client.RequestMatcher payload(org.springframework.core.io.Resource payload)
                                                          throws IOException
Expects the given Resource XML payload.

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

validPayload

public org.springframework.ws.test.client.RequestMatcher validPayload(org.springframework.core.io.Resource schema,
                                                                      org.springframework.core.io.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 request matcher
Throws:
IOException

xpath

public org.springframework.ws.test.client.RequestXPathExpectations 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 org.springframework.ws.test.client.RequestXPathExpectations 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

soapHeader

public org.springframework.ws.test.client.RequestMatcher 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

connectionTo

public org.springframework.ws.test.client.RequestMatcher connectionTo(String uri)
Expects a connection to the given URI.

Parameters:
uri - the String uri expected to connect to
Returns:
the request matcher

connectionTo

public org.springframework.ws.test.client.RequestMatcher connectionTo(URI uri)
Expects a connection to the given URI.

Parameters:
uri - the String uri expected to connect to
Returns:
the request matcher


Copyright © 2011. All Rights Reserved.