You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/08/12 20:00:39 UTC
svn commit: r803632 -
/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
Author: ritchiem
Date: Wed Aug 12 18:00:39 2009
New Revision: 803632
URL: http://svn.apache.org/viewvc?rev=803632&view=rev
Log:
QPID-2002 : Removed commented out code
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java?rev=803632&r1=803631&r2=803632&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java Wed Aug 12 18:00:39 2009
@@ -24,7 +24,6 @@
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 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 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;
}
}
-
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org