diff options
author | Martin Ritchie <ritchiem@apache.org> | 2009-08-12 18:00:39 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2009-08-12 18:00:39 +0000 |
commit | a2b4788568fcea3d84fbac8009110730fed1a353 (patch) | |
tree | 62c2f67fcfb61f1f7a84b42a8c5d21f25c029042 | |
parent | d325ba62da8393c62d6fad0a05592fcc991c3627 (diff) | |
download | qpid-python-a2b4788568fcea3d84fbac8009110730fed1a353.tar.gz |
QPID-2002 : Removed commented out code
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@803632 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java | 102 |
1 files changed, 38 insertions, 64 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java index 1c0783227b..7bf644508e 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java @@ -24,7 +24,6 @@ package org.apache.qpid.server.logging; import junit.framework.AssertionFailedError; import org.apache.commons.configuration.Configuration; import org.apache.qpid.server.configuration.ServerConfiguration; -import org.apache.qpid.server.logging.subjects.AbstractTestLogSubject; import java.util.List; @@ -60,49 +59,37 @@ public class VirtualHostLoggingTest extends AbstractTestLogging */ public void testVirtualhostCreation() throws Exception { - // This logging startup code only occurs when you run a Java broker, - // that broker must be started via Main so not an InVM broker. -// if (isJavaBroker() && isExternalBroker()) - { -// startBroker(); - // Now we can create the monitor as _outputFile will now be defined -// _monitor = new LogMonitor(_outputFile); + List<String> results = _monitor.findMatches(VHT_PREFIX); + try + { + // Validation + Configuration configuration = ServerConfiguration.flatConfig(_configFile); + List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name"); + //Validate each vhost logs a creation + results = _monitor.findMatches("VHT-1001"); - String configFilePath = _configFile.toString(); + assertEquals("Each vhost did not create a store.", vhosts.size(), results.size()); - List<String> results = _monitor.findMatches(VHT_PREFIX); - try + for (int index = 0; index < results.size(); index++) { - // Validation - Configuration configuration = ServerConfiguration.flatConfig(_configFile); - List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name"); - - //Validate each vhost logs a creation - results = _monitor.findMatches("VHT-1001"); - - assertEquals("Each vhost did not create a store.", vhosts.size(), results.size()); - - for (int index = 0; index < results.size(); index++) - { - String result = getLog(results.get(index)); + String result = getLog(results.get(index)); - // Retrieve the vhostname from the log entry message 'Created : <vhostname>' - String vhostName = getMessageString(fromMessage(result)).split(" ")[2] ; + // Retrieve the vhostname from the log entry message 'Created : <vhostname>' + String vhostName = getMessageString(fromMessage(result)).split(" ")[2]; - assertTrue("Virualhost named in log not found in config file:"+ vhostName+":"+vhosts, vhosts.contains(vhostName)); - } + assertTrue("Virualhost named in log not found in config file:" + vhostName + ":" + vhosts, vhosts.contains(vhostName)); } - catch (AssertionFailedError afe) + } + catch (AssertionFailedError afe) + { + System.err.println("Log Dump:"); + for (String log : results) { - System.err.println("Log Dump:"); - for (String log : results) - { - System.err.println(log); - } - throw afe; + System.err.println(log); } + throw afe; } } @@ -123,43 +110,30 @@ public class VirtualHostLoggingTest extends AbstractTestLogging */ public void testVirtualhostClosure() throws Exception { - // This logging startup code only occurs when you run a Java broker, - // that broker must be started via Main so not an InVM broker. -// if (isJavaBroker() && isExternalBroker()) - { -// startBroker(); - - // Now we can create the monitor as _outputFile will now be defined -// _monitor = new LogMonitor(_outputFile); + stopBroker(); - stopBroker(); - - String configFilePath = _configFile.toString(); - - List<String> results = _monitor.findMatches(VHT_PREFIX); - try - { - // Validation + List<String> results = _monitor.findMatches(VHT_PREFIX); + try + { + // Validation - Configuration configuration = ServerConfiguration.flatConfig(_configFile); - List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name"); + Configuration configuration = ServerConfiguration.flatConfig(_configFile); + List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name"); - //Validate each vhost logs a creation - results = _monitor.findMatches("VHT-1002"); + //Validate each vhost logs a creation + results = _monitor.findMatches("VHT-1002"); - assertEquals("Each vhost did not create a store.", vhosts.size(), results.size()); - } - catch (AssertionFailedError afe) + assertEquals("Each vhost did not create a store.", vhosts.size(), results.size()); + } + catch (AssertionFailedError afe) + { + System.err.println("Log Dump:"); + for (String log : results) { - System.err.println("Log Dump:"); - for (String log : results) - { - System.err.println(log); - } - throw afe; + System.err.println(log); } + throw afe; } } - } |