|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.tck.junit4.AbstractMuleTestCase org.mule.tck.junit4.AbstractMuleContextTestCase org.mule.tck.junit4.FunctionalTestCase
public abstract class FunctionalTestCase
A base test case for tests that initialize Mule using a configuration file. The
default configuration builder used is SpringXmlConfigurationBuilder. To use this
test case, ensure you have the mule-modules-builders JAR file on your classpath.
To use a different builder, just overload the getBuilder()
method of
this class to return the type of builder you want to use with your test.
Field Summary |
---|
Fields inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase |
---|
callbackCalled, CLASSNAME_ANNOTATIONS_CONFIG_BUILDER, IGNORED_DOT_MULE_DIRS, LOCK_TIMEOUT, muleContext, RECEIVE_TIMEOUT, TEST_MESSAGE |
Fields inherited from class org.mule.tck.junit4.AbstractMuleTestCase |
---|
DEFAULT_TEST_TIMEOUT_SECS, globalTimeout, logger, name, TEST_TIMEOUT_SYSTEM_PROPERTY |
Constructor Summary | |
---|---|
FunctionalTestCase()
|
Method Summary | ||
---|---|---|
void |
clearFlowAssertions()
|
|
protected ConfigurationBuilder |
getBuilder()
|
|
protected Object |
getComponent(FlowConstruct flowConstruct)
Returns an instance of the service's component object. |
|
protected Object |
getComponent(String serviceName)
Returns an instance of the service's component object. |
|
protected String |
getConfigFile()
|
|
protected String[] |
getConfigFiles()
|
|
protected String |
getConfigResources()
Deprecated. use getConfigFile instead. |
|
protected FlowConstruct |
getFlowConstruct(String flowName)
|
|
protected FunctionalTestComponent |
getFunctionalTestComponent(String serviceName)
A convenience method to get a type-safe reference to the FunctionTestComponent |
|
protected InputStream |
loadResource(String resourceName)
|
|
protected String |
loadResourceAsString(String resourceName)
|
|
protected Flow |
lookupFlowConstruct(String name)
Retrieve a flow by name from the registry |
|
protected
|
runFlow(String flowName)
Runs the given flow with a default event |
|
protected
|
runFlow(String flowName,
T payload)
Executes the given flow with a default message carrying the payload |
|
protected
|
runFlowAndExpect(String flowName,
T expect)
Run the flow specified by name and assert equality on the expected output |
|
protected
|
runFlowAndExpectProperty(String flowName,
String propertyName,
T expect)
Runs the given flow and asserts for property name in the outbound scope to match the expected value |
|
protected
|
runFlowWithPayloadAndExpect(String flowName,
T expect,
U payload)
Run the flow specified by name using the specified payload and assert equality on the expected output |
|
protected void |
stopFlowConstruct(String flowName)
|
|
protected void |
testFlow(String flowName)
Tests the given flow with a one-way message exchange pattern |
|
protected void |
testFlow(String flowName,
MuleEvent event)
Looks up the given flow in the registry and processes it with the given event. |
Methods inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase |
---|
addBuilders, configureMuleContext, createMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, doSetUp, doSetUpBeforeMuleContextCreation, doTearDown, doTearDownAfterMuleContextDispose, getConfigurationResources, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestEventContext, getTestEventUsingFlow, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTransactedInboundEndpoint, getTestTransformer, getTriggerableMessageSource, getTriggerableMessageSource, initialiseObject, isDisposeContextPerClass, isGracefulShutdown, isStartContext, setDisposeContextPerClass, setStartContext, setUpMuleContext |
Methods inherited from class org.mule.tck.junit4.AbstractMuleTestCase |
---|
clearExcludedFlag, clearRequestContext, clearTestCaseName, createTestTimeoutRule, dumpFilteredThreadsInTest, getTestHeader, getTestTimeoutSecs, getTimeoutSystemProperty, initializeMuleTest, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isExcluded, isFailOnTimeout, isOffline, isTestIncludedInExclusionFile, takeTestCaseName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionalTestCase()
Method Detail |
---|
@Deprecated protected String getConfigResources()
protected ConfigurationBuilder getBuilder() throws Exception
getBuilder
in class org.mule.tck.junit4.AbstractMuleContextTestCase
Exception
protected String getConfigFile()
protected String[] getConfigFiles()
protected Object getComponent(String serviceName) throws Exception
Exception
protected Object getComponent(FlowConstruct flowConstruct) throws Exception
Exception
protected FunctionalTestComponent getFunctionalTestComponent(String serviceName) throws Exception
serviceName
- service name as declared in the config
Exception
FunctionalTestComponent
protected FlowConstruct getFlowConstruct(String flowName) throws Exception
Exception
protected String loadResourceAsString(String resourceName) throws IOException
IOException
protected InputStream loadResource(String resourceName) throws IOException
IOException
protected void stopFlowConstruct(String flowName) throws Exception
Exception
protected void testFlow(String flowName) throws Exception
flowName
- the name of the flow to be executed
Exception
protected void testFlow(String flowName, MuleEvent event) throws Exception
org.mule.tck.functional.FlowAssert.verify(String)
flowName
- the name of the flow to be executedevent
- the event ot execute with
Exception
protected <T> MuleEvent runFlow(String flowName) throws Exception
flowName
- the name of the flow to be executed
MuleEvent
Exception
protected <T> MuleEvent runFlow(String flowName, T payload) throws Exception
flowName
- the name of the flow to be executedpayload
- the payload to use int he message
MuleEvent
Exception
protected <T> void runFlowAndExpect(String flowName, T expect) throws Exception
flowName
- The name of the flow to runexpect
- The expected output
Exception
protected <T> void runFlowAndExpectProperty(String flowName, String propertyName, T expect) throws Exception
flowName
- the name of the flow to be executedpropertyName
- the name of the property to testexpect
- the expected value
Exception
protected <T,U> void runFlowWithPayloadAndExpect(String flowName, T expect, U payload) throws Exception
flowName
- The name of the flow to runexpect
- The expected outputpayload
- The payload of the input event
Exception
protected Flow lookupFlowConstruct(String name)
name
- Name of the flow to retrievepublic final void clearFlowAssertions() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |