net.javacrumbs.smock.common.client
Class CommonSmockClient

java.lang.Object
  extended by net.javacrumbs.smock.common.SmockCommon
      extended by net.javacrumbs.smock.common.client.CommonSmockClient
Direct Known Subclasses:
ClientTestHelper

public abstract class CommonSmockClient
extends SmockCommon

Adds extra features to Spring WS client test support.

Author:
Lukas Krecan

Constructor Summary
CommonSmockClient()
           
 
Method Summary
static ParametrizableRequestMatcher message(Document message)
          Expects the given Source XML message.
static ParametrizableRequestMatcher message(org.springframework.core.io.Resource message)
          Expects the given Resource XML message.
static ParametrizableRequestMatcher message(Source message)
          Expects the given Source XML message.
static ParametrizableRequestMatcher message(String location)
          Expects the given XML message loaded from resource with given name.
static ParametrizableResponseCreator withMessage(Document message)
          Respond with the given Document XML as response.
static ParametrizableResponseCreator withMessage(org.springframework.core.io.Resource message)
          Respond with the given XML loaded from resource as response.
static ParametrizableResponseCreator withMessage(Source message)
          Respond with the given Source XML as response.
static ParametrizableResponseCreator withMessage(String location)
          Respond with the given XML loaded from resource as response.
 
Methods inherited from class net.javacrumbs.smock.common.SmockCommon
createMessageFactory, createMessageFactory, createMessageFactory, createSource, fromResource, getResourceLoader, getTemplateProcessor, loadDocument, resource, setResourceLoader, setTemplateProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonSmockClient

public CommonSmockClient()
Method Detail

message

public static ParametrizableRequestMatcher message(String location)
Expects the given XML message loaded from resource with given name. Message can either be whole SOAP message or just a payload. If only payload is passed in, only payloads will be compared, otherwise whole message will be compared. Message will be preprocessed by TemplateProcessor.

Parameters:
location - of the resource where the message is stored.
Returns:
the request matcher

message

public static ParametrizableRequestMatcher message(org.springframework.core.io.Resource message)
Expects the given Resource XML message. Message can either be whole SOAP message or just a payload. If only payload is passed in, only payloads will be compared, otherwise whole message will be compared. Message will be preprocessed by TemplateProcessor.

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

message

public static ParametrizableRequestMatcher message(Source message)
Expects the given Source XML message. Message can either be whole SOAP message or just a payload. If only payload is passed in, only payloads will be compared, otherwise whole message will be compared. Message will be preprocessed by TemplateProcessor.

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

message

public static ParametrizableRequestMatcher message(Document message)
Expects the given Source XML message. Message can either be whole SOAP message or just a payload. If only payload is passed in, only payloads will be compared, otherwise whole message will be compared. Message will be preprocessed by TemplateProcessor.

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

withMessage

public static ParametrizableResponseCreator withMessage(String location)
Respond with the given XML loaded from resource as response. If message is SOAP, it will be returned as response, if message is payload, it will be wrapped into a SOAP. Message will be preprocessed by TemplateProcessor.

Parameters:
loaction - of the resource
Returns:
the response callback

withMessage

public static ParametrizableResponseCreator withMessage(org.springframework.core.io.Resource message)
Respond with the given XML loaded from resource as response. If message is SOAP, it will be returned as response, if message is payload, it will be wrapped into a SOAP. Message will be preprocessed by TemplateProcessor.

Parameters:
loaction - of the resource
Returns:
the response callback

withMessage

public static ParametrizableResponseCreator withMessage(Source message)
Respond with the given Source XML as response. If message is SOAP, it will be returned as response, if message is payload, it will be wrapped into a SOAP. Message will be preprocessed by TemplateProcessor.

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

withMessage

public static ParametrizableResponseCreator withMessage(Document message)
Respond with the given Document XML as response. If message is SOAP, it will be returned as response, if message is payload, it will be wrapped into a SOAP. Message will be preprocessed by TemplateProcessor.

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


Copyright © 2011. All Rights Reserved.