net.javacrumbs.smock.common.client
Class AbstractCommonSmockClientTest

java.lang.Object
  extended by net.javacrumbs.smock.common.client.AbstractCommonWebServiceClientTest
      extended by net.javacrumbs.smock.common.client.AbstractCommonSmockClientTest

public abstract class AbstractCommonSmockClientTest
extends AbstractCommonWebServiceClientTest

Extends AbstractWebServiceClientTest and gives access to Smock specific methods.

Author:
Lukas Krecan

Constructor Summary
AbstractCommonSmockClientTest()
           
 
Method Summary
static Source fromResource(String location)
          Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).
 ParametrizableRequestMatcher message(Document message)
          Expects the given Source XML message.
 ParametrizableRequestMatcher message(org.springframework.core.io.Resource message)
          Expects the given Resource XML message.
 ParametrizableRequestMatcher message(Source message)
          Expects the given Source XML message.
 ParametrizableRequestMatcher message(String location)
          Expects the given XML message loaded from resource with given name.
static org.springframework.core.io.Resource resource(String location)
          Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).
static void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
          Sets the resource loader to be used.
static void setTemplateProcessor(TemplateProcessor templateProcessor)
          Sets TemplateProcessor used by Smock.
 ParametrizableResponseCreator withMessage(org.springframework.core.io.Resource message)
          Respond with the given XML loaded from resource as response.
 ParametrizableResponseCreator withMessage(Source message)
          Respond with the given Source XML as response.
 ParametrizableResponseCreator withMessage(String location)
          Respond with the given XML loaded from resource as response.
 
Methods inherited from class net.javacrumbs.smock.common.client.AbstractCommonWebServiceClientTest
anything, connectionTo, connectionTo, payload, payload, soapHeader, validPayload, withClientOrSenderFault, withError, withException, withException, withMustUnderstandFault, withPayload, withPayload, withServerOrReceiverFault, withVersionMismatchFault, xpath, xpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommonSmockClientTest

public AbstractCommonSmockClientTest()
Method Detail

setTemplateProcessor

public static void setTemplateProcessor(TemplateProcessor templateProcessor)
Sets TemplateProcessor used by Smock.

Parameters:
templateProcessor -

setResourceLoader

public static void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Sets the resource loader to be used. Be aware that it sets a static variable so it will be used by other tests too.

Parameters:
resourceLoader -

fromResource

public static Source fromResource(String location)
Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).

Parameters:
location - Location of the resource

resource

public static org.springframework.core.io.Resource resource(String location)
Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).

Parameters:
location - Location of the resource

message

public 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.

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

message

public 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.

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

message

public 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.

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

message

public 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.

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

withMessage

public 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.

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

withMessage

public 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.

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

withMessage

public 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.

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


Copyright © 2011. All Rights Reserved.