qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r886842 [2/2] - in /qpid/trunk/qpid/java: ./ broker/ broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/exchange/ broker/src/main/java/org/apache/qpid/server/logging/ broker/src/main/java/org/apache/qpi...
Date Thu, 03 Dec 2009 16:21:11 GMT
Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,60 +20,45 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLoggerImpl;
-import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
+import org.apache.qpid.AMQException;
 
 import java.util.List;
 
 /**
- * Test : AMQPConnectionActorTest
- * Validate the AMQPConnectionActor class.
+ * Test : AMQPManagementActorTest
+ * Validate the AMQPManagementActor class.
  *
  * The test creates a new AMQPActor and then logs a message using it.
  *
  * The test then verifies that the logged message was the only one created and
  * that the message contains the required message.
  */
-public class ManagementActorTest extends TestCase
+public class ManagementActorTest extends BaseActorTestCase
 {
 
-    LogActor _amqpActor;
-    UnitTestMessageLogger _rawLogger;
     private static final String IP = "127.0.0.1";
     private static final String CONNECTION_ID = "1";
     private String _threadName;
 
-    public void setUp() throws ConfigurationException
+    @Override
+    protected void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
     {
-        Configuration config = new PropertiesConfiguration();
-        ServerConfiguration serverConfig = new ServerConfiguration(config);
-
-        serverConfig.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "on");
-
-        _rawLogger = new UnitTestMessageLogger();
-        RootMessageLogger rootLogger =
-                new RootMessageLoggerImpl(serverConfig, _rawLogger);
-
-        _amqpActor = new ManagementActor(rootLogger);
+        super.setUpWithConfig(serverConfig);
+        _amqpActor = new ManagementActor(_rootLogger);
 
         // Set the thread name to be the same as a RMI JMX Connection would use
         _threadName = Thread.currentThread().getName();
         Thread.currentThread().setName("RMI TCP Connection(" + CONNECTION_ID + ")-" + IP);
     }
 
-    public void tearDown()
+    @Override
+    public void tearDown() throws Exception
     {
         Thread.currentThread().setName(_threadName);
-        _rawLogger.clearLogMessages();
+        super.tearDown();
     }
 
     /**
@@ -117,7 +102,7 @@
                     logs.get(0).toString().contains("{"));
 
         // Verify that the message has the correct type
-        assertTrue("Message contains the [mng: prefix",
+        assertTrue("Message does not contain the [mng: prefix",
                    logs.get(0).toString().contains("[mng:"));
 
         // Verify that the logged message does not contains the 'ch:' marker

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,49 +20,27 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLoggerImpl;
-import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
 import org.apache.qpid.server.queue.MockAMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.AMQException;
 
 import java.util.List;
 
-public class QueueActorTest extends TestCase
+public class QueueActorTest extends BaseConnectionActorTestCase
 {
-    LogActor _amqpActor;
-    UnitTestMessageLogger _rawLogger;
 
-    public void setUp() throws ConfigurationException
+    @Override
+    protected void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
     {
-        Configuration config = new PropertiesConfiguration();
-        ServerConfiguration serverConfig = new ServerConfiguration(config);
-
-        serverConfig.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "on");        
-
-        _rawLogger = new UnitTestMessageLogger();
-        RootMessageLogger rootLogger =
-                new RootMessageLoggerImpl(serverConfig, _rawLogger);
+        super.setUpWithConfig(serverConfig);
 
         MockAMQQueue queue = new MockAMQQueue(getName());
 
-        queue.setVirtualHost(ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next());
+        queue.setVirtualHost(_session.getVirtualHost());
 
-        _amqpActor = new QueueActor(queue, rootLogger);
-    }
-
-    public void tearDown()
-    {
-        _rawLogger.clearLogMessages();
-        ApplicationRegistry.remove();
+        _amqpActor = new QueueActor(queue, _rootLogger);
     }
 
     /**

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,23 +20,13 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLoggerImpl;
-import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
 import org.apache.qpid.server.subscription.MockSubscription;
-import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.MockAMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.AMQException;
 
-import java.security.Principal;
 import java.util.List;
 
 /**
@@ -48,38 +38,24 @@
  * The test then verifies that the logged message was the only one created and
  * that the message contains the required message.
  */
-public class SubscriptionActorTest extends TestCase
+public class SubscriptionActorTest extends BaseConnectionActorTestCase
 {
 
-    LogActor _amqpActor;
-    UnitTestMessageLogger _rawLogger;
-
-    public void setUp() throws ConfigurationException
+    @Override
+    protected void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
     {
-        Configuration config = new PropertiesConfiguration();
-        ServerConfiguration serverConfig = new ServerConfiguration(config);
-
-        serverConfig.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "on");
+        super.setUpWithConfig(serverConfig);
 
-        _rawLogger = new UnitTestMessageLogger();
-        RootMessageLogger rootLogger =
-                new RootMessageLoggerImpl(serverConfig, _rawLogger);
 
         MockSubscription mockSubscription = new MockSubscription();
 
         MockAMQQueue queue = new MockAMQQueue(getName());
 
-        queue.setVirtualHost(ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next());
+        queue.setVirtualHost(_session.getVirtualHost());
 
         mockSubscription.setQueue(queue,false);
 
-        _amqpActor = new SubscriptionActor(rootLogger, mockSubscription);
-    }
-
-    public void tearDown()
-    {
-        _rawLogger.clearLogMessages();
-        ApplicationRegistry.remove();
+        _amqpActor = new SubscriptionActor(_rootLogger, mockSubscription);
     }
 
     /**

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java Thu Dec  3 16:19:14 2009
@@ -27,7 +27,11 @@
     public TestLogActor(RootMessageLogger rootLogger)
     {
         super(rootLogger);
-        _logString = "[Test Actor] ";
+    }
+
+    public String getLogMessage()
+    {
+        return "[Test Actor] ";
     }
 }
     
\ No newline at end of file

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java Thu Dec  3 16:19:14 2009
@@ -22,7 +22,6 @@
 
 import junit.framework.TestCase;
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.logging.LogActor;
@@ -87,9 +86,8 @@
      *
      * @param logs     the logs generated during test run
      * @param tag      the tag to check for
-     * @param expected
+     * @param expected the expected log messages
      *
-     * @return the log message section for further testing
      */
     protected void validateLogMessage(List<Object> logs, String tag, String[] expected)
     {

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,12 +22,15 @@
 
 import java.util.List;
 
+/**
+ * Test BND Log Messages
+ */
 public class BindingMessagesTest extends AbstractTestMessages
 {
 
-    public void testMessage1001_NoArgs()
+    public void testBindCreate_NoArgs()
     {
-        _logMessage = BindingMessages.BND_1001(null, false);
+        _logMessage = BindingMessages.BND_CREATED(null, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create"};
@@ -35,11 +38,11 @@
         validateLogMessage(log, "BND-1001", expected);
     }
 
-    public void testMessage1001_Args()
+    public void testBindCreate_Args()
     {
         String arguments = "arguments";
 
-        _logMessage = BindingMessages.BND_1001(arguments, true);
+        _logMessage = BindingMessages.BND_CREATED(arguments, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create", ": Arguments :", arguments};
@@ -47,9 +50,9 @@
         validateLogMessage(log, "BND-1001", expected);
     }
         
-    public void testMessage1002()
+    public void testBindDelete()
     {
-        _logMessage = BindingMessages.BND_1002();
+        _logMessage = BindingMessages.BND_DELETED();
 
         List<Object> log = performLog();
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,14 +22,17 @@
 
 import java.util.List;
 
+/**
+ * Test BRK log Messages
+ */
 public class BrokerMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001()
+    public void testBrokerStartup()
     {
         String version = "Qpid 0.6";
         String build = "796936M";
 
-        _logMessage = BrokerMessages.BRK_1001(version, build);
+        _logMessage = BrokerMessages.BRK_STARTUP(version, build);
         List<Object> log = performLog();
 
         String[] expected = {"Startup :", "Version:", version, "Build:", build};
@@ -37,12 +40,12 @@
         validateLogMessage(log, "BRK-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testBrokerListening()
     {
         String transport = "TCP";
         Integer port = 2765;
 
-        _logMessage = BrokerMessages.BRK_1002(transport, port);
+        _logMessage = BrokerMessages.BRK_LISTENING(transport, port);
 
         List<Object> log = performLog();
 
@@ -52,12 +55,12 @@
         validateLogMessage(log, "BRK-1002", expected);
     }
 
-    public void testMessage1003()
+    public void testBrokerShuttingDown()
     {
         String transport = "TCP";
         Integer port = 2765;
 
-        _logMessage = BrokerMessages.BRK_1003(transport, port);
+        _logMessage = BrokerMessages.BRK_SHUTTING_DOWN(transport, port);
 
         List<Object> log = performLog();
 
@@ -66,9 +69,9 @@
         validateLogMessage(log, "BRK-1003", expected);
     }
 
-    public void testMessage1004()
+    public void testBrokerReady()
     {
-        _logMessage = BrokerMessages.BRK_1004();
+        _logMessage = BrokerMessages.BRK_READY();
         List<Object> log = performLog();
 
         String[] expected = {"Ready"};
@@ -76,9 +79,9 @@
         validateLogMessage(log, "BRK-1004", expected);
     }
 
-    public void testMessage1005()
+    public void testBrokerStopped()
     {
-        _logMessage = BrokerMessages.BRK_1005();
+        _logMessage = BrokerMessages.BRK_STOPPED();
         List<Object> log = performLog();
 
         String[] expected = {"Stopped"};
@@ -86,11 +89,11 @@
         validateLogMessage(log, "BRK-1005", expected);
     }
 
-    public void testMessage1006()
+    public void testBrokerConfig()
     {
         String path = "/file/path/to/configuration.xml";
 
-        _logMessage = BrokerMessages.BRK_1006(path);
+        _logMessage = BrokerMessages.BRK_CONFIG(path);
         List<Object> log = performLog();
 
         String[] expected = {"Using configuration :", path};
@@ -98,11 +101,11 @@
         validateLogMessage(log, "BRK-1006", expected);
     }
 
-    public void testMessage1007()
+    public void testBrokerLogConfig()
     {
         String path = "/file/path/to/configuration.xml";
 
-        _logMessage = BrokerMessages.BRK_1007(path);
+        _logMessage = BrokerMessages.BRK_LOG_CONFIG(path);
         List<Object> log = performLog();
 
         String[] expected = {"Using logging configuration :", path};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -20,14 +20,16 @@
  */
 package org.apache.qpid.server.logging.messages;
 
-import java.text.MessageFormat;
 import java.util.List;
 
+/**
+ * Test CHN Log Messges 
+ */
 public class ChannelMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001()
+    public void testChannelCreate()
     {
-        _logMessage = ChannelMessages.CHN_1001();
+        _logMessage = ChannelMessages.CHN_CREATE();
         List<Object> log = performLog();
 
         // We use the MessageFormat here as that is what the ChannelMessage
@@ -37,11 +39,11 @@
         validateLogMessage(log, "CHN-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testChannelFlow()
     {
         String flow = "ON";
 
-        _logMessage = ChannelMessages.CHN_1002(flow);
+        _logMessage = ChannelMessages.CHN_FLOW(flow);
         List<Object> log = performLog();
 
         String[] expected = {"Flow", flow};
@@ -49,9 +51,9 @@
         validateLogMessage(log, "CHN-1002", expected);
     }
 
-    public void testMessage1003()
+    public void testChannelClose()
     {
-        _logMessage = ChannelMessages.CHN_1003();
+        _logMessage = ChannelMessages.CHN_CLOSE();
         List<Object> log = performLog();
 
         String[] expected = {"Close"};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,14 +22,17 @@
 
 import java.util.List;
 
+/**
+ * Test CON Log Messages
+ */
 public class ConnectionMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001_WithClientIDProtocolVersion()
+    public void testConnectionOpen_WithClientIDProtocolVersion()
     {
         String clientID = "client";
         String protocolVersion = "8-0";
 
-        _logMessage = ConnectionMessages.CON_1001(clientID, protocolVersion, true , true);
+        _logMessage = ConnectionMessages.CON_OPEN(clientID, protocolVersion, true , true);
         List<Object> log = performLog();
 
         String[] expected = {"Open :", "Client ID", clientID,
@@ -38,11 +41,11 @@
         validateLogMessage(log, "CON-1001", expected);
     }
 
-    public void testMessage1001_WithClientIDNoProtocolVersion()
+    public void testConnectionOpen_WithClientIDNoProtocolVersion()
     {
         String clientID = "client";        
 
-        _logMessage = ConnectionMessages.CON_1001(clientID, null,true, false);
+        _logMessage = ConnectionMessages.CON_OPEN(clientID, null,true, false);
         List<Object> log = performLog();
 
         String[] expected = {"Open :", "Client ID", clientID};
@@ -50,11 +53,11 @@
         validateLogMessage(log, "CON-1001", expected);
     }
 
-    public void testMessage1001_WithNOClientIDProtocolVersion()
+    public void testConnectionOpen_WithNOClientIDProtocolVersion()
     {
         String protocolVersion = "8-0";
 
-        _logMessage = ConnectionMessages.CON_1001(null, protocolVersion, false , true);
+        _logMessage = ConnectionMessages.CON_OPEN(null, protocolVersion, false , true);
         List<Object> log = performLog();
 
         String[] expected = {"Open", ": Protocol Version :", protocolVersion};
@@ -62,9 +65,9 @@
         validateLogMessage(log, "CON-1001", expected);
     }
 
-    public void testMessage1001_WithNoClientIDNoProtocolVersion()
+    public void testConnectionOpen_WithNoClientIDNoProtocolVersion()
     {
-        _logMessage = ConnectionMessages.CON_1001(null, null,false, false);
+        _logMessage = ConnectionMessages.CON_OPEN(null, null,false, false);
         List<Object> log = performLog();
 
         String[] expected = {"Open"};
@@ -74,9 +77,9 @@
 
 
 
-    public void testMessage1002()
+    public void testConnectionClose()
     {
-        _logMessage = ConnectionMessages.CON_1002();
+        _logMessage = ConnectionMessages.CON_CLOSE();
         List<Object> log = performLog();
 
         String[] expected = {"Close"};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -25,9 +25,12 @@
 
 import java.util.List;
 
+/**
+ * Test EXH Log Messages
+ */
 public class ExchangeMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001_Transient()
+    public void testExchangeCreated_Transient()
     {
         // Get the Default Exchange on the Test Vhost for testing
         Exchange exchange = ApplicationRegistry.getInstance().
@@ -37,7 +40,7 @@
         String type = exchange.getType().toString();
         String name = exchange.getName().toString();
 
-        _logMessage = ExchangeMessages.EXH_1001(type, name, false);
+        _logMessage = ExchangeMessages.EXH_CREATED(type, name, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Type:", type, "Name:", name};
@@ -45,7 +48,7 @@
         validateLogMessage(log, "EXH-1001", expected);
     }
 
-    public void testMessage1001_Persistent()
+    public void testExchangeCreated_Persistent()
     {
         // Get the Default Exchange on the Test Vhost for testing
         Exchange exchange = ApplicationRegistry.getInstance().
@@ -55,7 +58,7 @@
         String type = exchange.getType().toString();
         String name = exchange.getName().toString();
 
-        _logMessage = ExchangeMessages.EXH_1001(type, name, true);
+        _logMessage = ExchangeMessages.EXH_CREATED(type, name, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Durable", "Type:", type, "Name:", name};
@@ -64,9 +67,9 @@
     }
 
 
-    public void testMessage1002()
+    public void testExchangeDeleted()
     {
-        _logMessage = ExchangeMessages.EXH_1002();
+        _logMessage = ExchangeMessages.EXH_DELETED();
         List<Object> log = performLog();
 
         String[] expected = {"Deleted"};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,11 +22,14 @@
 
 import java.util.List;
 
+/**
+ * Test MNG Log Messages
+ */
 public class ManagementConsoleMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001()
+    public void testManagementStartup()
     {
-        _logMessage = ManagementConsoleMessages.MNG_1001();
+        _logMessage = ManagementConsoleMessages.MNG_STARTUP();
         List<Object> log = performLog();
 
         String[] expected = {"Startup"};
@@ -34,12 +37,12 @@
         validateLogMessage(log, "MNG-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testManagementListening()
     {
         String transport = "JMX";
         Integer port = 8889;
 
-        _logMessage = ManagementConsoleMessages.MNG_1002(transport, port);
+        _logMessage = ManagementConsoleMessages.MNG_LISTENING(transport, port);
         List<Object> log = performLog();
 
         String[] expected = {"Starting :", transport, ": Listening on port", String.valueOf(port)};
@@ -47,12 +50,12 @@
         validateLogMessage(log, "MNG-1002", expected);
     }
 
-    public void testMessage1003()
+    public void testManagementShuttingDown()
     {
         String transport = "JMX";
         Integer port = 8889;
 
-        _logMessage = ManagementConsoleMessages.MNG_1003(transport, port);
+        _logMessage = ManagementConsoleMessages.MNG_SHUTTING_DOWN(transport, port);
         List<Object> log = performLog();
 
         String[] expected = {"Shuting down :", transport, ": port", String.valueOf(port)};
@@ -60,9 +63,9 @@
         validateLogMessage(log, "MNG-1003", expected);
     }
 
-    public void testMessage1004()
+    public void testManagementReady()
     {
-        _logMessage = ManagementConsoleMessages.MNG_1004();
+        _logMessage = ManagementConsoleMessages.MNG_READY();
         List<Object> log = performLog();
 
         String[] expected = {"Ready"};
@@ -70,9 +73,9 @@
         validateLogMessage(log, "MNG-1004", expected);
     }
 
-    public void testMessage1005()
+    public void testManagementStopped()
     {
-        _logMessage = ManagementConsoleMessages.MNG_1005();
+        _logMessage = ManagementConsoleMessages.MNG_STOPPED();
         List<Object> log = performLog();
 
         String[] expected = {"Stopped"};
@@ -80,11 +83,11 @@
         validateLogMessage(log, "MNG-1005", expected);
     }
 
-    public void testMessage1006()
+    public void testManagementSSLKeyStore()
     {
         String path = "/path/to/the/keystore/files.jks";
 
-        _logMessage = ManagementConsoleMessages.MNG_1006(path);
+        _logMessage = ManagementConsoleMessages.MNG_SSL_KEYSTORE(path);
         List<Object> log = performLog();
 
         String[] expected = {"Using SSL Keystore :", path};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -23,13 +23,16 @@
 import java.text.MessageFormat;
 import java.util.List;
 
+/**
+ * Test MST Log Messages
+ */
 public class MessageStoreMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001()
+    public void testMessageStoreCreated()
     {
         String name = "DerbyMessageStore";
 
-        _logMessage = MessageStoreMessages.MST_1001(name);
+        _logMessage = MessageStoreMessages.MST_CREATED(name);
         List<Object> log = performLog();
 
         String[] expected = {"Created :", name};
@@ -37,21 +40,21 @@
         validateLogMessage(log, "MST-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testMessageStoreStoreLocation()
     {
         String location = "/path/to/the/message/store.files";
 
-        _logMessage = ConfigStoreMessages.CFG_1002(location);
+        _logMessage = MessageStoreMessages.MST_STORE_LOCATION(location);
         List<Object> log = performLog();
 
         String[] expected = {"Store location :", location};
 
-        validateLogMessage(log, "CFG-1002", expected);
+        validateLogMessage(log, "MST-1002", expected);
     }
 
-    public void testMessage1003()
+    public void testMessageStoreClosed()
     {
-        _logMessage = MessageStoreMessages.MST_1003();
+        _logMessage = MessageStoreMessages.MST_CLOSED();
         List<Object> log = performLog();
 
         String[] expected = {"Closed"};
@@ -59,21 +62,21 @@
         validateLogMessage(log, "MST-1003", expected);
     }
 
-  /*  public void testMessage1004()
+  public void testMessageStoreRecoveryStart()
     {
-        _logMessage = MessageStoreMessages.MST_1004(null,false);
+        _logMessage = MessageStoreMessages.MST_RECOVERY_START();
         List<Object> log = performLog();
 
         String[] expected = {"Recovery Start"};
 
         validateLogMessage(log, "MST-1004", expected);
     }
-
-    public void testMessage1004_withQueue()
+/*
+    public void testMessageStoreRecoveryStart_withQueue()
     {
         String queueName = "testQueue";
 
-        _logMessage = MessageStoreMessages.MST_1004(queueName, true);
+        _logMessage = MessageStoreMessages.MST_RECOVERY_START(queueName, true);
         List<Object> log = performLog();
 
         String[] expected = {"Recovery Start :", queueName};
@@ -81,12 +84,12 @@
         validateLogMessage(log, "MST-1004", expected);
     }
 
-    public void testMessage1005()
+    public void testMessageStoreRecovered()
     {
         String queueName = "testQueue";
         Integer messasgeCount = 2000;
 
-        _logMessage = MessageStoreMessages.MST_1005(messasgeCount, queueName);
+        _logMessage = MessageStoreMessages.MST_RECOVERED(messasgeCount, queueName);
         List<Object> log = performLog();
 
         // Here we use MessageFormat to ensure the messasgeCount of 2000 is
@@ -98,9 +101,9 @@
         validateLogMessage(log, "MST-1005", expected);
     }
 
-    public void testMessage1006()
+    public void testMessageStoreRecoveryComplete()
     {
-        _logMessage = MessageStoreMessages.MST_1006(null,false);
+        _logMessage = MessageStoreMessages.MST_RECOVERY_COMPLETE(null,false);
         List<Object> log = performLog();
 
         String[] expected = {"Recovery Complete"};
@@ -108,11 +111,11 @@
         validateLogMessage(log, "MST-1006", expected);
     }
 
-    public void testMessage1006_withQueue()
+    public void testMessageStoreRecoveryComplete_withQueue()
     {
         String queueName = "testQueue";
 
-        _logMessage = MessageStoreMessages.MST_1006(queueName, true);
+        _logMessage = MessageStoreMessages.MST_RECOVERY_COMPLETE(queueName, true);
         List<Object> log = performLog();
 
         String[] expected = {"Recovery Complete :", queueName};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,14 +22,17 @@
 
 import java.util.List;
 
+/**
+ * Test QUE Log Messages
+ */
 public class QueueMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001ALL()
+    public void testQueueCreatedALL()
     {
         String owner = "guest";
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(owner, priority, true, true, true, true, true);
+        _logMessage = QueueMessages.QUE_CREATED(owner, priority, true, true, true, true, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -39,11 +42,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDelete()
+    public void testQueueCreatedOwnerAutoDelete()
     {
         String owner = "guest";
 
-        _logMessage = QueueMessages.QUE_1001(owner, null, true, true, false, false, false);
+        _logMessage = QueueMessages.QUE_CREATED(owner, null, true, true, false, false, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete"};
@@ -51,12 +54,12 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerPriority()
+    public void testQueueCreatedOwnerPriority()
     {
         String owner = "guest";
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(owner, priority, true, false, false, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(owner, priority, true, false, false, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "Priority:",
@@ -65,12 +68,12 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDeletePriority()
+    public void testQueueCreatedOwnerAutoDeletePriority()
     {
         String owner = "guest";
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(owner, priority, true, true, false, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(owner, priority, true, true, false, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -80,11 +83,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDeleteTransient()
+    public void testQueueCreatedOwnerAutoDeleteTransient()
     {
         String owner = "guest";
 
-        _logMessage = QueueMessages.QUE_1001(owner, null, true, true, false, true, false);
+        _logMessage = QueueMessages.QUE_CREATED(owner, null, true, true, false, true, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -93,12 +96,12 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDeleteTransientPriority()
+    public void testQueueCreatedOwnerAutoDeleteTransientPriority()
     {
         String owner = "guest";
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(owner, priority, true, true, false, true, true);
+        _logMessage = QueueMessages.QUE_CREATED(owner, priority, true, true, false, true, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -108,11 +111,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDeleteDurable()
+    public void testQueueCreatedOwnerAutoDeleteDurable()
     {
         String owner = "guest";
 
-        _logMessage = QueueMessages.QUE_1001(owner, null, true, true, true, false, false);
+        _logMessage = QueueMessages.QUE_CREATED(owner, null, true, true, true, false, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -121,12 +124,12 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001OwnerAutoDeleteDurablePriority()
+    public void testQueueCreatedOwnerAutoDeleteDurablePriority()
     {
         String owner = "guest";
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(owner, priority, true, true, true, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(owner, priority, true, true, true, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Owner:", owner, "AutoDelete",
@@ -136,9 +139,9 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDelete()
+    public void testQueueCreatedAutoDelete()
     {
-        _logMessage = QueueMessages.QUE_1001(null, null, false, true, false, false, false);
+        _logMessage = QueueMessages.QUE_CREATED(null, null, false, true, false, false, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete"};
@@ -146,11 +149,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001Priority()
+    public void testQueueCreatedPriority()
     {
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(null, priority, false, false, false, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(null, priority, false, false, false, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Priority:",
@@ -159,11 +162,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDeletePriority()
+    public void testQueueCreatedAutoDeletePriority()
     {
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(null, priority, false, true, false, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(null, priority, false, true, false, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete",
@@ -173,9 +176,9 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDeleteTransient()
+    public void testQueueCreatedAutoDeleteTransient()
     {
-        _logMessage = QueueMessages.QUE_1001(null, null, false, true, false, true, false);
+        _logMessage = QueueMessages.QUE_CREATED(null, null, false, true, false, true, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete",
@@ -184,11 +187,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDeleteTransientPriority()
+    public void testQueueCreatedAutoDeleteTransientPriority()
     {
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(null, priority, false, true, false, true, true);
+        _logMessage = QueueMessages.QUE_CREATED(null, priority, false, true, false, true, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete",
@@ -198,9 +201,9 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDeleteDurable()
+    public void testQueueCreatedAutoDeleteDurable()
     {
-        _logMessage = QueueMessages.QUE_1001(null, null, false, true, true, false, false);
+        _logMessage = QueueMessages.QUE_CREATED(null, null, false, true, true, false, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete",
@@ -209,11 +212,11 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1001AutoDeleteDurablePriority()
+    public void testQueueCreatedAutoDeleteDurablePriority()
     {
         Integer priority = 3;
 
-        _logMessage = QueueMessages.QUE_1001(null, priority, false, true, true, false, true);
+        _logMessage = QueueMessages.QUE_CREATED(null, priority, false, true, true, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "AutoDelete",
@@ -223,9 +226,9 @@
         validateLogMessage(log, "QUE-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testQueueDeleted()
     {
-        _logMessage = QueueMessages.QUE_1002();
+        _logMessage = QueueMessages.QUE_DELETED();
         List<Object> log = performLog();
 
         String[] expected = {"Deleted"};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,13 +22,16 @@
 
 import java.util.List;
 
+/**
+ * Test SUB Log Messages
+ */
 public class SubscriptionMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001ALL()
+    public void testSubscriptionCreateALL()
     {
         String arguments = "arguments";
 
-        _logMessage = SubscriptionMessages.SUB_1001(arguments, true, true);
+        _logMessage = SubscriptionMessages.SUB_CREATE(arguments, true, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Durable", "Arguments :", arguments};
@@ -36,9 +39,9 @@
         validateLogMessage(log, "SUB-1001", expected);
     }
 
-    public void testMessage1001Durable()
+    public void testSubscriptionCreateDurable()
     {
-        _logMessage = SubscriptionMessages.SUB_1001(null, true, false);
+        _logMessage = SubscriptionMessages.SUB_CREATE(null, true, false);
         List<Object> log = performLog();
 
         String[] expected = {"Create :", "Durable"};
@@ -46,11 +49,11 @@
         validateLogMessage(log, "SUB-1001", expected);
     }
 
-    public void testMessage1001Arguments()
+    public void testSubscriptionCreateArguments()
     {
         String arguments = "arguments";
 
-        _logMessage = SubscriptionMessages.SUB_1001(arguments, false, true);
+        _logMessage = SubscriptionMessages.SUB_CREATE(arguments, false, true);
         List<Object> log = performLog();
 
         String[] expected = {"Create :","Arguments :", arguments};
@@ -59,9 +62,9 @@
     }
 
 
-    public void testMessage1002()
+    public void testSubscriptionClose()
     {
-        _logMessage = SubscriptionMessages.SUB_1002();
+        _logMessage = SubscriptionMessages.SUB_CLOSE();
         List<Object> log = performLog();
 
         String[] expected = {"Close"};
@@ -69,11 +72,11 @@
         validateLogMessage(log, "SUB-1002", expected);
     }
 
-    public void testMessage1003()
+    public void testSubscriptionState()
     {
         String state = "ACTIVE";
 
-        _logMessage = SubscriptionMessages.SUB_1003(state);
+        _logMessage = SubscriptionMessages.SUB_STATE(state);
         List<Object> log = performLog();
 
         String[] expected = {"State :", state};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java Thu Dec  3 16:19:14 2009
@@ -22,12 +22,15 @@
 
 import java.util.List;
 
+/**
+ * Test VHT Log Messages
+ */
 public class VirtualHostMessagesTest extends AbstractTestMessages
 {
-    public void testMessage1001()
+    public void testVirtualhostCreated()
     {
         String name = "test";
-        _logMessage = VirtualHostMessages.VHT_1001(name);
+        _logMessage = VirtualHostMessages.VHT_CREATED(name);
         List<Object> log = performLog();
 
         String[] expected = {"Created :", name};
@@ -35,9 +38,9 @@
         validateLogMessage(log, "VHT-1001", expected);
     }
 
-    public void testMessage1002()
+    public void testSubscriptionClosed()
     {
-        _logMessage = VirtualHostMessages.VHT_1002();
+        _logMessage = VirtualHostMessages.VHT_CLOSED();
         List<Object> log = performLog();
 
         String[] expected = {"Closed"};

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java Thu Dec  3 16:19:14 2009
@@ -42,6 +42,17 @@
 
 import java.util.List;
 
+/**
+ * Abstract Test for LogSubject testing
+ * Includes common validation code and two common tests.
+ *
+ * Each test class sets up the LogSubject and contains details of how to
+ * validate this class then performs a log statement with logging enabled and
+ * logging disabled.
+ *
+ * The resulting log file is then validated. 
+ *
+ */
 public abstract class AbstractTestLogSubject extends TestCase
 {
     protected Configuration _config = new PropertiesConfiguration();

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -27,6 +27,9 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
+/**
+ * Validate BindingLogSubjects are logged as expected
+ */
 public class BindingLogSubjectTest extends AbstractTestLogSubject
 {
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -22,6 +22,9 @@
 
 import org.apache.qpid.server.AMQChannel;
 
+/**
+ * Validate ChannelLogSubjects are logged as expected
+ */
 public class ChannelLogSubjectTest extends ConnectionLogSubjectTest
 {
     private final int _channelID = 1;

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -20,6 +20,9 @@
  */
 package org.apache.qpid.server.logging.subjects;
 
+/**
+ * Validate ConnectionLogSubjects are logged as expected
+ */
 public class ConnectionLogSubjectTest extends AbstractTestLogSubject
 {
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -24,6 +24,10 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
+
+/**
+ * Validate ExchangeLogSubjects are logged as expected
+ */
 public class ExchangeLogSubjectTest extends AbstractTestLogSubject
 {
     Exchange _exchange;

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -23,6 +23,9 @@
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 
+/**
+ * Validate MessageStoreLogSubjects are logged as expected
+ */
 public class MessageStoreLogSubjectTest extends AbstractTestLogSubject
 {
     VirtualHost _testVhost;

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -25,6 +25,9 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
+/**
+ * Validate QueueLogSubjects are logged as expected
+ */
 public class QueueLogSubjectTest extends AbstractTestLogSubject
 {
 
@@ -46,14 +49,13 @@
 
     /**
      * Validate that the logged Subject  message is as expected:
-     * MESSAGE [Blank][vh(/test)/qu(BindingLogSubjectTest)] <Log Message>
+     * MESSAGE [Blank][vh(/test)/qu(QueueLogSubjectTest)] <Log Message>
      *
      * @param message the message whos format needs validation
      */
     @Override
     protected void validateLogStatement(String message)
     {
-        System.err.println(message);
         verifyVirtualHost(message, _testVhost);
         verifyQueue(message, _queue);
     }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java Thu Dec  3 16:19:14 2009
@@ -21,7 +21,6 @@
 package org.apache.qpid.server.logging.subjects;
 
 import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.flow.LimitlessCreditManager;
 import org.apache.qpid.server.queue.AMQQueue;
@@ -32,14 +31,14 @@
 import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
+/**
+ * Validate SubscriptionLogSubjects are logged as expected
+ */
 public class SubscriptionLogSubjectTest extends AbstractTestLogSubject
 {
 
     AMQQueue _queue;
     VirtualHost _testVhost;
-    private boolean _acks;
-    private FieldTable _filters;
-    private boolean _noLocal;
     private int _channelID = 1;
     Subscription _subscription;
 
@@ -50,7 +49,7 @@
         _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                 getVirtualHost("test");
 
-        _queue = new MockAMQQueue("QueueLogSubjectTest");
+        _queue = new MockAMQQueue("SubscriptionLogSubjectTest");
         ((MockAMQQueue) _queue).setVirtualHost(_testVhost);
 
         AMQChannel channel = new AMQChannel(_session, _channelID, _session.getVirtualHost().getMessageStore());
@@ -60,7 +59,7 @@
         SubscriptionFactory factory = new SubscriptionFactoryImpl();
 
         _subscription = factory.createSubscription(_channelID, _session, new AMQShortString("cTag"),
-                                                   _acks, _filters, _noLocal,
+                                                   false, null, false,
                                                    new LimitlessCreditManager());
 
         _subscription.setQueue(_queue, false);
@@ -70,7 +69,7 @@
 
     /**
      * Validate that the logged Subject  message is as expected:
-     * MESSAGE [Blank][sub:0(qu(QueueLogSubjectTest))] <Log Message>
+     * MESSAGE [Blank][sub:0(vh(/test)/qu(SubscriptionLogSubjectTest))] <Log Message>
      *
      * @param message the message whos format needs validation
      */
@@ -84,9 +83,23 @@
         assertNotNull("Unable to locate subscription 'sub:" +
                       _subscription.getSubscriptionID() + "'");
 
+
+
+        // Pull out the qu(..) section from the subscription message
+        // Split it into three parts
+        // MESSAGE [Blank][sub:0(vh(/
+        //                           test)/
+        //                                 qu(SubscriptionLogSubjectTest))]
+        // Take the last bit and drop off the extra )]        
+        String[] parts = message.split("/");
+        assertEquals("Message part count wrong", 3, parts.length);
+        String subscription = parts[2].substring(0, parts[2].indexOf(")") + 1);
+
         // Adding the ')' is a bit ugly but SubscriptionLogSubject is the only
         // Subject that nests () and so the simple parser of checking for the
         // next ')' falls down.
-        verifyQueue(subscriptionSlice + ")", _queue);
+        verifyVirtualHost(subscriptionSlice+ ")", _queue.getVirtualHost());
+
+        verifyQueue(subscription, _queue);
     }
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java Thu Dec  3 16:19:14 2009
@@ -20,6 +20,9 @@
  */
 package org.apache.qpid.server.logging.subjects;
 
+/**
+ * Blank Subject for testing
+ */
 public class TestBlankSubject extends AbstractLogSubject
 {
     public TestBlankSubject()

Modified: qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java (original)
+++ qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java Thu Dec  3 16:19:14 2009
@@ -261,7 +261,7 @@
             if (message.startsWith(messageKey))
             {
                 // Method names can't have a '-' in them so lets make it '_'
-                // e.g. BRK_1001
+                // e.g. BRK-STARTUP -> BRK_STARTUP
                 logEntryData.put("methodName", message.replace('-', '_'));
                 // Store the real name so we can use that in the actual log.
                 logEntryData.put("name", message);

Modified: qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm (original)
+++ qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm Thu Dec  3 16:19:14 2009
@@ -121,7 +121,7 @@
     public static LogMessage ${message.methodName}(#foreach($parameter in ${message.parameters})${parameter.type} ${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end
 #end#if(${message.parameters.size()} > 0 && ${message.options.size()} > 0), #end#foreach($option in ${message.options})boolean ${option.name}#if (${velocityCount} != ${message.options.size()} ), #end#end)
     {
-        String rawMessage = "${message.name} : " + _messages.getString("${message.name}");
+        String rawMessage = _messages.getString("${message.name}");
 ## If we have some options then we need to build the message based
 ## on those values so only provide that logic if we need it.
 #if(${message.options.size()} > 0)

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java Thu Dec  3 16:19:14 2009
@@ -24,7 +24,6 @@
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.logging.AbstractTestLogging;
 import org.apache.qpid.framing.AMQShortString;
@@ -152,7 +151,7 @@
 
         results = _monitor.findMatches("QUE-1004");
 
-        assertEquals("Did not find correct number of QUE_1004 queue underfull messages", 1, results.size());
+        assertEquals("Did not find correct number of QUE_UNDERFULL queue underfull messages", 1, results.size());
 
 
         



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message