|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.mule.tck.AbstractMuleTestCase
public abstract class AbstractMuleTestCase
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 | |
---|---|
protected Latch |
callbackCalled
Use this as a semaphore to the unit test to indicate when a callback has successfully been called. |
static String[] |
IGNORED_DOT_MULE_DIRS
Top-level directories under .mule which are not deleted on each
test case recycle. |
static long |
LOCK_TIMEOUT
Default timeout for multithreaded tests (using CountDownLatch, WaitableBoolean, etc.), in milliseconds. |
protected Log |
logger
|
protected static MuleContext |
muleContext
|
static String |
TEST_MESSAGE
Convenient test message for unit testing. |
Constructor Summary | |
---|---|
AbstractMuleTestCase()
|
Method Summary | |
---|---|
protected MuleContext |
createMuleContext()
|
protected AbstractMuleTestCase.TestInfo |
createTestInfo()
|
protected TestCaseWatchdog |
createWatchdog()
|
protected void |
disposeManager()
|
protected void |
doSetUp()
|
protected void |
doTearDown()
|
protected ConfigurationBuilder |
getBuilder()
|
protected String |
getConfigurationResources()
|
String |
getName()
|
protected Properties |
getStartUpProperties()
|
static TestConnector |
getTestConnector()
|
static MuleEvent |
getTestEvent(Object data)
|
static MuleEvent |
getTestEvent(Object data,
ImmutableEndpoint endpoint)
|
static MuleEvent |
getTestEvent(Object data,
Service service)
|
static MuleEvent |
getTestEvent(Object data,
Service service,
ImmutableEndpoint endpoint)
|
static MuleEventContext |
getTestEventContext(Object data)
|
static Endpoint |
getTestInboundEndpoint(String name)
|
protected AbstractMuleTestCase.TestInfo |
getTestInfo()
|
static Endpoint |
getTestOutboundEndpoint(String name)
|
static Service |
getTestService()
|
static Service |
getTestService(String name,
Class clazz)
|
static Service |
getTestService(String name,
Class clazz,
Map props)
|
static MuleSession |
getTestSession(Service service)
|
static Transformer |
getTestTransformer()
|
void |
handleTimeout(long timeout,
edu.emory.mathcs.backport.java.util.concurrent.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)
|
protected boolean |
isStartContext()
|
protected void |
registerTestMethod()
|
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)
|
void |
setName(String name)
|
protected void |
setStartContext(boolean startContext)
|
protected void |
setUp()
|
protected void |
suitePostTearDown()
Run after all testcase teardowns. |
protected void |
suitePreSetUp()
Run before any testcase setup. |
protected void |
tearDown()
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, run, runTest, 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, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String[] IGNORED_DOT_MULE_DIRS
.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.
protected static MuleContext muleContext
protected final transient Log logger
public static final String TEST_MESSAGE
public static final long LOCK_TIMEOUT
protected Latch callbackCalled
Constructor Detail |
---|
public AbstractMuleTestCase()
Method Detail |
---|
protected void registerTestMethod()
public void setName(String name)
setName
in class TestCase
protected AbstractMuleTestCase.TestInfo createTestInfo()
protected AbstractMuleTestCase.TestInfo getTestInfo()
public String getName()
getName
in class TestCase
public void run(TestResult result)
run
in interface Test
run
in class TestCase
public void runBare() throws Throwable
isDisabledInThisEnvironment
to skip a single test.
runBare
in class TestCase
Throwable
protected boolean isDisabledInThisEnvironment()
true
if the test class should not be run.protected boolean isExcluded()
protected boolean isDisabledInThisEnvironment(String testMethodName)
testMethodName
- name of the test method
public boolean isOffline(String method)
protected boolean isDisposeManagerPerSuite()
protected void setDisposeManagerPerSuite(boolean val)
protected TestCaseWatchdog createWatchdog()
public void handleTimeout(long timeout, edu.emory.mathcs.backport.java.util.concurrent.TimeUnit unit)
handleTimeout
in interface TestCaseWatchdogTimeoutHandler
protected final void setUp() throws Exception
setUp
in class TestCase
Exception
protected MuleContext createMuleContext() throws Exception
Exception
protected ConfigurationBuilder getBuilder() throws Exception
Exception
protected String getConfigurationResources()
protected Properties getStartUpProperties()
protected void suitePreSetUp() throws Exception
Exception
protected void suitePostTearDown() throws Exception
Exception
protected final void tearDown() throws Exception
tearDown
in class TestCase
Exception
protected void disposeManager()
protected void doSetUp() throws Exception
Exception
protected void doTearDown() throws Exception
Exception
public static Endpoint getTestInboundEndpoint(String name) throws Exception
Exception
public static Endpoint getTestOutboundEndpoint(String name) throws Exception
Exception
public static MuleEvent getTestEvent(Object data, Service service) throws Exception
Exception
public static MuleEvent getTestEvent(Object data) throws Exception
Exception
public static MuleEventContext getTestEventContext(Object data) throws Exception
Exception
public static Transformer getTestTransformer() throws Exception
Exception
public static MuleEvent getTestEvent(Object data, ImmutableEndpoint endpoint) throws Exception
Exception
public static MuleEvent getTestEvent(Object data, Service service, ImmutableEndpoint endpoint) throws Exception
Exception
public static MuleSession getTestSession(Service service)
public static TestConnector getTestConnector() throws Exception
Exception
public static Service getTestService() throws Exception
Exception
public static Service getTestService(String name, Class clazz) throws Exception
Exception
public static Service getTestService(String name, Class clazz, Map props) throws Exception
Exception
protected boolean isStartContext()
protected void setStartContext(boolean startContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |