net.javacrumbs.smock.common.server
Class AbstractCommonSmockServerTest

java.lang.Object
  extended by net.javacrumbs.smock.common.server.AbstractCommonWebServiceServerTest
      extended by net.javacrumbs.smock.common.server.AbstractCommonSmockServerTest

public abstract class AbstractCommonSmockServerTest
extends AbstractCommonWebServiceServerTest

Extends AbstractCommonWebServiceServerTest and adds Smock specific methods.

Author:
Lukas Krecan

Constructor Summary
AbstractCommonSmockServerTest()
           
 
Method Summary
 Source fromResource(String location)
          Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).
 ParametrizableResponseMatcher message(Document message)
          Expects the given message.
 ParametrizableResponseMatcher message(org.springframework.core.io.Resource messageResource)
          Expects the given message.
 ParametrizableResponseMatcher message(Source content)
          Expects the given message.
 ParametrizableResponseMatcher message(String messageResource)
          Expects the given message.
 org.springframework.core.io.Resource resource(String location)
          Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
          Sets the resource loader to be used.
 void setTemplateProcessor(TemplateProcessor templateProcessor)
          Sets TemplateProcessor used by Smock.
 ParametrizableRequestCreator withMessage(Document message)
          Create a request with the given Document XML as content.
 ParametrizableRequestCreator withMessage(org.springframework.core.io.Resource messageResource)
          Create a request with the given Resource as content.
 ParametrizableRequestCreator withMessage(Source message)
          Create a request with the given Source XML as content.
 ParametrizableRequestCreator withMessage(String messageResource)
          Create a request with the given Resource as content.
 
Methods inherited from class net.javacrumbs.smock.common.server.AbstractCommonWebServiceServerTest
clientOrSenderFault, clientOrSenderFault, mustUnderstandFault, mustUnderstandFault, noFault, payload, payload, serverOrReceiverFault, serverOrReceiverFault, soapHeader, validPayload, versionMismatchFault, versionMismatchFault, withPayload, withPayload, xpath, xpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommonSmockServerTest

public AbstractCommonSmockServerTest()
Method Detail

setTemplateProcessor

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

Parameters:
templateProcessor -

setResourceLoader

public 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 Source fromResource(String location)
Loads resource using resourceLoader set by setResourceLoader(ResourceLoader).

Parameters:
location - Location of the resource

resource

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

Parameters:
location - Location of the resource

withMessage

public ParametrizableRequestCreator withMessage(String messageResource)
Create a request with the given Resource as content. If the content is payload it will be wrapped into a SOAP, if the content contains the whole message, it will be used as it is. Supports templates that will be resolved by TemplateProcessor.

Parameters:
payload - the request payload
Returns:
the request creator

withMessage

public ParametrizableRequestCreator withMessage(org.springframework.core.io.Resource messageResource)
Create a request with the given Resource as content. If the content is payload it will be wrapped into a SOAP, if the content contains the whole message, it will be used as it is. Supports templates that will be resolved by TemplateProcessor.

Parameters:
payload - the request payload
Returns:
the request creator

withMessage

public ParametrizableRequestCreator withMessage(Source message)
Create a request with the given Source XML as content. If the content is payload it will be wrapped into a SOAP, if the content contains the whole message, it will be used as it is. Supports templates that will be resolved by TemplateProcessor.

Parameters:
message -
Returns:
the request creator

withMessage

public ParametrizableRequestCreator withMessage(Document message)
Create a request with the given Document XML as content. If the content is payload it will be wrapped into a SOAP, if the content contains the whole message, it will be used as it is. Supports templates that will be resolved by TemplateProcessor.

Parameters:
message -
Returns:
the request creator

message

public ParametrizableResponseMatcher message(String messageResource)
Expects the given message. If the message contains only payload, only the payloads will be compared. If it contains whole message, whole messages will be compared. Control message can be preprocessed by TemplateProcessor.

Parameters:
message -
Returns:
the request creator

message

public ParametrizableResponseMatcher message(org.springframework.core.io.Resource messageResource)
Expects the given message. If the message contains only payload, only the payloads will be compared. If it contains whole message, whole messages will be compared. Control message can be preprocessed by TemplateProcessor.

Parameters:
message -
Returns:
the request creator

message

public ParametrizableResponseMatcher message(Source content)
Expects the given message. If the message contains only payload, only the payloads will be compared. If it contains whole message, whole messages will be compared. Control message can be preprocessed by TemplateProcessor.

Parameters:
content -
Returns:

message

public ParametrizableResponseMatcher message(Document message)
Expects the given message. If the message contains only payload, only the payloads will be compared. If it contains whole message, whole messages will be compared. Control message can be preprocessed by TemplateProcessor.

Parameters:
message -
Returns:


Copyright © 2011. All Rights Reserved.