org.mule.transport.email.connectors
Class AbstractMailConnectorFunctionalTestCase

java.lang.Object
  extended by org.mule.tck.junit4.AbstractMuleTestCase
      extended by org.mule.tck.junit4.AbstractMuleContextTestCase
          extended by org.mule.transport.AbstractConnectorTestCase
              extended by org.mule.transport.email.connectors.AbstractMailConnectorFunctionalTestCase
Direct Known Subclasses:
AbstractReceivingMailConnectorTestCase, SmtpConnectorTestCase

public abstract class AbstractMailConnectorFunctionalTestCase
extends AbstractConnectorTestCase

Start a (greenmail) mail server with a known message, for use in subclasses.


Field Summary
 DynamicPort dynamicPort
           
static String EMAIL
           
static String LOCALHOST
           
static String MESSAGE
           
static boolean NO_INITIAL_EMAIL
           
static String PASSWORD
           
static String PROVIDER
           
static boolean SEND_INITIAL_EMAIL
           
static int START_ATTEMPTS
           
static long STARTUP_PERIOD_MS
           
static int TEST_ATTEMPTS
           
static String USER
           
 
Fields inherited from class org.mule.transport.AbstractConnectorTestCase
connectorName, encoding
 
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
protected AbstractMailConnectorFunctionalTestCase(boolean initialEmail, String protocol)
           
 
Method Summary
protected  void assertMessageOk(Object mailMessage)
           
protected  void doSetUp()
          Enables the adding of extra behavior on the set up stage of a test right after the creation of the mule context in AbstractMuleContextTestCase.setUpMuleContext().
protected  void doTearDown()
          Enables the adding of extra behavior on the tear down stage of a test before the mule context is disposed in AbstractMuleContextTestCase.disposeContextPerTest().
protected  com.icegreen.greenmail.util.GreenMail getServers()
           
 String getTestEndpointURI()
           
 Object getValidMessage()
           
protected  boolean transformInboundMessage()
           
protected  String uniqueName(String root)
           
 
Methods inherited from class org.mule.transport.AbstractConnectorTestCase
createConnector, getConnector, getConnectorAndAssert, testConnectorBeanProps, testConnectorExceptionHandling, testConnectorInitialise, testConnectorLifecycle, testConnectorListenerSupport, testConnectorMessageDispatcherFactory, testConnectorMessageRequesterFactory, testConnectorMuleMessageFactory
 
Methods inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase
addBuilders, configureMuleContext, createMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, getBuilder, 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
 

Field Detail

LOCALHOST

public static final String LOCALHOST
See Also:
Constant Field Values

USER

public static final String USER
See Also:
Constant Field Values

PROVIDER

public static final String PROVIDER
See Also:
Constant Field Values

EMAIL

public static final String EMAIL
See Also:
Constant Field Values

PASSWORD

public static final String PASSWORD
See Also:
Constant Field Values

MESSAGE

public static final String MESSAGE
See Also:
Constant Field Values

START_ATTEMPTS

public static final int START_ATTEMPTS
See Also:
Constant Field Values

TEST_ATTEMPTS

public static final int TEST_ATTEMPTS
See Also:
Constant Field Values

STARTUP_PERIOD_MS

public static final long STARTUP_PERIOD_MS
See Also:
Constant Field Values

SEND_INITIAL_EMAIL

public static final boolean SEND_INITIAL_EMAIL
See Also:
Constant Field Values

NO_INITIAL_EMAIL

public static final boolean NO_INITIAL_EMAIL
See Also:
Constant Field Values

dynamicPort

public DynamicPort dynamicPort
Constructor Detail

AbstractMailConnectorFunctionalTestCase

protected AbstractMailConnectorFunctionalTestCase(boolean initialEmail,
                                                  String protocol)
Method Detail

doSetUp

protected void doSetUp()
                throws Exception
Description copied from class: AbstractMuleContextTestCase
Enables the adding of extra behavior on the set up stage of a test right after the creation of the mule context in AbstractMuleContextTestCase.setUpMuleContext().

Under normal circumstances this method could be replaced by a @Before annotated method.

Overrides:
doSetUp in class AbstractConnectorTestCase
Throws:
Exception - if something fails that should halt the test case

doTearDown

protected void doTearDown()
                   throws Exception
Description copied from class: AbstractMuleContextTestCase
Enables the adding of extra behavior on the tear down stage of a test before the mule context is disposed in AbstractMuleContextTestCase.disposeContextPerTest().

Under normal circumstances this method could be replace with a @After annotated method.

Overrides:
doTearDown in class AbstractConnectorTestCase
Throws:
Exception - if something fails that should halt the testcase

getServers

protected com.icegreen.greenmail.util.GreenMail getServers()

getValidMessage

public Object getValidMessage()
                       throws Exception
Specified by:
getValidMessage in class AbstractConnectorTestCase
Throws:
Exception

getTestEndpointURI

public String getTestEndpointURI()
Specified by:
getTestEndpointURI in class AbstractConnectorTestCase

transformInboundMessage

protected boolean transformInboundMessage()

assertMessageOk

protected void assertMessageOk(Object mailMessage)
                        throws Exception
Throws:
Exception

uniqueName

protected String uniqueName(String root)


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