org.apache.qpid.server.failover
Class FailoverMethodTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.qpid.test.utils.QpidTestCase
              extended by org.apache.qpid.server.util.InternalBrokerBaseCase
                  extended by org.apache.qpid.server.failover.FailoverMethodTest
All Implemented Interfaces:
ExceptionListener, junit.framework.Test

public class FailoverMethodTest
extends org.apache.qpid.server.util.InternalBrokerBaseCase
implements ExceptionListener


Field Summary
protected static org.slf4j.Logger _logger
           
 
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY
 
Constructor Summary
FailoverMethodTest()
           
 
Method Summary
 void createBroker()
           
 void onException(JMSException e)
           
 void stopBroker()
           
 void testFailoverRoundRobinDelay()
          Test that the round robin method has the correct delays.
 void testFailoverSingleDelay()
           
 void testNoFailover()
          Test that setting 'nofailover' as the failover policy does not result in delays or connection attempts when the initial connection is lost.
 
Methods inherited from class org.apache.qpid.server.util.InternalBrokerBaseCase
acknowledge, browse, checkStoreContents, configure, getChannel, getConfiguration, getConfigXml, getMessageStore, getQUEUE_NAME, getQueue, getRegistry, getSession, getVirtualHost, isStarted, publishMessages, setChannel, setConfiguration, setConfigXml, setMessageStore, setQUEUE_NAME, setQueue, setRegistry, setSession, setStarted, setUp, setVirtualHost, subscribe, tearDown
 
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase
getTestProfileMessageStoreClassName, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runBare, runTest, setName, 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

_logger

protected static final org.slf4j.Logger _logger
Constructor Detail

FailoverMethodTest

public FailoverMethodTest()
Method Detail

createBroker

public void createBroker()
                  throws Exception
Overrides:
createBroker in class org.apache.qpid.server.util.InternalBrokerBaseCase
Throws:
Exception

stopBroker

public void stopBroker()
Overrides:
stopBroker in class org.apache.qpid.server.util.InternalBrokerBaseCase

testFailoverRoundRobinDelay

public void testFailoverRoundRobinDelay()
                                 throws org.apache.qpid.url.URLSyntaxException,
                                        InterruptedException,
                                        JMSException
Test that the round robin method has the correct delays. The first connection to vm://:1 will work but the localhost connection should fail but the duration it takes to report the failure is what is being tested.

Throws:
org.apache.qpid.url.URLSyntaxException
InterruptedException
JMSException

testFailoverSingleDelay

public void testFailoverSingleDelay()
                             throws org.apache.qpid.url.URLSyntaxException,
                                    org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException,
                                    InterruptedException,
                                    JMSException
Throws:
org.apache.qpid.url.URLSyntaxException
org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException
InterruptedException
JMSException

onException

public void onException(JMSException e)
Specified by:
onException in interface ExceptionListener

testNoFailover

public void testNoFailover()
                    throws org.apache.qpid.url.URLSyntaxException,
                           org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException,
                           InterruptedException,
                           JMSException
Test that setting 'nofailover' as the failover policy does not result in delays or connection attempts when the initial connection is lost. Test validates that there is a connection delay as required on initial connection.

Throws:
org.apache.qpid.url.URLSyntaxException
org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException
InterruptedException
JMSException


Licensed to the Apache Software Foundation