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.transport.email.EmailRoundTripTestCase
All Implemented Interfaces:
Test, TestCaseWatchdogTimeoutHandler

public class EmailRoundTripTestCase
extends org.mule.tck.FunctionalTestCase

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
static long WAIT_MS
           
 
Fields inherited from class org.mule.tck.AbstractMuleTestCase
callbackCalled, IGNORED_DOT_MULE_DIRS, LOCK_TIMEOUT, logger, muleContext, RECEIVE_TIMEOUT, TEST_MESSAGE
 
Constructor Summary
EmailRoundTripTestCase()
           
 
Method Summary
protected  String getConfigResources()
           
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.FunctionalTestCase
getBuilder, getComponent, getComponent, getConfigurationResources, loadResource, loadResourceAsString
 
Methods inherited from class org.mule.tck.AbstractMuleTestCase
configureMuleContext, createMuleContext, createTestInfo, createWatchdog, disposeManager, doSetUp, doTearDown, getName, getStartUpProperties, getTestConnector, getTestEvent, getTestEvent, getTestEvent, getTestEvent, getTestEventContext, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEndpoint, getTestInboundEvent, getTestInfo, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestOutboundEndpoint, getTestService, getTestService, getTestService, getTestSession, getTestTransformer, handleTimeout, isDisabledInThisEnvironment, isDisabledInThisEnvironment, isDisposeManagerPerSuite, isExcluded, isOffline, isStartContext, registerTestMethod, run, runBare, setDisposeManagerPerSuite, setName, setStartContext, setUp, 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

WAIT_MS

public static final long WAIT_MS
See Also:
Constant Field Values
Constructor Detail

EmailRoundTripTestCase

public EmailRoundTripTestCase()
Method Detail

getConfigResources

protected String getConfigResources()
Specified by:
getConfigResources in class org.mule.tck.FunctionalTestCase

testRoundTrip

public void testRoundTrip()
                   throws org.mule.api.MuleException,
                          InterruptedException
Throws:
org.mule.api.MuleException
InterruptedException

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


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.