public class ConnectorTestCase
extends org.mule.tck.junit4.FunctionalTestCase
| Modifier and Type | Field and Description |
|---|---|
protected static Properties |
automationCredentials |
protected static String |
DEFAULT_SPRING_CONFIG_FILE |
protected static List<String> |
SPRING_CONFIG_FILES |
| Constructor and Description |
|---|
ConnectorTestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addConfigSpringFile(String fileLocation)
Add a file to be loaded on the spring context.
|
void |
assertFirstLevelInputMetaDataSuccess(String flowName,
org.mule.common.metadata.datatype.DataType expectedDataType)
Asserts first level input MetaData was successfully retrieved for the processor under test and matches an expectedDataType
|
void |
assertFirstLevelOutputMetaDataSuccess(String flowName,
org.mule.common.metadata.datatype.DataType expectedDataType)
Asserts first level output MetaData was successfully retrieved for the processor under test and matches an expectedDataType
|
void |
assertGetMetaDataKeysSuccess(String configName)
Asserts successful getMetaDataKeys result
|
void |
assertIsMetaDataEnabled(String flowName)
Asserts processor contained in an automation-test-flows.xml flow is MetaDataEnabled
|
void |
assertListFirstLevelOutputMetaDataSuccess(String flowName,
String expectedImplementationType)
Asserts first level List output MetaData was successfully retrieved for the processor under test and it's elements are of specific class
|
void |
assertMetaDataKeysContainsKeys(String configName,
List<HashMap<String,String>> expectedMetaDataKeyList)
Asserts selected MetaDataKeys are found among connector MetaDataKeys and their contents are correct
|
void |
assertNotMetaDataEnabled(String flowName)
Asserts processor contained in an automation-test-flows.xml flow is not MetaDataEnabled
|
void |
assertNullInputMetaDataSuccess(String flowName)
Asserts no input MetaData for the processor under test
|
void |
assertNullOutputMetaDataSuccess(String flowName)
Asserts no output MetaData for the processor under test
|
void |
assertPOJOOutputMetaDataSuccess(String flowName,
String expectedImplementationType)
Asserts first level POJO output MetaData was successfully retrieved for the processor under test and is of specific class
|
void |
clearTestData() |
<T> T |
getBeanFromContext(String beanId) |
protected String |
getConfigResources() |
protected static String[] |
getConfigSpringFiles() |
protected String |
getConfigXmlFile() |
protected org.mule.common.Testable |
getGlobalElementTestable(String globalElementName)
Returns a Testable to exercise the test connection code on a test
|
org.mule.common.Result<org.mule.common.metadata.MetaData> |
getInputMetaData(String flowName)
Returns the MetaData Result of the input MetaData retrieved of the processor under test
|
org.mule.common.metadata.MetaDataModel |
getInputMetaDataPayload(String flowName)
Returns the MetaDataModel of the input MetaData retrieved of the processor under test
|
List<org.mule.common.metadata.MetaDataKey> |
getMetaDataKeyList(String configName)
Retrieves a List
|
org.mule.common.Result<org.mule.common.metadata.MetaData> |
getOutputMetaData(String flowName)
Returns the MetaData Result of the output MetaData retrieved of the processor under test
|
org.mule.common.metadata.MetaDataModel |
getOutputMetaDataPayload(String flowName)
Returns the MetaDataModel of the output MetaData retrieved of the processor under test
|
Set<String> |
getTestRunMessageKeySet() |
<T> T |
getTestRunMessagePayload() |
<T> T |
getTestRunMessageValue(String key) |
protected void |
initializeTestRunMessage() |
void |
initializeTestRunMessage(Object data) |
protected void |
initializeTestRunMessage(String beanId)
If beanId belongs to a POJO it is set as payloadContent.
|
void |
initializeTestRunMessage(String key,
Object value)
Use payloadContent as key if you want a Map to be stored in the payload
|
boolean |
keyContainedInTestRunMessage(Object key) |
protected static void |
loadTestFlows(String configResources) |
void |
loadTestRunMessage(Map<String,Object> data)
Deprecated.
|
protected void |
loadTestRunMessage(String beanId)
Deprecated.
|
protected org.mule.construct.Flow |
lookupFlowConstruct(String name) |
void |
removeFromTestRunMessage(String key) |
protected <T> T |
runFlowAndGetInvocationProperty(String flowName,
String invocationProperty) |
protected org.mule.api.MuleMessage |
runFlowAndGetMessage(String flowName)
TestRunMessage is already loaded with values for the operation
|
protected org.mule.api.MuleMessage |
runFlowAndGetMessage(String flowName,
String beanId)
Returns the MuleMessage containing the payload of the operation.
|
protected <T> T |
runFlowAndGetPayload(String flowName)
TestRunMessage is already loaded with values for the operation
|
protected <T> T |
runFlowAndGetPayload(String flowName,
String beanId)
Returns the Payload of the flowName operation.
|
protected <T> T |
runFlowAndWaitForResponseVM(String messageFlow,
String vmQueueName,
long timeoutMs)
Runs the flow named
messageFlow and waits until a response is
received on the VM queue named vmQueueName or a timeout is
reached. |
protected void |
runFlowIgnoringPayload(String flowName) |
protected static void |
setConfigSpringFiles(List<String> configFilesLocation)
Replace the list of spring beans to be loaded into the context.
|
static void |
setUpBeforeClass() |
void |
upsertBeanFromContextOnTestRunMessage(String beanId) |
void |
upsertBeanFromContextOnTestRunMessage(String key,
String beanId) |
void |
upsertOnTestRunMessage(Map<String,Object> data) |
void |
upsertOnTestRunMessage(String key,
Object value) |
void |
upsertPayloadContentOnTestRunMessage(Object payloadContent) |
protected void |
verifyTestRunMessageIsInitialized() |
clearFlowAssertions, getBuilder, getComponent, getComponent, getConfigFile, getConfigFiles, getFlowConstruct, getFunctionalTestComponent, getSubFlow, loadResource, loadResourceAsString, runFlow, runFlow, runFlow, runFlowAndExpect, runFlowAndExpectProperty, runFlowWithPayloadAndExpect, runSchedulersOnce, stopFlowConstruct, stopFlowSchedulers, testFlow, testFlowaddBuilders, configureMuleContext, createMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, doSetUp, doSetUpBeforeMuleContextCreation, doTearDown, doTearDownAfterMuleContextDispose, getConfigurationResources, getFileInsideWorkingDirectory, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestEventContext, getTestEventUsingFlow, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestMuleMessage, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTransactedInboundEndpoint, getTestTransformer, getTriggerableMessageSource, getTriggerableMessageSource, getWorkingDirectory, initialiseObject, isDisposeContextPerClass, isGracefulShutdown, isStartContext, setDisposeContextPerClass, setStartContext, setUpMuleContextclearExcludedFlag, clearRequestContext, clearTestCaseName, createTestTimeoutRule, dumpFilteredThreadsInTest, getTestHeader, getTestTimeoutSecs, getTimeoutSystemProperty, initializeMuleTest, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isExcluded, isFailOnTimeout, isOffline, isTestIncludedInExclusionFile, takeTestCaseNameprotected static final String DEFAULT_SPRING_CONFIG_FILE
protected static Properties automationCredentials
protected static void loadTestFlows(String configResources)
public final void clearTestData()
protected static String[] getConfigSpringFiles()
protected static void addConfigSpringFile(String fileLocation)
Note:This method must be called from a static initializer static \{...\}
fileLocation - The location of the file containing the spring beans definitionsprotected static void setConfigSpringFiles(List<String> configFilesLocation)
Note:This method must be called from a static initializer static \{...\}
configFilesLocation - The list with the files location containing the spring beans definitionsprotected String getConfigResources()
getConfigResources in class org.mule.tck.junit4.FunctionalTestCaseprotected String getConfigXmlFile()
protected void verifyTestRunMessageIsInitialized()
throws Exception
Exceptionprotected org.mule.construct.Flow lookupFlowConstruct(String name)
lookupFlowConstruct in class org.mule.tck.junit4.FunctionalTestCase@Deprecated protected void loadTestRunMessage(String beanId)
beanId - @Deprecated public void loadTestRunMessage(Map<String,Object> data)
data - protected void initializeTestRunMessage()
protected void initializeTestRunMessage(String beanId)
public void initializeTestRunMessage(String key, Object value)
public void initializeTestRunMessage(Object data)
public <T> T getBeanFromContext(String beanId) throws org.springframework.beans.BeansException
org.springframework.beans.BeansExceptionpublic void upsertBeanFromContextOnTestRunMessage(String beanId)
public void upsertBeanFromContextOnTestRunMessage(String key, String beanId)
public void upsertPayloadContentOnTestRunMessage(Object payloadContent)
public <T> T getTestRunMessagePayload()
public <T> T getTestRunMessageValue(String key)
public void removeFromTestRunMessage(String key)
public boolean keyContainedInTestRunMessage(Object key)
protected <T> T runFlowAndGetPayload(String flowName) throws Exception
flowName - Exceptionprotected org.mule.api.MuleMessage runFlowAndGetMessage(String flowName) throws Exception
flowName - Exceptionprotected <T> T runFlowAndGetInvocationProperty(String flowName, String invocationProperty) throws Exception
flowName - invocationProperty - Exceptionprotected org.mule.api.MuleMessage runFlowAndGetMessage(String flowName, String beanId) throws Exception
flowName - beanId - is the id of a map Spring bean declared in the AutomationSpringBeansExceptionprotected <T> T runFlowAndGetPayload(String flowName, String beanId) throws Exception
flowName - beanId - is the id of a map Spring bean declared in the AutomationSpringBeansExceptionprotected void runFlowIgnoringPayload(String flowName) throws Exception
Exceptionprotected <T> T runFlowAndWaitForResponseVM(String messageFlow, String vmQueueName, long timeoutMs) throws Exception
Runs the flow named messageFlow and waits until a response is
received on the VM queue named vmQueueName or a timeout is
reached. This method is used to test inbound endpoints.
A vm:outbound-endpoint must manually be appended to the flow
under test before calling this method.
messageFlow - The name of the flow to run which will generate the expected
message.vmQueueName - The name of the queue to listen for messages on after running
the flow. If the queue's URL is vm://foo, then this
parameter should be foo.timeoutMs - Time in milliseconds to wait for a message before throwing a
TimeoutException.Exceptionprotected org.mule.common.Testable getGlobalElementTestable(String globalElementName)
globalElementName - Name attribute value of the Global Element for which connectivity is been testedpublic final void assertGetMetaDataKeysSuccess(String configName)
configName - Name attribute value of the Global Element for which connectivity is been testedpublic final List<org.mule.common.metadata.MetaDataKey> getMetaDataKeyList(String configName)
configName - Name attribute value of the Global Element for which connectivity is been testedpublic final void assertMetaDataKeysContainsKeys(String configName, List<HashMap<String,String>> expectedMetaDataKeyList)
configName - Name attribute value of the Global Element for which connectivity is been testedexpectedMetaDataKeyList - List containing MetaDataKeys as maps whose values are meant to be found among the connector MetaDataKeyspublic final void assertIsMetaDataEnabled(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final void assertNotMetaDataEnabled(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final org.mule.common.Result<org.mule.common.metadata.MetaData> getInputMetaData(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final org.mule.common.metadata.MetaDataModel getInputMetaDataPayload(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final org.mule.common.Result<org.mule.common.metadata.MetaData> getOutputMetaData(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final org.mule.common.metadata.MetaDataModel getOutputMetaDataPayload(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final void assertNullInputMetaDataSuccess(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final void assertFirstLevelInputMetaDataSuccess(String flowName, org.mule.common.metadata.datatype.DataType expectedDataType)
flowName - Name attribute value of the flow containing the processor under testexpectedDataType - first level MetaData DataType expected to be retrievedpublic final void assertNullOutputMetaDataSuccess(String flowName)
flowName - Name attribute value of the flow containing the processor under testpublic final void assertFirstLevelOutputMetaDataSuccess(String flowName, org.mule.common.metadata.datatype.DataType expectedDataType)
flowName - Name attribute value of the flow containing the processor under testexpectedDataType - first level MetaData DataType expected to be retrievedpublic final void assertPOJOOutputMetaDataSuccess(String flowName, String expectedImplementationType)
flowName - Name attribute value of the flow containing the processor under testexpectedDataType - first level MetaData DataType expected to be retrievedpublic final void assertListFirstLevelOutputMetaDataSuccess(String flowName, String expectedImplementationType)
flowName - Name attribute value of the flow containing the processor under testexpectedDataType - first level MetaData DataType expected to be retrievedCopyright © 2015. All rights reserved.