org.apache.qpid.server.logging
Class DerbyMessageStoreLoggingTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.qpid.test.utils.QpidTestCase
org.apache.qpid.test.utils.QpidBrokerTestCase
org.apache.qpid.server.logging.AbstractTestLogging
org.apache.qpid.server.logging.MemoryMessageStoreLoggingTest
org.apache.qpid.server.logging.DerbyMessageStoreLoggingTest
- All Implemented Interfaces:
- junit.framework.Test
public class DerbyMessageStoreLoggingTest
- extends MemoryMessageStoreLoggingTest
The MessageStore test suite validates that the follow log messages as
specified in the Functional Specification.
This suite of tests validate that the MessageStore messages occur correctly
and according to the following format:
MST-1001 : Created :
MST-1003 : Closed
NOTE: Only for Persistent Stores
MST-1002 : Store location :
MST-1004 : Recovery Start [: ]
MST-1005 : Recovered messages for queue
MST-1006 : Recovery Complete [: ]
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 |
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 |
DerbyMessageStoreLoggingTest
public DerbyMessageStoreLoggingTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class MemoryMessageStoreLoggingTest
- Throws:
Exception
testMessageStoreStoreLocation
public void testMessageStoreStoreLocation()
throws Exception
- Description:
Persistent MessageStores will require space on disk to persist the data.
This value will be logged on startup after the MessageStore has been
created.
Input:
Default configuration
Output:
MST-1002 : Store location :
Validation Steps:
1. The MST ID is correct
2. This must occur after MST-1001
- Throws:
Exception
testMessageStoreRecoveryStart
public void testMessageStoreRecoveryStart()
throws Exception
- Description:
Persistent message stores may have state on disk that they must recover
during startup. As the MessageStore starts up it will report that it is
about to start the recovery process by logging MST-1004. This message
will always be logged for persistent MessageStores. If there is no data
to recover then there will be no subsequent recovery messages.
Input:
Default persistent configuration
Output:
MST-1004 : Recovery Start
Validation Steps:
1. The MST ID is correct
2. The MessageStore must have first logged a creation event.
- Throws:
Exception
testMessageStoreRecoveryComplete
public void testMessageStoreRecoveryComplete()
throws Exception
- Description:
Once all persistent queues have been recovered and the MessageStore has completed all recovery it must logged that the recovery process has completed.
Input:
Default persistent configuration
Output:
MST-1006 : Recovery Complete
Validation Steps:
1. The MST ID is correct
2. This is the last message from the MessageStore during startup.
3. This must be proceeded by a MST-1006 Recovery Start.
- Throws:
Exception
testMessageStoreQueueRecoveryStart
public void testMessageStoreQueueRecoveryStart()
throws Exception
- Description:
A persistent MessageStore may have data to recover from disk. The message store will use MST-1004 to report the start of recovery for a specific queue that it has previously persisted.
Input:
Default persistent configuration
Output:
MST-1004 : Recovery Start :
Validation Steps:
1. The MST ID is correct
2. This must occur after the recovery start MST-1004 has been logged.
- Throws:
Exception
testMessageStoreQueueRecoveryComplete
public void testMessageStoreQueueRecoveryComplete()
throws Exception
- Description:
After the queue has been recovered the store will log that recovery has been completed. The MessageStore must not report further status about the recovery of this queue after this message. In addition every MST-1004 queue recovery start message must be matched with a MST-1006 recovery complete.
Input:
Default persistent configuration
Output:
MST-1006 : Recovery Complete :
Validation Steps:
1. The MST ID is correct
2. This must occur after the queue recovery start MST-1004 has been logged.
3. The queue.name is non-empty
4. The queue.name correlates with a previous recovery start
- Throws:
Exception
testMessageStoreQueueRecoveryCountEmpty
public void testMessageStoreQueueRecoveryCountEmpty()
throws Exception
- Description:
A persistent queue must be persisted so that on recovery it can be restored independently of any messages that may be stored on it. This test verifies that the MessageStore will log that it has recovered 0 messages for persistent queues that do not have any messages.
Input:
1. Default persistent configuration
2. Persistent queue with no messages enqueued
Output:
MST-1005 : Recovered 0 messages for queue
Validation Steps:
3. The MST ID is correct
4. This must occur after the queue recovery start MST-1004 has been logged.
5. The count is 0
6. 'messages' is correctly printed
7. The queue.name is non-empty
- Throws:
Exception
testMessageStoreQueueRecoveryCountPlural
public void testMessageStoreQueueRecoveryCountPlural()
throws Exception
- Description:
On recovery all the persistent messages that are stored on disk must be returned to the queue. MST-1005 will report the number of messages that have been recovered from disk.
Input:
1. Default persistent configuration
2. Persistent queue with multiple messages enqueued
Output:
MST-1005 : Recovered messages for queue
Validation Steps:
3. The MST ID is correct
4. This must occur after the queue recovery start MST-1004 has been logged.
5. The count is > 1
6. 'messages' is correctly printed
7. The queue.name is non-empty
- Throws:
Exception
Licensed to the Apache Software Foundation