org.mule.tck.junit4
Class AbstractMuleTestCase

java.lang.Object
  extended by org.mule.tck.junit4.AbstractMuleTestCase
Direct Known Subclasses:
AbstractBasePropertyConfigurationTestCase, AbstractDataSourceConfigurationTestCase, AbstractIllegalExpressionEvaluatorTestCase, AbstractMuleContextTestCase, AbstractPreProcessorTestCase, AbstractRegistryTestCase, AbstractSchemaValidationTestCase, AddVariablePropertyTransformerTestCase, AnnotationsScannerTestCase, AppBloodhoundTestCase, ApplicationContextsTestCase, ArrayUtilsTestCase, AssertionMessageProcessorTestCase, AttributeEvaluatorTestCase, BatchConstraintTestCase, BeanUtilsTestCase, CacheControlTestCase, CachedJndiNameResolverTestCase, CaseInsensitiveHashMapTestCase, CheckAnnotatedTestCase, ChoiceMessagingExceptionStrategyTestCase, ClasspathAnnotationsScannerTestCase, ClasspathScannerTestCase, ClassUtilsTestCase, ClusterizableMessageSourceWrapperTestCase, CollectionTransformerTestCase, CollectionUtilsTestCase, ComponentDefinitionParserFlowTestCase, ComponentDefinitionParserServiceTestCase, CompositeDeploymentListenerTestCase, CompressionTestCase, ConsumableFilterTestCase, CookieHelperTestCase, CookieWrapperTestCase, CopyPropertiesTransformerTest, CountersTestCase, DataTypesTestCase, DateUtilsTestCase, DefaultMessageCollectionTestCase, DefaultMessageProcessorChainTestCase, DefaultMuleClassPathConfigTestCase, DefaultMuleContextBuilderTestCase, DefaultMuleContextFactoryTestCase, DefaultMuleMessageNullTransformationTestCase, DefaultMuleMessageTransformationTestCase, DefaultProtocolTestCase, DescriptorParserTestCase, DynamicDataTypeConverterResolverTestCase, EmailMessageToStringTestCase, EmbeddedMuleTestCase, EndpointTestCase, EndpointURIBuilderTestCase, EntryPointResolverMethodCacheTestCase, EqualsFilterTestCase, ErrorHandlingExecutionTemplateTestCase, ExceptionHelperTestCase, ExceptionListenerTestCase, ExceptionsTestCase, ExceptionStrategyConfigurationFailuresTestCase, ExceptionToMessagingExceptionExecutionInterceptorTestCase, ExceptionTypeFilterTestCase, ExceptionUtilsTestCase, ExpiryMonitorTestCase, ExpressionKeyGeneratorTestCase, ExpressionLanguageEnrichmentTestCase, FileMessageReceiverMessageProcessingTestCase, FilenameRegexFilterTestCase, FilenameUtilsTestCase, FileUtilsTestCase, FineGrainedControlClassLoaderTest, FirewallTestCase, FixedHostRmiClienSocketFactoryTestCase, FlagsMappingTestCase, FlowRefFactoryBeanTestCase, FlowValidationTestCase, FTPServerClientTest, FunctionalTestComponentTestCase, GenericsUtilsTestCase, GraphTransformerResolverTestCase, HelloSampleTestCase, HttpResponseBuilderTestCase, HttpResponseDefinitionParserTransformerTestCase, IdempotentRedeliveryPolicyTestCase, InMemoryStoreTestCase, IOUtilsTestCase, IsTransactedTestCase, IsXmlFilterTestCase, JarUtilsTestCase, JbpmUnitTestCase, JdkVersionUtilsTestCase, JmsExceptionReaderTestCase, JmsMessageUtilsTestCase, JmxMissingIdTestCase, JsonDataTestCase, KeyedPoolMessageDispatcherFactoryAdapterTestCase, LazyTransformedInputStreamTestCase, LingerExperimentMule2067TestCase, MailUtilsTestCase, MapCombinerTestCase, MapPayloadExpressionEvaluatorTestCase, MapUtilsTestCase, MessageProcessorNotificationExecutionInterceptorTestCase, MessageReceiverTestCase, MessagesTestCase, MessagingExceptionTestCase, MonitoredObjectStoreTestCase, MuleConfigurationTestCase, MuleHostConfigurationTestCase, MuleReceiverServletTestCase, MuleServerTestCase, MuleSessionHandlerTestCase, MulticasterTestCase, MVELExpressionExecutorTestCase, NamedThreadFactoryTestCase, NameTransformerFilterTestCase, NotificationManagerTestCase, NullPayloadTestCase, NumberUtilsTestCase, ObjectUtilsTestCase, OgnlExpressionEvaluatorTestCase, OutputPayloadInterceptorTestCase, PbeEncryptionStrategyTestCase, PreferredComparatorTestCase, PreferredObjectSelectorTestCase, PriorityWeightingConverterFilterTestCase, PropertiesUtilsTestCase, PropertyOverridesTestCase, ProxyServiceConfigurationTestCase, QNamePropertyEditorTestCase, RegexExpressionLanguageFunctionTestCase, RegExFilterTestCase, RemoveVariablePropertyTransformerTest, RequestContextTestCase, ReuseExperimentMule2067TestCase, ReversibleXMLStreamReaderTest, RmiRegistryAgentTestCase, SchemaValidationMule2225TestCase, SchemaValidationTestCase, ScriptingConfigErrorTestCase, SecretKeyEncryptionStrategyTestCase, SetPayloadTransformerTestCase, SftpClientTestCase, SftpMessageDispatcherTestCase, ShortestTransformationLengthTransformerFilterTestCase, SimplePasswordJmxAuthenticatorTestCase, SocketTimingExperimentTestCase, SqlExceptionReaderTestCase, SqlStatementStrategyExecutorTestCase, StatusCodeMappingsTestCase, StringMessageUtilsTestCase, StringUtilsTestCase, SystemUtilsTestCase, TemplateParserTestCase, TimedSocketTestCase, TimerTestCase, TlsConfigurationTestCase, TlsPropertiesSocketTestCase, TransactionalExecutionTemplateTestCase, TransactionConstraintTestCase, TransactionCoordinationTestCase, TransformationGraphLookupStrategyTestCase, TransformationGraphTestCase, TransformerChainingTestCase, TransformerSourceTypeEnforcementTestCase, TransformerWeightingTestCase, TypeBasedTransformerResolverTestCase, URIBuilderTestCase, URIBuilderTestCase, UUIDTestCase, ValidateTransactionalStateInterceptorTestCase, VersionRangeTestCase, VoidResultTestCase, WaitableBooleanTestCase, WaitPolicyTestCase, WildcardAttributeEvaluatorTestCase, WildcardFilterTestCase, XmlMessageProtocolTestCase, XmlUtilsTestCase, XPathExpressionEvaluatorTestCase, XPathFilterTestCase, XStreamFactoryTestCase, XStreamTransformerConfigurationTestCase

public abstract class AbstractMuleTestCase
extends Object

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


Field Summary
static int DEFAULT_TEST_TIMEOUT_SECS
           
 org.junit.rules.TestRule globalTimeout
           
protected  Log logger
           
 org.junit.rules.TestName name
           
static String TEST_TIMEOUT_SYSTEM_PROPERTY
           
 
Constructor Summary
AbstractMuleTestCase()
           
 
Method Summary
static void clearExcludedFlag()
           
 void clearRequestContext()
           
protected  org.junit.rules.TestRule createTestTimeoutRule()
          Creates the timeout rule that will be used to run the test.
protected  String getTestHeader()
           
 int getTestTimeoutSecs()
          Defines the timeout in seconds that will be used to run the test.
protected  int getTimeoutSystemProperty()
          Defines the number of seconds that a test has in order to run before throwing a timeout.
 void initializeMuleTest()
           
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 isExcluded()
          Indicates whether this test has been explicitly disabled through the configuration file loaded by TestInfo.
protected  boolean isFailOnTimeout()
          Indicates whether the test should fail when a timeout is reached.
 boolean isOffline(String method)
           
protected  boolean isTestIncludedInExclusionFile(AbstractMuleTestCase test)
          Reads the mule-exclusion file for the current test class and
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEST_TIMEOUT_SECS

public static final int DEFAULT_TEST_TIMEOUT_SECS
See Also:
Constant Field Values

TEST_TIMEOUT_SYSTEM_PROPERTY

public static final String TEST_TIMEOUT_SYSTEM_PROPERTY
See Also:
Constant Field Values

logger

protected final transient Log logger

name

public org.junit.rules.TestName name

globalTimeout

public org.junit.rules.TestRule globalTimeout
Constructor Detail

AbstractMuleTestCase

public AbstractMuleTestCase()
Method Detail

createTestTimeoutRule

protected org.junit.rules.TestRule createTestTimeoutRule()
Creates the timeout rule that will be used to run the test.

Returns:
the rule used to check for test execution timeouts.

isTestIncludedInExclusionFile

protected boolean isTestIncludedInExclusionFile(AbstractMuleTestCase test)
Reads the mule-exclusion file for the current test class and

Parameters:
test -

getTimeoutSystemProperty

protected int getTimeoutSystemProperty()
Defines the number of seconds that a test has in order to run before throwing a timeout. If the property if not defined then uses the DEFAULT_MULE_TEST_TIMEOUT_SECS constant.

Returns:
the timeout value expressed in seconds

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 environment

isOffline

public boolean isOffline(String method)

getTestTimeoutSecs

public int getTestTimeoutSecs()
Defines the timeout in seconds that will be used to run the test.

Returns:
the timeout in seconds

initializeMuleTest

public final void initializeMuleTest()

getTestHeader

protected String getTestHeader()

isFailOnTimeout

protected boolean isFailOnTimeout()
Indicates whether the test should fail when a timeout is reached.

This feature was added to support old test cases that depend on 3rd-party resources such as a public web service. In such cases it may be desirable to not fail the test upon timeout but rather to simply log a warning.

Returns:
true if it must fail on timeout and false otherwise. Default value is true.

clearRequestContext

public final void clearRequestContext()

clearExcludedFlag

public static final void clearExcludedFlag()


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