org.apache.qpid.server.logging
Class BrokerLoggingTest

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.server.logging.AbstractTestLogging
                      extended by org.apache.qpid.server.logging.BrokerLoggingTest
All Implemented Interfaces:
junit.framework.Test

public class BrokerLoggingTest
extends AbstractTestLogging

Broker Test Suite The Broker test suite validates that the follow log messages as specified in the Functional Specification. BRK-1001 : Startup : Version: Build: BRK-1002 : Starting : Listening on port BRK-1003 : Shuting down : port BRK-1004 : Ready BRK-1005 : Stopped BRK-1006 : Using configuration : BRK-1007 : Using logging configuration : These messages should only occur during startup. The tests need to verify the order of messages. In the case of the BRK-1002 and BRK-1003 the respective ports should only be available between the two log messages.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
 
Fields inherited from class org.apache.qpid.server.logging.AbstractTestLogging
_configLoader, _monitor, _serverConfiguration, DEFAULT_LOG_WAIT, TEST_LOG_PREFIX
 
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
BrokerLoggingTest()
           
 
Method Summary
 void setUp()
           
 void testBrokerShutdownListeningTCPDefault()
          Description: On startup the broker may listen on a number of ports and protocols.
 void testBrokerShutdownListeningTCPSSL()
          Description: On startup the broker may listen on a number of ports and protocols.
 void testBrokerShutdownStopped()
          Description: Input: No input, all clean broker shutdowns will show BRK-1005 messages.
 void testBrokerStartupConfiguration()
          Description: On startup the broker must report the active configuration file.
 void testBrokerStartupCustomLog4j()
          Description: On startup the broker must report correctly report the log4j file in use.
 void testBrokerStartupDefaultLog4j()
          Description: On startup the broker must report correctly report the log4j file in use.
 void testBrokerStartupListeningTCPDefault()
          Description: On startup the broker may listen on a number of ports and protocols.
 void testBrokerStartupListeningTCPSSL()
          Description: On startup the broker may listen on a number of ports and protocols.
 void testBrokerStartupReady()
          Description: The final message the broker will print when it has performed all initialisation and listener startups will be to log the BRK-1004 Ready message Input: No input, all successful broker startups will show BRK-1004 messages.
 void testBrokerStartupStartup()
          Description: On startup the broker reports the broker version number and svn build revision.
 
Methods inherited from class org.apache.qpid.server.logging.AbstractTestLogging
assertLoggingNotYetOccured, dumpLogs, dumpLogs, filterResultsByVirtualHost, findMatches, fromActor, fromMessage, fromSubject, getChannelID, getConnectionID, getLog, getLogMessage, getLogMessageFromEnd, getMessageID, getMessageString, setLogMessagePrefix, splitResultsOnConnectionID, tearDown, validateMessageID, waitAndFindMatches, waitAndFindMatches, waitForMessage, waitForMessage
 
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
 
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
 

Constructor Detail

BrokerLoggingTest

public BrokerLoggingTest()
Method Detail

setUp

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

testBrokerStartupConfiguration

public void testBrokerStartupConfiguration()
                                    throws Exception
Description: On startup the broker must report the active configuration file. The logging system must output this so that we can know what configuration is being used for this broker instance. Input: The value of -c specified on the command line. Output: MESSAGE BRK-1006 : Using configuration : Constraints: This MUST BE the first BRK log message. Validation Steps: 1. This is first BRK log message. 2. The BRK ID is correct 3. The config file is the full path to the file specified on the commandline.

Throws:
Exception - caused by broker startup

testBrokerStartupDefaultLog4j

public void testBrokerStartupDefaultLog4j()
                                   throws Exception
Description: On startup the broker must report correctly report the log4j file in use. This is important as it can help diagnose why logging messages are not being reported. Input: No custom -l value should be provided on the command line so that the default value is correctly reported. Output: MESSAGE BRK-1007 : Using logging configuration : <$QPID_HOME>/etc/log4j.xml Validation Steps: 1. The BRK ID is correct 2. This occurs before the BRK-1001 startup message. 3. The log4j file is the full path to the file specified on the commandline.

Throws:
Exception - caused by broker startup

testBrokerStartupCustomLog4j

public void testBrokerStartupCustomLog4j()
                                  throws Exception
Description: On startup the broker must report correctly report the log4j file in use. This is important as it can help diagnose why logging messages are not being reported. The broker must also be capable of correctly recognising the command line property to specify the custom logging configuration. Input: The value of -l specified on the command line. Output: MESSAGE BRK-1007 : Using logging configuration : Validation Steps: 1. The BRK ID is correct 2. This should occur before the BRK-1001 : Startup message 3. The log4j file is the full path to the file specified on the commandline.

Throws:
Exception - caused by broker startup

testBrokerStartupStartup

public void testBrokerStartupStartup()
                              throws Exception
Description: On startup the broker reports the broker version number and svn build revision. This information is retrieved from the resource 'qpidversion.properties' which is located via the classloader. Input: The 'qpidversion.properties' file located on the classpath. Output: MESSAGE BRK-1001 : Startup : qpid Version: 0.6 Build: 767150 Validation Steps: 1. The BRK ID is correct 2. This occurs before any BRK-1002 listening messages are reported.

Throws:
Exception - caused by broker startup

testBrokerStartupListeningTCPDefault

public void testBrokerStartupListeningTCPDefault()
                                          throws Exception
Description: On startup the broker may listen on a number of ports and protocols. Each of these must be reported as they are made available. Input: The default configuration with no SSL Output: MESSAGE BRK-1002 : Starting : Listening on TCP port 5672 Constraints: Additional broker configuration will occur between the Startup(BRK-1001) and Starting(BRK-1002) messages depending on what VirtualHosts are configured. Validation Steps: 1. The BRK ID is correct 2. This occurs after the BRK-1001 startup message 3. Using the default configuration a single BRK-1002 will be printed showing values TCP / 5672

Throws:
Exception - caused by broker startup

testBrokerStartupListeningTCPSSL

public void testBrokerStartupListeningTCPSSL()
                                      throws Exception
Description: On startup the broker may listen on a number of ports and protocols. Each of these must be reported as they are made available. Input: The default configuration with SSL enabled Output: MESSAGE BRK-1002 : Starting : Listening on TCP port 5672 MESSAGE BRK-1002 : Starting : Listening on TCP/SSL port 8672 Constraints: Additional broker configuration will occur between the Startup(BRK-1001) and Starting(BRK-1002) messages depending on what VirtualHosts are configured. Validation Steps: 1. The BRK ID is correct 2. This occurs after the BRK-1001 startup message 3. With SSL enabled in the configuration two BRK-1002 will be printed (order is not specified) 1. One showing values TCP / 5672 2. One showing values TCP/SSL / 5672

Throws:
Exception - caused by broker startup

testBrokerStartupReady

public void testBrokerStartupReady()
                            throws Exception
Description: The final message the broker will print when it has performed all initialisation and listener startups will be to log the BRK-1004 Ready message Input: No input, all successful broker startups will show BRK-1004 messages. Output: 2009-07-09 15:50:20 +0100 MESSAGE BRK-1004 : Qpid Broker Ready Validation Steps: 1. The BRK ID is correct 2. This occurs after the BRK-1001 startup message 3. This must be the last message the broker prints after startup. Currently, if there is no further interaction with the broker then there should be no more logging.

Throws:
Exception - caused by broker startup

testBrokerShutdownListeningTCPDefault

public void testBrokerShutdownListeningTCPDefault()
                                           throws Exception
Description: On startup the broker may listen on a number of ports and protocols. Each of these must then report a shutting down message as they stop listening. Input: The default configuration with no SSL Output: MESSAGE BRK-1003 : Shutting down : TCP port 5672 Validation Steps: 1. The BRK ID is correct 2. Only TCP is reported with the default configuration with no SSL. 3. The default port is correct 4. The port is not accessible after this message

Throws:
Exception - caused by broker startup

testBrokerShutdownListeningTCPSSL

public void testBrokerShutdownListeningTCPSSL()
                                       throws Exception
Description: On startup the broker may listen on a number of ports and protocols. Each of these must be reported as they are made available. Input: The default configuration with SSL enabled Output: MESSAGE BRK-1002 : Starting : Listening on TCP port 5672 MESSAGE BRK-1002 : Starting : Listening on TCP/SSL port 8672 Constraints: Additional broker configuration will occur between the Startup(BRK-1001) and Starting(BRK-1002) messages depending on what VirtualHosts are configured. Validation Steps: 1. The BRK ID is correct 2. This occurs after the BRK-1001 startup message 3. With SSL enabled in the configuration two BRK-1002 will be printed (order is not specified) 1. One showing values TCP / 5672 2. One showing values TCP/SSL / 5672

Throws:
Exception - caused by broker startup

testBrokerShutdownStopped

public void testBrokerShutdownStopped()
                               throws Exception
Description: Input: No input, all clean broker shutdowns will show BRK-1005 messages. Output: MESSAGE BRK-1005 : Stopped Constraints: This is the LAST message the broker will log. Validation Steps: 1. The BRK ID is correct 2. This is the last message the broker will log.

Throws:
Exception - caused by broker startup


Licensed to the Apache Software Foundation