org.mule.test.integration.service
Class ServiceInFlightMessagesTestCase

java.lang.Object
  extended by org.mule.tck.junit4.AbstractMuleTestCase
      extended by org.mule.tck.junit4.AbstractMuleContextTestCase
          extended by org.mule.tck.junit4.FunctionalTestCase
              extended by org.mule.test.integration.service.ServiceInFlightMessagesTestCase
Direct Known Subclasses:
ServiceInFlightMessagesJMSTestCase

public class ServiceInFlightMessagesTestCase
extends FunctionalTestCase


Field Summary
protected static int NUM_MESSAGES
           
protected static int WAIT_TIME_MILLIS
           
 
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
ServiceInFlightMessagesTestCase()
           
 
Method Summary
protected  void assertNoLostMessages(int numMessages, Service service)
          After each run the following should total 500 events: 1) Event still in SEDA queue 2) Events dispatched to outbound vm endpooint 3) Events that were unable to be sent to stopped service and raised exceptions
protected  void assertOutboundEmpty()
           
protected  void assertOutboundNotEmpty()
           
protected  void assertSedaQueueEmpty(Service service)
           
protected  void assertSedaQueueNotEmpty(Service service)
           
protected  MuleContext createMuleContext()
           
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  String getConfigResources()
           
protected  int getOutSize()
           
protected  int getQueueSize(String name)
           
protected  String getSedaQueueName(Service service)
           
protected  int getSedaQueueSize(Service service)
           
protected  void populateSedaQueue(Service service, int numMessages)
           
protected  void recreateAndStartMuleContext()
           
protected  void startService(Service service)
           
protected  void stopService(Service service)
           
 void testInFlightMessagesPausedPersistentQueueServiceWhenServiceStopped()
           
 void testInFlightMessagesPausedServiceWhenServiceStopped()
           
 void testInFlightMessagesPersistentQueueServiceWhenMuleDisposed()
           
 void testInFlightMessagesPersistentQueueServiceWhenServiceStopped()
           
 void testInFlightMessagesWhenServiceStopped()
           
 
Methods inherited from class org.mule.tck.junit4.FunctionalTestCase
clearFlowAssertions, getBuilder, getComponent, getComponent, getFlowConstruct, getFunctionalTestComponent, loadResource, loadResourceAsString, stopFlowConstruct, testFlow, testFlow
 
Methods inherited from class org.mule.tck.junit4.AbstractMuleContextTestCase
addBuilders, configureMuleContext, createObject, createObject, disposeContext, disposeContextPerTest, doSetUp, 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

WAIT_TIME_MILLIS

protected static final int WAIT_TIME_MILLIS
See Also:
Constant Field Values

NUM_MESSAGES

protected static final int NUM_MESSAGES
See Also:
Constant Field Values
Constructor Detail

ServiceInFlightMessagesTestCase

public ServiceInFlightMessagesTestCase()
Method Detail

getConfigResources

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

createMuleContext

protected MuleContext createMuleContext()
                                 throws Exception
Overrides:
createMuleContext in class AbstractMuleContextTestCase
Throws:
Exception

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 AbstractMuleContextTestCase
Throws:
Exception - if something fails that should halt the testcase

testInFlightMessagesWhenServiceStopped

public void testInFlightMessagesWhenServiceStopped()
                                            throws Exception
Throws:
Exception

testInFlightMessagesPausedServiceWhenServiceStopped

public void testInFlightMessagesPausedServiceWhenServiceStopped()
                                                         throws Exception
Throws:
Exception

testInFlightMessagesPersistentQueueServiceWhenServiceStopped

public void testInFlightMessagesPersistentQueueServiceWhenServiceStopped()
                                                                  throws Exception
Throws:
Exception

testInFlightMessagesPausedPersistentQueueServiceWhenServiceStopped

public void testInFlightMessagesPausedPersistentQueueServiceWhenServiceStopped()
                                                                        throws Exception
Throws:
Exception

testInFlightMessagesPersistentQueueServiceWhenMuleDisposed

public void testInFlightMessagesPersistentQueueServiceWhenMuleDisposed()
                                                                throws Exception
Throws:
Exception

recreateAndStartMuleContext

protected void recreateAndStartMuleContext()
                                    throws Exception,
                                           MuleException
Throws:
Exception
MuleException

populateSedaQueue

protected void populateSedaQueue(Service service,
                                 int numMessages)
                          throws MuleException,
                                 Exception
Throws:
MuleException
Exception

assertNoLostMessages

protected void assertNoLostMessages(int numMessages,
                                    Service service)
                             throws Exception
After each run the following should total 500 events: 1) Event still in SEDA queue 2) Events dispatched to outbound vm endpooint 3) Events that were unable to be sent to stopped service and raised exceptions

Throws:
Exception

assertSedaQueueEmpty

protected void assertSedaQueueEmpty(Service service)
                             throws MuleException
Throws:
MuleException

assertSedaQueueNotEmpty

protected void assertSedaQueueNotEmpty(Service service)
                                throws MuleException
Throws:
MuleException

assertOutboundEmpty

protected void assertOutboundEmpty()
                            throws Exception
Throws:
Exception

assertOutboundNotEmpty

protected void assertOutboundNotEmpty()
                               throws Exception
Throws:
Exception

getSedaQueueSize

protected int getSedaQueueSize(Service service)
                        throws MuleException
Throws:
MuleException

getSedaQueueName

protected String getSedaQueueName(Service service)

getOutSize

protected int getOutSize()
                  throws Exception
Throws:
Exception

getQueueSize

protected int getQueueSize(String name)
                    throws MuleException
Throws:
MuleException

stopService

protected void stopService(Service service)
                    throws Exception
Throws:
Exception

startService

protected void startService(Service service)
                     throws Exception
Throws:
Exception


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