org.mule.transport.email
Class EmailRoundTripTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.mule.tck.AbstractMuleTestCase
              extended by org.mule.tck.FunctionalTestCase
                  extended by org.mule.tck.DynamicPortTestCase
                      extended by org.mule.transport.email.EmailRoundTripTestCase
All Implemented Interfaces:
junit.framework.Test, TestCaseWatchdogTimeoutHandler

public class EmailRoundTripTestCase
extends DynamicPortTestCase

This demonstrates "round trip" processing of email - an email is pulled from a POP server and then sent to an SMTP server. While within Mule the message is serialized as RFC822 encoded bytes (this would let the message be transmitted over JMS etc).

The email servers for the test are managed by the greenMailSupport instance. The Mule services (defined in email-round-trip-test.xml) are started by the test framework. So all we need to do here is test that the message is handled correctly.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mule.tck.AbstractMuleTestCase
AbstractMuleTestCase.TestInfo
 
Field Summary
 
Fields inherited from class org.mule.tck.AbstractMuleTestCase
callbackCalled, CLASSNAME_ANNOTATIONS_CONFIG_BUILDER, DEFAULT_MULE_TEST_TIMEOUT_SECS, IGNORED_DOT_MULE_DIRS, LOCK_TIMEOUT, logger, muleContext, numPorts, ports, PROPERTY_MULE_TEST_TIMEOUT, RECEIVE_TIMEOUT, TEST_MESSAGE, testTimeoutSecs
 
Constructor Summary
EmailRoundTripTestCase()
           
 
Method Summary
protected  String getConfigResources()
           
protected  int getNumPortsToFind()
           
protected  void suitePostTearDown()
          Stop the servers when the test ends
protected  void suitePreSetUp()
          Start the servers when the test starts
 void testRoundTrip()
           
 
Methods inherited from class org.mule.tck.DynamicPortTestCase
doSetUp, doTearDown
 
Methods inherited from class org.mule.tck.FunctionalTestCase
getBuilder, getComponent, getComponent, getFunctionalTestComponent, loadResource, loadResourceAsString
 
Methods inherited from class org.mule.tck.AbstractMuleTestCase
addBuilders, checkPorts, configureMuleContext, createMuleContext, createObject, createObject, createTestInfo, createWatchdog, disposeManager, findFreePorts, getConfigurationResources, getPorts, getSensingNullMessageProcessor, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestEventContext, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEvent, getTestInboundEvent, getTestInboundEvent, getTestInfo, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTimeoutSecs, getTestTransactedInboundEndpoint, getTestTransformer, getTriggerableMessageSource, getTriggerableMessageSource, giveTheTestSomeTimeToCleanUpAndThenKillIt, handleTimeout, initialiseObject, initTestTimeoutSecs, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isDisposeManagerPerSuite, isExcluded, isGracefulShutdown, isOffline, isPortFree, isStartContext, registerTestMethod, run, runBare, setDisposeManagerPerSuite, setFailOnTimeout, setName, setStartContext, setUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmailRoundTripTestCase

public EmailRoundTripTestCase()
Method Detail

getConfigResources

protected String getConfigResources()
Specified by:
getConfigResources in class FunctionalTestCase

suitePreSetUp

protected void suitePreSetUp()
                      throws Exception
Start the servers when the test starts

Overrides:
suitePreSetUp in class AbstractMuleTestCase
Throws:
Exception

suitePostTearDown

protected void suitePostTearDown()
                          throws Exception
Stop the servers when the test ends

Overrides:
suitePostTearDown in class AbstractMuleTestCase
Throws:
Exception

testRoundTrip

public void testRoundTrip()
                   throws MuleException,
                          InterruptedException
Throws:
MuleException
InterruptedException

getNumPortsToFind

protected int getNumPortsToFind()
Specified by:
getNumPortsToFind in class DynamicPortTestCase


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