net.javacrumbs.smock.common.server
Class ServerTestHelper

java.lang.Object
  extended by net.javacrumbs.smock.common.SmockCommon
      extended by net.javacrumbs.smock.common.server.CommonSmockServer
          extended by net.javacrumbs.smock.common.server.ServerTestHelper

public class ServerTestHelper
extends CommonSmockServer

Helper class that simplifies WS server unit tests.

Author:
Lukas Krecan

Constructor Summary
ServerTestHelper()
           
 
Method Summary
static
<T> T
createRequest(org.springframework.ws.test.server.RequestCreator requestCreator, Class<T> targetClass)
          Deserializes message created by the MessageCreator to the targetClass.
static
<T> T
createRequest(Source messageSource, Class<T> targetClass)
          Deserializes message loaded from messageSource to the targetClass.
static
<T> T
createRequest(String messageLocation, Class<T> targetClass)
          Deserializes message loaded from messageLocation to the targetClass.
static MessageHelper getMessageHelper()
           
static org.springframework.ws.WebServiceMessage serialize(Object object)
          Serializes object to WebServiceMessage.
static void setMessageHelper(MessageHelper messageHelper)
           
static org.springframework.ws.test.server.ResponseActions validate(org.springframework.ws.context.MessageContext messageContext)
          Creates validator based on the MessageContext.
static org.springframework.ws.test.server.ResponseActions validate(Object response)
          Creates validator based on the response.
static org.springframework.ws.test.server.ResponseActions validate(Object response, Object request)
          Creates validator based on the response and request.
 
Methods inherited from class net.javacrumbs.smock.common.server.CommonSmockServer
message, message, message, message, withMessage, withMessage, withMessage, withMessage
 
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

ServerTestHelper

public ServerTestHelper()
Method Detail

createRequest

public static <T> T createRequest(String messageLocation,
                                  Class<T> targetClass)
Deserializes message loaded from messageLocation to the targetClass.

Type Parameters:
T -
Parameters:
messageSourceLocation -
targetClass -
Returns:

createRequest

public static <T> T createRequest(Source messageSource,
                                  Class<T> targetClass)
Deserializes message loaded from messageSource to the targetClass.

Type Parameters:
T -
Parameters:
messageSource -
targetClass -
Returns:

createRequest

public static <T> T createRequest(org.springframework.ws.test.server.RequestCreator requestCreator,
                                  Class<T> targetClass)
Deserializes message created by the MessageCreator to the targetClass.

Type Parameters:
T -
Parameters:
requestCreator -
targetClass -
Returns:

serialize

public static org.springframework.ws.WebServiceMessage serialize(Object object)
Serializes object to WebServiceMessage.

Parameters:
object -
Returns:

validate

public static org.springframework.ws.test.server.ResponseActions validate(Object response)
Creates validator based on the response.

Parameters:
response -
Returns:

validate

public static org.springframework.ws.test.server.ResponseActions validate(Object response,
                                                                          Object request)
Creates validator based on the response and request. Use this method if your ResponseMatchers need to read data from request.

Parameters:
response -
request -
Returns:

validate

public static org.springframework.ws.test.server.ResponseActions validate(org.springframework.ws.context.MessageContext messageContext)
Creates validator based on the MessageContext.

Parameters:
messageContext -
Returns:

getMessageHelper

public static MessageHelper getMessageHelper()

setMessageHelper

public static void setMessageHelper(MessageHelper messageHelper)


Copyright © 2011. All Rights Reserved.