org.apache.qpid.server.queue
Class QueueDepthWithSelectorTest

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.queue.QueueDepthWithSelectorTest
All Implemented Interfaces:
junit.framework.Test

public class QueueDepthWithSelectorTest
extends org.apache.qpid.server.util.InternalBrokerBaseCase

Test Case to ensure that messages are correctly returned. This includes checking: - The message is returned. - The broker doesn't leak memory. - The broker's state is correct after test. Why is this hardcoded to InVM testing, should be converted to QTC.


Field Summary
protected  Connection _clientConnection
           
protected  Context _context
           
protected static org.apache.log4j.Logger _logger
           
protected  Message[] _messages
           
protected  MessageProducer _producer
           
protected  Connection _producerConnection
           
protected  Session _producerSession
           
protected  Queue _queue
           
protected  String BROKER
           
protected static int MSG_COUNT
           
protected  String QUEUE
           
protected  String VHOST
           
 
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY
 
Constructor Summary
QueueDepthWithSelectorTest()
           
 
Method Summary
protected  void init()
           
protected  Message nextMessage(int msgNo)
          Get the next message putting the given count into the intProperties as ID.
 void setUp()
           
 void tearDown()
           
 void test()
           
protected  void verifyAllMessagesRecevied(int expectedDepth)
           
protected  void verifyBrokerState(int expectedDepth)
           
 
Methods inherited from class org.apache.qpid.server.util.InternalBrokerBaseCase
acknowledge, browse, checkStoreContents, configure, createBroker, getChannel, getConfiguration, getConfigXml, getMessageStore, getQUEUE_NAME, getQueue, getRegistry, getSession, getVirtualHost, isStarted, publishMessages, setChannel, setConfiguration, setConfigXml, setMessageStore, setQUEUE_NAME, setQueue, setRegistry, setSession, setStarted, setVirtualHost, stopBroker, subscribe
 
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.apache.log4j.Logger _logger

BROKER

protected final String BROKER
See Also:
Constant Field Values

VHOST

protected final String VHOST
See Also:
Constant Field Values

QUEUE

protected final String QUEUE

_context

protected Context _context

_clientConnection

protected Connection _clientConnection

_producerConnection

protected Connection _producerConnection

_producerSession

protected Session _producerSession

_producer

protected MessageProducer _producer

MSG_COUNT

protected static int MSG_COUNT

_messages

protected Message[] _messages

_queue

protected Queue _queue
Constructor Detail

QueueDepthWithSelectorTest

public QueueDepthWithSelectorTest()
Method Detail

setUp

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

tearDown

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

test

public void test()
          throws Exception
Throws:
Exception

init

protected void init()
             throws NamingException,
                    JMSException,
                    org.apache.qpid.AMQException
Throws:
NamingException
JMSException
org.apache.qpid.AMQException

verifyBrokerState

protected void verifyBrokerState(int expectedDepth)

verifyAllMessagesRecevied

protected void verifyAllMessagesRecevied(int expectedDepth)
                                  throws Exception
Throws:
Exception

nextMessage

protected Message nextMessage(int msgNo)
                       throws JMSException
Get the next message putting the given count into the intProperties as ID.

Parameters:
msgNo - the message count to store as ID.
Returns:
Throws:
JMSException


Licensed to the Apache Software Foundation