org.mule.tck
Class AbstractMuleTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.mule.tck.AbstractMuleTestCase
All Implemented Interfaces:
Test, TestCaseWatchdogTimeoutHandler
Direct Known Subclasses:
AbstractConnectorTestCase, AbstractContainerContextTestCase, AbstractEntryPointDiscoveryTestCase, AbstractMessageAdapterTestCase, AbstractMessageReceiverTestCase, AbstractPoolTestCase, AbstractProviderFunctionalTestCase, AbstractProxyPoolFactoryTestCase, AbstractTransformerTestCase, AbstractTxThreadAssociationTestCase, AbstractUMOManagerTestCase, FunctionalTestCase

public abstract class AbstractMuleTestCase
extends TestCase
implements TestCaseWatchdogTimeoutHandler

AbstractMuleTestCase is a base class for Mule testcases. This implementation provides services to test code for creating mock and test objects.


Nested Class Summary
static class AbstractMuleTestCase.TestInfo
           
 
Field Summary
static String[] IGNORED_DOT_MULE_DIRS
          Top-level directories under .mule which are not deleted on each test case recycle.
protected  Log logger
           
 
Constructor Summary
AbstractMuleTestCase()
           
 
Method Summary
protected  AbstractMuleTestCase.TestInfo createTestInfo()
           
protected  TestCaseWatchdog createWatchdog()
           
protected  void disposeManager()
           
protected  void doSetUp()
           
protected  void doTearDown()
           
static UMOModel getDefaultModel()
           
static UMOManager getManager(boolean disableAdminAgent)
           
 String getName()
           
static UMOComponent getTestComponent(MuleDescriptor descriptor)
           
static TestConnector getTestConnector()
           
static MuleDescriptor getTestDescriptor(String name, String implementation)
           
static UMOEndpoint getTestEndpoint(String name, String type)
           
static UMOEvent getTestEvent(Object data)
           
static UMOEvent getTestEvent(Object data, MuleDescriptor descriptor)
           
static UMOEvent getTestEvent(Object data, MuleDescriptor descriptor, UMOImmutableEndpoint endpoint)
           
static UMOEvent getTestEvent(Object data, UMOImmutableEndpoint endpoint)
           
static UMOEventContext getTestEventContext(Object data)
           
protected  AbstractMuleTestCase.TestInfo getTestInfo()
           
static UMOManager getTestManager()
           
static UMOSession getTestSession(UMOComponent component)
           
static UMOTransformer getTestTransformer()
           
 void handleTimeout(long timeout, TimeUnit unit)
           
protected  boolean isDisabledInThisEnvironment()
          Subclasses can override this method to skip the execution of the entire test class.
protected  boolean isDisabledInThisEnvironment(String testMethodName)
          Should this test run?
protected  boolean isDisposeManagerPerSuite()
           
protected  boolean isExcluded()
          Indicates whether this test has been explicitly disabled through the configuration file loaded by TestInfo.
 boolean isOffline(String method)
           
 void run(TestResult result)
           
 void runBare()
          Shamelessly copy from Spring's ConditionalTestCase so in MULE-2.0 we can extend this class from ConditionalTestCase.
protected  void setDisposeManagerPerSuite(boolean val)
           
protected  void setUp()
           
protected  void suitePostSetUp()
           
protected  void suitePostTearDown()
           
protected  void suitePreSetUp()
           
protected  void suitePreTearDown()
           
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IGNORED_DOT_MULE_DIRS

public static final String[] IGNORED_DOT_MULE_DIRS
Top-level directories under .mule which are not deleted on each test case recycle. This is required, e.g. to play nice with transaction manager recovery service object store.


logger

protected final Log logger
Constructor Detail

AbstractMuleTestCase

public AbstractMuleTestCase()
Method Detail

createTestInfo

protected AbstractMuleTestCase.TestInfo createTestInfo()

getTestInfo

protected AbstractMuleTestCase.TestInfo getTestInfo()

getName

public String getName()
Overrides:
getName in class TestCase

run

public void run(TestResult result)
Specified by:
run in interface Test
Overrides:
run in class TestCase

runBare

public void runBare()
             throws Throwable
Shamelessly copy from Spring's ConditionalTestCase so in MULE-2.0 we can extend this class from ConditionalTestCase.

Subclasses can override isDisabledInThisEnvironment to skip a single test.

Overrides:
runBare in class TestCase
Throws:
Throwable

isDisabledInThisEnvironment

protected boolean isDisabledInThisEnvironment()
Subclasses can override this method to skip the execution of the entire test class.

Returns:
true if the test class should not be run.

isExcluded

protected boolean isExcluded()
Indicates whether this test has been explicitly disabled through the configuration file loaded by TestInfo.

Returns:
whether the test has been explicitly disabled

isDisabledInThisEnvironment

protected boolean isDisabledInThisEnvironment(String testMethodName)
Should this test run?

Parameters:
testMethodName - name of the test method
Returns:
whether the test should execute in the current envionment

isOffline

public boolean isOffline(String method)

isDisposeManagerPerSuite

protected boolean isDisposeManagerPerSuite()

setDisposeManagerPerSuite

protected void setDisposeManagerPerSuite(boolean val)

createWatchdog

protected TestCaseWatchdog createWatchdog()

handleTimeout

public void handleTimeout(long timeout,
                          TimeUnit unit)
Specified by:
handleTimeout in interface TestCaseWatchdogTimeoutHandler

setUp

protected final void setUp()
                    throws Exception
Overrides:
setUp in class TestCase
Throws:
Exception

suitePreSetUp

protected void suitePreSetUp()
                      throws Exception
Throws:
Exception

suitePostSetUp

protected void suitePostSetUp()
                       throws Exception
Throws:
Exception

suitePreTearDown

protected void suitePreTearDown()
                         throws Exception
Throws:
Exception

suitePostTearDown

protected void suitePostTearDown()
                          throws Exception
Throws:
Exception

tearDown

protected final void tearDown()
                       throws Exception
Overrides:
tearDown in class TestCase
Throws:
Exception

disposeManager

protected void disposeManager()
                       throws UMOException
Throws:
UMOException

doSetUp

protected void doSetUp()
                throws Exception
Throws:
Exception

doTearDown

protected void doTearDown()
                   throws Exception
Throws:
Exception

getManager

public static UMOManager getManager(boolean disableAdminAgent)
                             throws Exception
Throws:
Exception

getDefaultModel

public static UMOModel getDefaultModel()
                                throws UMOException
Throws:
UMOException

getTestEndpoint

public static UMOEndpoint getTestEndpoint(String name,
                                          String type)
                                   throws Exception
Throws:
Exception

getTestEvent

public static UMOEvent getTestEvent(Object data)
                             throws Exception
Throws:
Exception

getTestEventContext

public static UMOEventContext getTestEventContext(Object data)
                                           throws Exception
Throws:
Exception

getTestTransformer

public static UMOTransformer getTestTransformer()

getTestEvent

public static UMOEvent getTestEvent(Object data,
                                    MuleDescriptor descriptor)
                             throws Exception
Throws:
Exception

getTestEvent

public static UMOEvent getTestEvent(Object data,
                                    UMOImmutableEndpoint endpoint)
                             throws Exception
Throws:
Exception

getTestEvent

public static UMOEvent getTestEvent(Object data,
                                    MuleDescriptor descriptor,
                                    UMOImmutableEndpoint endpoint)
                             throws UMOException
Throws:
UMOException

getTestSession

public static UMOSession getTestSession(UMOComponent component)

getTestConnector

public static TestConnector getTestConnector()

getTestComponent

public static UMOComponent getTestComponent(MuleDescriptor descriptor)

getTestDescriptor

public static MuleDescriptor getTestDescriptor(String name,
                                               String implementation)
                                        throws Exception
Throws:
Exception

getTestManager

public static UMOManager getTestManager()
                                 throws Exception
Throws:
Exception


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.