Class XmlTestExecutingEndpointAdapter
java.lang.Object
org.citrusframework.endpoint.AbstractEndpointAdapter
org.citrusframework.endpoint.adapter.StaticEndpointAdapter
org.citrusframework.endpoint.adapter.RequestDispatchingEndpointAdapter
org.citrusframework.endpoint.adapter.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates Citrus Spring bean application context with basic beans and settings for Citrus.protected org.springframework.context.support.ClassPathXmlApplicationContextcreateApplicationContext(TestContext context, String packageName, String testName) Creates the Spring application context.dispatchMessage(Message request, String mappingName) org.springframework.context.ApplicationContextGets the application context.Gets default test case package.Gets the response generating endpoint adapter delegate.org.springframework.core.task.TaskExecutorGets the task executor.protected TestCasegetTestCase(TestContext context, String testName) Gets the test case from application context.protected voidprepareExecution(Message request, TestCase testCase) Prepares the test builder instance before execution.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Injects Spring bean application context this adapter is managed by.voidsetBeanName(String name) Injects this adapters bean name.voidsetPackageName(String packageName) Sets default test case package.voidsetResponseEndpointAdapter(EndpointAdapter endpointAdapterDelegate) Sets the response generating endpoint adapter delegate.voidsetTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) Sets the task executor.Methods inherited from class org.citrusframework.endpoint.adapter.RequestDispatchingEndpointAdapter
getMappingKeyExtractor, getMappingStrategy, handleMessageInternal, setMappingKeyExtractor, setMappingStrategyMethods inherited from class org.citrusframework.endpoint.adapter.StaticEndpointAdapter
getEndpoint, getEndpointConfigurationMethods inherited from class org.citrusframework.endpoint.AbstractEndpointAdapter
getFallbackEndpointAdapter, getName, getTestContext, getTestContextFactory, handleMessage, setFallbackEndpointAdapter, setName, setTestContextFactory
-
Constructor Details
-
XmlTestExecutingEndpointAdapter
public XmlTestExecutingEndpointAdapter()
-
-
Method Details
-
dispatchMessage
- Overrides:
dispatchMessagein classRequestDispatchingEndpointAdapter
-
getTestCase
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
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
Creates Citrus Spring bean application context with basic beans and settings for Citrus.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
setBeanName
Injects this adapters bean name.- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- Parameters:
name-
-
getPackageName
Gets default test case package.- Returns:
-
setPackageName
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
Gets the response generating endpoint adapter delegate.- Returns:
-
setResponseEndpointAdapter
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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext-- Throws:
org.springframework.beans.BeansException
-