org.apache.qpid.systest
Class TestingBaseCase

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.test.utils.QpidBrokerTestCase
                  extended by org.apache.qpid.systest.TestingBaseCase
All Implemented Interfaces:
ExceptionListener, junit.framework.Test, org.apache.qpid.jms.ConnectionListener
Direct Known Subclasses:
GlobalQueuesTest, MergeConfigurationTest, SubscriptionTest

public class TestingBaseCase
extends QpidBrokerTestCase
implements ExceptionListener, org.apache.qpid.jms.ConnectionListener


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
protected  JMSException _connectionException
           
(package private)  Topic _destination
           
protected  CountDownLatch _disconnectionLatch
           
protected  Exception _publisherError
           
protected static long DISCONNECTION_WAIT
           
protected  int MAX_QUEUE_MESSAGE_COUNT
           
protected  int MESSAGE_SIZE
           
 
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _logger, _output, _outputFile, _testName, BROKER_READY, CONTENT, CPP, DEFAULT_MANAGEMENT_PORT, DEFAULT_MESSAGE_SIZE, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_VM_PORT, EXTERNAL, INDEX, JAVA, LOGMONITOR_TIMEOUT, QPID_HOME, QpidHome, QUEUE, RECEIVE_TIMEOUT, TOPIC, VM
 
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY
 
Constructor Summary
TestingBaseCase()
           
 
Method Summary
 void bytesReceived(long count)
           
 void bytesSent(long count)
           
 void failoverComplete()
           
 void onException(JMSException e)
           
 boolean preFailover(boolean redirect)
           
 boolean preResubscribe()
           
protected  void setProperty(String property, String value)
           
 void setUp()
           
protected  void topicConsumer(int ackMode, boolean durable)
          Perform the Main test of a topic Consumer with the given AckMode.
 
Methods inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
cleanBroker, createMessage, createNextMessage, drainQueue, getBroker, getBrokerCommand, getClientConnection, getConfigurationStringProperty, getConnection, getConnection, getConnection, getConnectionFactory, getConnectionFactory, getConnectionURL, getInitialContext, getLogger, getManagementPort, getMessageSize, getPort, getPort, getTestConfigFile, getTestQueue, getTestQueueName, getTestVirtualhostsFile, isBroker010, isBroker08, isBrokerStorePersistent, isCppBroker, isExternalBroker, isJavaBroker, makeVirtualHostPersistent, reloadBrokerSecurityConfig, restartBroker, restartBroker, revertLoggingLevels, revertSystemProperties, runBare, saveTestConfiguration, saveTestVirtualhosts, sendMessage, sendMessage, sendMessage, setBrokerEnvironment, setBrokerOnlySystemProperty, setConfigurationProperty, setLoggerLevel, setMessageSize, setSystemProperty, setSystemProperty, setTestClientSystemProperty, startBroker, startBroker, stopBroker, stopBroker, tearDown
 
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase
getTestProfileMessageStoreClassName, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, 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

_destination

Topic _destination

_disconnectionLatch

protected CountDownLatch _disconnectionLatch

MAX_QUEUE_MESSAGE_COUNT

protected int MAX_QUEUE_MESSAGE_COUNT

MESSAGE_SIZE

protected int MESSAGE_SIZE

DISCONNECTION_WAIT

protected static final long DISCONNECTION_WAIT
See Also:
Constant Field Values

_publisherError

protected Exception _publisherError

_connectionException

protected JMSException _connectionException
Constructor Detail

TestingBaseCase

public TestingBaseCase()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class QpidBrokerTestCase
Throws:
Exception

setProperty

protected void setProperty(String property,
                           String value)
                    throws NamingException,
                           IOException,
                           ConfigurationException
Throws:
NamingException
IOException
ConfigurationException

topicConsumer

protected void topicConsumer(int ackMode,
                             boolean durable)
                      throws Exception
Perform the Main test of a topic Consumer with the given AckMode. Test creates a new connection and sets up the connection to prevent failover A new consumer is connected and started so that it will prefetch msgs. An asynchrounous publisher is started to fill the broker with messages. We then wait to be notified of the disconnection via the ExceptionListener 0-10 does not have the same notification paths but sync() apparently should give us the exception, currently it doesn't, so the test is excluded from 0-10 We should ensure that this test has the same path for all protocol versions. Clients should not have to modify their code based on the protocol in use.

Parameters:
ackMode - @see javax.jms.Session
Throws:
Exception

onException

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

bytesSent

public void bytesSent(long count)
Specified by:
bytesSent in interface org.apache.qpid.jms.ConnectionListener

bytesReceived

public void bytesReceived(long count)
Specified by:
bytesReceived in interface org.apache.qpid.jms.ConnectionListener

preFailover

public boolean preFailover(boolean redirect)
Specified by:
preFailover in interface org.apache.qpid.jms.ConnectionListener

preResubscribe

public boolean preResubscribe()
Specified by:
preResubscribe in interface org.apache.qpid.jms.ConnectionListener

failoverComplete

public void failoverComplete()
Specified by:
failoverComplete in interface org.apache.qpid.jms.ConnectionListener


Licensed to the Apache Software Foundation