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 | b0e8e952fdb43f69d104db6dc9f7fd74432dc05e (patch) | |
| tree | f509a86c1ac38b6d175b970aedf9efe711f122a1 /java | |
| parent | c464e0f38c0f72e9d21ac6ad0f3e17a8b9b1165c (diff) | |
| download | qpid-python-b0e8e952fdb43f69d104db6dc9f7fd74432dc05e.tar.gz | |
QPID-2002 : Removed commented out code
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@803632 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java | 102 |
1 files changed, 38 insertions, 64 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java index 1c0783227b..7bf644508e 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java +++ b/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; } } - } |
