net.javacrumbs.springws.test.simple.annotation
Class WsMockControlTestExecutionListener

java.lang.Object
  extended by org.springframework.test.context.support.AbstractTestExecutionListener
      extended by net.javacrumbs.springws.test.simple.annotation.WsMockControlTestExecutionListener
All Implemented Interfaces:
org.springframework.test.context.TestExecutionListener

public class WsMockControlTestExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener

Listener alters current application context. It registers ThreadLocalWsMockControlFactoryBean and replaces all WebServiceMessageSenders in all WebServiceTemplates in the application context.

Author:
Lukas Krecan

Constructor Summary
WsMockControlTestExecutionListener()
           
 
Method Summary
 void afterTestMethod(org.springframework.test.context.TestContext testContext)
           
protected  org.springframework.ws.transport.WebServiceMessageSender createMessageSender()
          Creates message sender that will be used for mocking "real" message senders.
protected  java.lang.Object createWsMockControlFactoryBean()
          Creates factory bean that constructs WsMockControls.
 void prepareTestInstance(org.springframework.test.context.TestContext testContext)
           
 
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
beforeTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsMockControlTestExecutionListener

public WsMockControlTestExecutionListener()
Method Detail

prepareTestInstance

public void prepareTestInstance(org.springframework.test.context.TestContext testContext)
                         throws java.lang.Exception
Specified by:
prepareTestInstance in interface org.springframework.test.context.TestExecutionListener
Overrides:
prepareTestInstance in class org.springframework.test.context.support.AbstractTestExecutionListener
Throws:
java.lang.Exception

createMessageSender

protected org.springframework.ws.transport.WebServiceMessageSender createMessageSender()
Creates message sender that will be used for mocking "real" message senders.

Returns:

createWsMockControlFactoryBean

protected java.lang.Object createWsMockControlFactoryBean()
Creates factory bean that constructs WsMockControls. Can be instance of FactoryBean.

Returns:

afterTestMethod

public void afterTestMethod(org.springframework.test.context.TestContext testContext)
                     throws java.lang.Exception
Specified by:
afterTestMethod in interface org.springframework.test.context.TestExecutionListener
Overrides:
afterTestMethod in class org.springframework.test.context.support.AbstractTestExecutionListener
Throws:
java.lang.Exception


Copyright © 2011. All Rights Reserved.