Class XmlTestExecutingEndpointAdapter

All Implemented Interfaces:
EndpointAdapter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
TestBehaviorExecutingEndpointAdapter

public class XmlTestExecutingEndpointAdapter extends RequestDispatchingEndpointAdapter implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware
Special request dispatching endpoint adapter invokes XML test case for each incoming message. Incoming message is passed to test case via normal in memory message queue connection as usual.
Since:
1.4
Author:
Christoph Deppisch
  • Constructor Details

    • XmlTestExecutingEndpointAdapter

      public XmlTestExecutingEndpointAdapter()
  • Method Details

    • dispatchMessage

      public Message dispatchMessage(Message request, String mappingName)
      Overrides:
      dispatchMessage in class RequestDispatchingEndpointAdapter
    • getTestCase

      protected TestCase getTestCase(TestContext context, String testName)
      Gets the test case from application context.
      Parameters:
      context -
      testName -
      Returns:
      the new test case.
    • createApplicationContext

      protected org.springframework.context.support.ClassPathXmlApplicationContext createApplicationContext(TestContext context, String packageName, String testName)
      Creates the Spring application context.
      Returns:
    • prepareExecution

      protected void prepareExecution(Message request, TestCase testCase)
      Prepares the test builder instance before execution. Subclasses may add custom properties to teest builder here.
      Parameters:
      request - the triggering request message.
      testCase - the found test builder.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Creates Citrus Spring bean application context with basic beans and settings for Citrus.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • setBeanName

      public void setBeanName(String name)
      Injects this adapters bean name.
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
      Parameters:
      name -
    • getPackageName

      public String getPackageName()
      Gets default test case package.
      Returns:
    • setPackageName

      public void setPackageName(String packageName)
      Sets default test case package.
      Parameters:
      packageName -
    • getTaskExecutor

      public org.springframework.core.task.TaskExecutor getTaskExecutor()
      Gets the task executor.
      Returns:
    • setTaskExecutor

      public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
      Sets the task executor. Usually some async task executor for test execution in separate thread instance.
      Parameters:
      taskExecutor -
    • getResponseEndpointAdapter

      public EndpointAdapter getResponseEndpointAdapter()
      Gets the response generating endpoint adapter delegate.
      Returns:
    • setResponseEndpointAdapter

      public void setResponseEndpointAdapter(EndpointAdapter endpointAdapterDelegate)
      Sets the response generating endpoint adapter delegate.
      Parameters:
      endpointAdapterDelegate -
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      Gets the application context.
      Returns:
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Injects Spring bean application context this adapter is managed by.
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Parameters:
      applicationContext -
      Throws:
      org.springframework.beans.BeansException