org.mule.tck.junit4
Class FunctionalTestCase

java.lang.Object
  extended by org.mule.tck.junit4.AbstractMuleTestCase
      extended by org.mule.tck.junit4.AbstractMuleContextTestCase
          extended by org.mule.tck.junit4.FunctionalTestCase
Direct Known Subclasses:
AbstractLoanBrokerTestCase, AbstractScriptConfigBuilderTestCase, AbstractServiceAndFlowTestCase

public abstract class FunctionalTestCase
extends org.mule.tck.junit4.AbstractMuleContextTestCase

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 abstract  String getConfigResources()
           
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  void stopFlowConstruct(String flowName)
           
protected  void testFlow(String flowName)
           
protected  void testFlow(String flowName, MuleEvent event)
           
 
Methods inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase
addBuilders, configureMuleContext, createMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, doSetUp, doTearDown, getConfigurationResources, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, 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, createTestTimeoutRule, getTestHeader, getTestTimeoutSecs, getTimeoutSystemProperty, initializeMuleTest, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isExcluded, isFailOnTimeout, isOffline, isTestIncludedInExclusionFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionalTestCase

public FunctionalTestCase()
Method Detail

getBuilder

protected ConfigurationBuilder getBuilder()
                                   throws Exception
Overrides:
getBuilder in class org.mule.tck.junit4.AbstractMuleContextTestCase
Throws:
Exception

getConfigResources

protected abstract String getConfigResources()

getComponent

protected Object getComponent(String serviceName)
                       throws Exception
Returns an instance of the service's component object. Note that depending on the type of ObjectFactory used for the component, this may create a new instance of the object. If you plan to set properties on the returned object, make sure your component is declared as a singleton, otherwise this will not work.

Throws:
Exception

getComponent

protected Object getComponent(FlowConstruct flowConstruct)
                       throws Exception
Returns an instance of the service's component object. Note that depending on the type of ObjectFactory used for the component, this may create a new instance of the object. If you plan to set properties on the returned object, make sure your component is declared as a singleton, otherwise this will not work.

Throws:
Exception

getFunctionalTestComponent

protected FunctionalTestComponent getFunctionalTestComponent(String serviceName)
                                                      throws Exception
A convenience method to get a type-safe reference to the FunctionTestComponent

Parameters:
serviceName - service name as declared in the config
Returns:
test component
Throws:
Exception
Since:
2.2
See Also:
FunctionalTestComponent

getFlowConstruct

protected FlowConstruct getFlowConstruct(String flowName)
                                  throws Exception
Throws:
Exception

loadResourceAsString

protected String loadResourceAsString(String resourceName)
                               throws IOException
Throws:
IOException

loadResource

protected InputStream loadResource(String resourceName)
                            throws IOException
Throws:
IOException

stopFlowConstruct

protected void stopFlowConstruct(String flowName)
                          throws Exception
Throws:
Exception

testFlow

protected void testFlow(String flowName)
                 throws Exception
Throws:
Exception

testFlow

protected void testFlow(String flowName,
                        MuleEvent event)
                 throws Exception
Throws:
Exception

clearFlowAssertions

public final void clearFlowAssertions()
                               throws Exception
Throws:
Exception


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.