|
||||||||||
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 org.mule.util.concurrent.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 org.mule.api.MuleContext |
muleContext
|
static int |
RECEIVE_TIMEOUT
Default timeout for waiting for responses |
static String |
TEST_MESSAGE
Convenient test message for unit testing. |
Constructor Summary | |
---|---|
AbstractMuleTestCase()
|
Method Summary | |
---|---|
protected void |
configureMuleContext(org.mule.api.context.MuleContextBuilder contextBuilder)
Override this method to set properties of the MuleContextBuilder before it is used to create the MuleContext. |
protected org.mule.api.MuleContext |
createMuleContext()
|
protected AbstractMuleTestCase.TestInfo |
createTestInfo()
|
protected TestCaseWatchdog |
createWatchdog()
|
protected void |
disposeManager()
|
protected void |
doSetUp()
|
protected void |
doTearDown()
|
protected org.mule.api.config.ConfigurationBuilder |
getBuilder()
|
protected String |
getConfigurationResources()
|
String |
getName()
|
protected Properties |
getStartUpProperties()
|
static TestConnector |
getTestConnector()
|
static org.mule.api.MuleEvent |
getTestEvent(Object data)
|
static org.mule.api.MuleEvent |
getTestEvent(Object data,
org.mule.api.endpoint.ImmutableEndpoint endpoint)
|
static org.mule.api.MuleEvent |
getTestEvent(Object data,
org.mule.api.service.Service service)
|
static org.mule.api.MuleEvent |
getTestEvent(Object data,
org.mule.api.service.Service service,
org.mule.api.endpoint.ImmutableEndpoint endpoint)
|
static org.mule.api.MuleEventContext |
getTestEventContext(Object data)
|
static org.mule.api.endpoint.InboundEndpoint |
getTestInboundEndpoint(String name)
|
static org.mule.api.endpoint.InboundEndpoint |
getTestInboundEndpoint(String name,
List transformers)
|
static org.mule.api.endpoint.InboundEndpoint |
getTestInboundEndpoint(String name,
String uri)
|
static org.mule.api.endpoint.InboundEndpoint |
getTestInboundEndpoint(String name,
String uri,
List transformers,
org.mule.api.routing.filter.Filter filter,
Map properties)
|
static org.mule.api.MuleEvent |
getTestInboundEvent(Object data)
|
protected AbstractMuleTestCase.TestInfo |
getTestInfo()
|
static org.mule.api.endpoint.OutboundEndpoint |
getTestOutboundEndpoint(String name)
|
static org.mule.api.endpoint.OutboundEndpoint |
getTestOutboundEndpoint(String name,
List transformers)
|
static org.mule.api.endpoint.OutboundEndpoint |
getTestOutboundEndpoint(String name,
String uri)
|
static org.mule.api.endpoint.OutboundEndpoint |
getTestOutboundEndpoint(String name,
String uri,
List transformers,
org.mule.api.routing.filter.Filter filter,
Map properties)
|
static org.mule.api.service.Service |
getTestService()
|
static org.mule.api.service.Service |
getTestService(String name,
Class clazz)
|
static org.mule.api.service.Service |
getTestService(String name,
Class clazz,
Map props)
|
static org.mule.api.MuleSession |
getTestSession(org.mule.api.service.Service service,
org.mule.api.MuleContext context)
|
static org.mule.api.transformer.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 org.mule.api.MuleContext muleContext
protected final transient Log logger
public static final String TEST_MESSAGE
public static final long LOCK_TIMEOUT
public static final int RECEIVE_TIMEOUT
protected org.mule.util.concurrent.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 org.mule.api.MuleContext createMuleContext() throws Exception
Exception
protected void configureMuleContext(org.mule.api.context.MuleContextBuilder contextBuilder)
protected org.mule.api.config.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 org.mule.api.endpoint.InboundEndpoint getTestInboundEndpoint(String name) throws Exception
Exception
public static org.mule.api.endpoint.OutboundEndpoint getTestOutboundEndpoint(String name) throws Exception
Exception
public static org.mule.api.endpoint.InboundEndpoint getTestInboundEndpoint(String name, String uri) throws Exception
Exception
public static org.mule.api.endpoint.OutboundEndpoint getTestOutboundEndpoint(String name, String uri) throws Exception
Exception
public static org.mule.api.endpoint.InboundEndpoint getTestInboundEndpoint(String name, List transformers) throws Exception
Exception
public static org.mule.api.endpoint.OutboundEndpoint getTestOutboundEndpoint(String name, List transformers) throws Exception
Exception
public static org.mule.api.endpoint.InboundEndpoint getTestInboundEndpoint(String name, String uri, List transformers, org.mule.api.routing.filter.Filter filter, Map properties) throws Exception
Exception
public static org.mule.api.endpoint.OutboundEndpoint getTestOutboundEndpoint(String name, String uri, List transformers, org.mule.api.routing.filter.Filter filter, Map properties) throws Exception
Exception
public static org.mule.api.MuleEvent getTestEvent(Object data, org.mule.api.service.Service service) throws Exception
Exception
public static org.mule.api.MuleEvent getTestEvent(Object data) throws Exception
Exception
public static org.mule.api.MuleEvent getTestInboundEvent(Object data) throws Exception
Exception
public static org.mule.api.MuleEventContext getTestEventContext(Object data) throws Exception
Exception
public static org.mule.api.transformer.Transformer getTestTransformer() throws Exception
Exception
public static org.mule.api.MuleEvent getTestEvent(Object data, org.mule.api.endpoint.ImmutableEndpoint endpoint) throws Exception
Exception
public static org.mule.api.MuleEvent getTestEvent(Object data, org.mule.api.service.Service service, org.mule.api.endpoint.ImmutableEndpoint endpoint) throws Exception
Exception
public static org.mule.api.MuleSession getTestSession(org.mule.api.service.Service service, org.mule.api.MuleContext context)
public static TestConnector getTestConnector() throws Exception
Exception
public static org.mule.api.service.Service getTestService() throws Exception
Exception
public static org.mule.api.service.Service getTestService(String name, Class clazz) throws Exception
Exception
public static org.mule.api.service.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 |