net.javacrumbs.smock.common
Class MessageMatcher

java.lang.Object
  extended by net.javacrumbs.smock.common.MessageMatcher
All Implemented Interfaces:
org.springframework.ws.test.client.RequestMatcher, org.springframework.ws.test.server.ResponseMatcher
Direct Known Subclasses:
TemplateAwareMessageMatcher

public class MessageMatcher
extends Object
implements org.springframework.ws.test.client.RequestMatcher, org.springframework.ws.test.server.ResponseMatcher

Common matching code.

Author:
Lukas Krecan

Field Summary
protected  Source controlMessage
           
 
Constructor Summary
MessageMatcher(Source controlMessage)
           
 
Method Summary
protected  void compare(Source controlMessage, Source messageSource)
          Compares message with control message.
protected  org.custommonkey.xmlunit.Diff createDiff(Source controlMessage, Source messageSource)
          Creates Enhanced Diff.
 Source getControlMessage()
           
 void match(URI uri, org.springframework.ws.WebServiceMessage request)
           
 void match(org.springframework.ws.WebServiceMessage request, org.springframework.ws.WebServiceMessage response)
           
protected  void matchInternal(org.springframework.ws.WebServiceMessage input, org.springframework.ws.WebServiceMessage message)
          Matches document.
protected  Source preprocessControlMessage(org.springframework.ws.WebServiceMessage input)
          Does control message pre-processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlMessage

protected final Source controlMessage
Constructor Detail

MessageMatcher

public MessageMatcher(Source controlMessage)
Method Detail

matchInternal

protected final void matchInternal(org.springframework.ws.WebServiceMessage input,
                                   org.springframework.ws.WebServiceMessage message)
Matches document. If the control document is a SOAP message, whole messages are compared, payloads are compared otherwise.

Parameters:
input -
message -

match

public void match(org.springframework.ws.WebServiceMessage request,
                  org.springframework.ws.WebServiceMessage response)
           throws IOException,
                  AssertionError
Specified by:
match in interface org.springframework.ws.test.server.ResponseMatcher
Throws:
IOException
AssertionError

match

public void match(URI uri,
                  org.springframework.ws.WebServiceMessage request)
           throws IOException,
                  AssertionError
Specified by:
match in interface org.springframework.ws.test.client.RequestMatcher
Throws:
IOException
AssertionError

compare

protected final void compare(Source controlMessage,
                             Source messageSource)
Compares message with control message.

Parameters:
controlMessage -
messageSource -
Throws:
AssertionError

preprocessControlMessage

protected Source preprocessControlMessage(org.springframework.ws.WebServiceMessage input)
Does control message pre-processing. Can be overriden.

Parameters:
input -
controlMessage -
Returns:

createDiff

protected org.custommonkey.xmlunit.Diff createDiff(Source controlMessage,
                                                   Source messageSource)
Creates Enhanced Diff. Can be overriden.

Parameters:
controlMessage -
messageDocument -
Returns:

getControlMessage

public final Source getControlMessage()


Copyright © 2011. All Rights Reserved.