svn commit: r800354 - in /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util: LogMonitor.java LogMonitorTest.java
Author: ritchiem Date: Mon Aug 3 13:17:28 2009 New Revision: 800354 URL: http://svn.apache.org/viewvc?rev=800354&view=rev Log: QPID-2001 : Added new LogMonitor (with Test) to ensure that messages Logged occur as expected. Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitorTest.java Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java?rev=800354&view=auto == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java (added) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/util/LogMonitor.java Mon Aug 3 13:17:28 2009 @@ -0,0 +1,176 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.util; + +import org.apache.log4j.FileAppender; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.util.List; + +/** + * Utility to simplify the monitoring of Log4j file output + * + * Monitoring of a given log file can be done alternatively the Monitor will + * add a new log4j FileAppender to the root Logger to gather all the available + * logging for monitoring + */ +public class LogMonitor +{ +// The file that the log statements will be written to. +private File _logfile; + +/** + * Create a new LogMonitor that creates a new Log4j Appender and monitors + * all log4j output via the current configuration. + * + * @throws IOException if there is a problem creating the temporary file. + */ +public LogMonitor() throws IOException +{ +this(null); +} + +/** + * Create a new LogMonitor on the specified file if the file does not exist + * or the value is null then a new Log4j appender will be added and + * monitoring set up on that appender. + * + * NOTE: for the appender to receive any value the RootLogger will need to + * have the level correctly configured.ng + * + * @param file the file to monitor + * + * @throws IOException if there is a problem creating a temporary file + */ +public LogMonitor(File file) throws IOException +{ +if (file != null && file.exists()) +{ +_logfile = file; +} +else +{ +// This is mostly for running the test outside of the ant setup +_logfile = File.createTempFile("LogMonitor", ".log"); +FileAppender appender = new FileAppender(new SimpleLayout(), + _logfile.getAbsolutePath()); +appender.setFile(_logfile.getAbsolutePath()); +appender.setImmediateFlush(true); +Logger.getRootLogger().addAppender(appender); +} +} + +/** + * Checks the log for instances of the search string. + * + * The pattern parameter can take any valid argument used in String.contains() + * + * {...@see String.contains(CharSequences)} + * + * @param pattern the search string + * + * @return a list of matching lines from the log + * + * @throws IOException if there is a problem with the file + */ +public List findMatches(String pattern) throws IOException +{ +return FileUtils.searchFile(_logfile, pattern); +} + +/** + * Checks the log file for a given message to appear. + * + * @param message the message to wait for in the log + * @param waitthe time in ms to wait for the message to occur + * + * @return true if the message was found + * + * @throws java.io.FileNotFoundException if the Log file can nolonger be found + * @throws IOException thrown when reading the log file +
svn commit: r800356 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/configuration/ systests/src/main/java/org/apache/qpid/server/ systests/src/main/java/org/apache/qpid/server/
Author: ritchiem Date: Mon Aug 3 13:18:25 2009 New Revision: 800356 URL: http://svn.apache.org/viewvc?rev=800356&view=rev Log: QPID-2011 : Updated AlertingTest to use new LogMonitoring class and corrected failures in test. Failures corrected by: - Ensuring message count is as expected after first publication - Validating that the max count alert level is correctly changed (when InVM) - Validate that the log file does not contain alerts after restart - Validate that alerting occurs after extra messages have been published - Modified QPID_WORK (using QTC.setSystemProperty so it is only set for that test run) to ensure each test has a clean store. Additions to QpidTestCase: - Ability to enable persistence on a given virtualhost. Currently it tries to set the JBoss BerkelyDB store failing back to Qpid's DerbyDB store. - Ability to set properties in the configuration file, this involves re-writting the config files so that both inVM and external java brokers will correctly function with the desired configuration. Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Removed: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java?rev=800356&r1=800355&r2=800356&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java Mon Aug 3 13:18:25 2009 @@ -256,7 +256,7 @@ // Our configuration class needs to make the interpolate method // public so it can be called below from the config method. -private static class MyConfiguration extends CompositeConfiguration +public static class MyConfiguration extends CompositeConfiguration { public String interpolate(String obj) { @@ -264,7 +264,7 @@ } } -private final static Configuration flatConfig(File file) throws ConfigurationException +public final static Configuration flatConfig(File file) throws ConfigurationException { // We have to override the interpolate methods so that // interpolation takes place accross the entirety of the Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=800356&view=auto == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (added) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Mon Aug 3 13:18:25 2009 @@ -0,0 +1,207 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ +package org.apache.qpid.server.logging; + +import org.apache.qpid.client.AMQDestination; +import org.apache.qpid.client.AMQSession; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.server.registry.ApplicationRegistry; +import org.apache.qpid.server.configuration.ServerConfiguration; +import org.apache.qpid.test.utils.QpidTestCase; +import org.apache.qpid.util.FileUtils; +import org.apache.qpid.util.LogMonitor; + +import javax.jms.Connection; +import javax.jms.Queue; +import javax.jms.Session; +import java.io.File; + +public class AlertingTest extends QpidTestCase +{ +private String VIRTUALHOST = "test"; +private Session _session; +private Connection _connection; +priva
svn commit: r800357 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java test/java/org/apache/qpid/server/logging/subjects/MessageStore
Author: ritchiem Date: Mon Aug 3 13:19:13 2009 New Revision: 800357 URL: http://svn.apache.org/viewvc?rev=800357&view=rev Log: QPID-2001 : Added missing MessageStoreLogSubject and corresponding test Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java?rev=800357&view=auto == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java (added) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java Mon Aug 3 13:19:13 2009 @@ -0,0 +1,44 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.server.logging.subjects; + +import org.apache.qpid.server.virtualhost.VirtualHost; + +public class MessagesStoreLogSubject extends AbstractLogSubject +{ + +/** + * LOG FORMAT for the MessagesStoreLogSubject, + * Uses a MessageFormat call to insert the requried values according to + * these indicies: + * + * 0 - Virtualhost Name + * 1 - Message Store Type + */ +protected static String BINDING_FORMAT = "vh(/{0})/ms({1})"; + +/** Create an ExchangeLogSubject that Logs in the following format. */ +public MessagesStoreLogSubject(VirtualHost vhost) +{ +setLogStringWithFormat(BINDING_FORMAT, vhost.getName(), + vhost.getMessageStore().getClass().getSimpleName()); +} +} Added: 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=800357&view=auto == --- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java (added) +++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Mon Aug 3 13:19:13 2009 @@ -0,0 +1,59 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.server.logging.subjects; + +import org.apache.qpid.server.virtualhost.VirtualHost; +import org.apache.qpid.server.registry.ApplicationRegistry; + +public class MessageStoreLogSubjectTest extends AbstractTestLogSubject +{ +VirtualHost _testVhost; + +public void setUp() throws Exception +{ +super.setUp(); + +_testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry(). +getVirtualHost("test"); + +_subject = new MessagesStoreLogSubject(_testVhost); +} + +/** + * Validate that the logged Subject message is as expected: + * MESSAGE [Blank][vh(/test)/ms(MemoryMessageStore)] + * @param message the message whos format needs validation + */ +@Override +protected void
svn commit: r800358 - /qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
Author: ritchiem Date: Mon Aug 3 13:19:45 2009 New Revision: 800358 URL: http://svn.apache.org/viewvc?rev=800358&view=rev Log: QPID-2001 : Update based on feedback from Marnie to be mindful of the impact of message creation. Messages that do not need a message formatter now nolonger use the message formater. Modified: qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm 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=800358&r1=800357&r2=800358&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 Mon Aug 3 13:19:45 2009 @@ -106,14 +106,26 @@ 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) { +## +## If we don't have any parameters then we don't need the overhead of using the +## message formatter so we can just set our return message to the retreived +## fixed string. +## So we don't need to update the _formatter with the new pattern. +## +## Here we setup rawMessage to be the formatted message ready for direct return +## with the message.name or further processing to remove options. +## +#if(${message.parameters.size()} > 0) final Object[] messageArguments = {#foreach($parameter in ${message.parameters})${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end#end}; _formatter.applyPattern(_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) String rawMessage = _formatter.format(messageArguments); +#else +String rawMessage = _messages.getString("${message.name}"); +#end +## 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) StringBuffer msg =new StringBuffer("${message.name} : "); // Split the formatted message up on the option values so we can @@ -124,8 +136,8 @@ int end; if (parts.length > 1) { -## For Each Optional value check if it has been enabled and then -## append it to the log. +## For Each Optional value check if it has been enabled and then +## append it to the log. #foreach($option in ${message.options}) // Add Option : ${option.value} @@ -142,8 +154,8 @@ final String message = msg.toString(); #else -## If we have no options then we can just format and set the log -final String message = "${message.name} : " + _formatter.format(messageArguments); +## If we have no options then we can just format and set the log +final String message = "${message.name} : " + rawMessage; #end return new LogMessage() - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800359 - in /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging: AbstractTestLogging.java ConnectionLoggingTest.java
Author: ritchiem Date: Mon Aug 3 13:20:20 2009 New Revision: 800359 URL: http://svn.apache.org/viewvc?rev=800359&view=rev Log: QPID-2002 : Addition of ConnectionLoggingTest Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=800359&view=auto == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java (added) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Mon Aug 3 13:20:20 2009 @@ -0,0 +1,61 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.server.logging; + +import org.apache.qpid.test.utils.QpidTestCase; +import org.apache.qpid.util.LogMonitor; +import org.apache.qpid.server.virtualhost.VirtualHost; +import org.apache.qpid.server.logging.subjects.AbstractTestLogSubject; + +import java.io.IOException; + +public class AbstractTestLogging extends QpidTestCase +{ +protected LogMonitor _monitor; + + +@Override +public void setUp() throws Exception +{ +super.setUp(); +_monitor = new LogMonitor(_outputFile); +} + +/** + * assert that the requested log message has not occured + * @param log + * @throws IOException + */ +public void assertLoggingNotYetOccured(String log) throws IOException +{ +// Ensure the alert has not occured yet +assertEquals("Message has already occured:"+log, 0, + _monitor.findMatches(log).size()); +} + +protected int extractConnectionID(String log) +{ +int conIDStart = log.indexOf("con:") + 4; +int conIDEnd = log.indexOf("(", conIDStart); +return Integer.parseInt(log.substring(conIDStart, conIDEnd)); +} + +} Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java?rev=800359&view=auto == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java (added) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Mon Aug 3 13:20:20 2009 @@ -0,0 +1,164 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ +package org.apache.qpid.server.logging; + +import javax.jms.Connection; +import java.io.File; +import java.util.List; + +public class ConnectionLoggingTest extends AbstractTestLogging +{ +private static final String CONNECTION_PREFIX = "CON-"; + +public void setUp() throws Exception +{ +// set QPID_WORK to be [QPID_WORK|io.tmpdir]/ +setSystemProperty("QPID_WORK", + System.getProperty("QPID_WORK", + System.getProperty("java.io.tmpdir")) +
svn commit: r800360 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java test/java/org/apache/qpid/server/logging/subjects/MessageStore
Author: ritchiem Date: Mon Aug 3 13:21:43 2009 New Revision: 800360 URL: http://svn.apache.org/viewvc?rev=800360&view=rev Log: QPID-2001 : Corrected MSLSubject, extracting the Store from the vhost fails to retrieve the right value during startup. So better to explicitly specify the vhost and message store. Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java?rev=800360&r1=800359&r2=800360&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/MessagesStoreLogSubject.java Mon Aug 3 13:21:43 2009 @@ -21,6 +21,7 @@ package org.apache.qpid.server.logging.subjects; import org.apache.qpid.server.virtualhost.VirtualHost; +import org.apache.qpid.server.store.MessageStore; public class MessagesStoreLogSubject extends AbstractLogSubject { @@ -36,9 +37,9 @@ protected static String BINDING_FORMAT = "vh(/{0})/ms({1})"; /** Create an ExchangeLogSubject that Logs in the following format. */ -public MessagesStoreLogSubject(VirtualHost vhost) +public MessagesStoreLogSubject(VirtualHost vhost, MessageStore store) { setLogStringWithFormat(BINDING_FORMAT, vhost.getName(), - vhost.getMessageStore().getClass().getSimpleName()); + store.getClass().getSimpleName()); } } 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=800360&r1=800359&r2=800360&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 Mon Aug 3 13:21:43 2009 @@ -34,7 +34,7 @@ _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry(). getVirtualHost("test"); -_subject = new MessagesStoreLogSubject(_testVhost); +_subject = new MessagesStoreLogSubject(_testVhost, _testVhost.getMessageStore()); } /** - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800362 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging: RootMessageLogger.java RootMessageLoggerImpl.java actors/AbstractActor.java
Author: ritchiem Date: Mon Aug 3 13:23:18 2009 New Revision: 800362 URL: http://svn.apache.org/viewvc?rev=800362&view=rev Log: QPID-2002 : Enable LogActors to log solely about themselves. Situations such as startup would necesitate this, or when a new connection is being created. The addition of a ConnetionSubject would be unnecessary. Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLoggerImpl.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java?rev=800362&r1=800361&r2=800362&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLogger.java Mon Aug 3 13:23:18 2009 @@ -37,6 +37,14 @@ */ boolean isMessageEnabled(LogActor actor, LogSubject subject); +/** + * Determine if the LogActor should be generating log messages. + * + * @param actor The actor requesting the logging + * + * @return boolean true if the message should be logged. + */ +boolean isMessageEnabled(LogActor actor); /** * Log the raw message to the configured logger. Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLoggerImpl.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLoggerImpl.java?rev=800362&r1=800361&r2=800362&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLoggerImpl.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/RootMessageLoggerImpl.java Mon Aug 3 13:23:18 2009 @@ -40,6 +40,11 @@ return _enabled; } +public boolean isMessageEnabled(LogActor actor) +{ +return _enabled; +} + public void rawMessage(String message) { _rawLogger.rawMessage(MESSAGE + message); Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java?rev=800362&r1=800361&r2=800362&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Mon Aug 3 13:23:18 2009 @@ -42,4 +42,13 @@ _rootLogger.rawMessage(_logString + String.valueOf(subject) + message); } } + +public void message(LogMessage message) +{ +if (_rootLogger.isMessageEnabled(this)) +{ +_rootLogger.rawMessage(_logString + message); +} +} + } - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800363 - in /qpid/trunk/qpid: gentools/templ.java/model/ java/broker/src/main/java/org/apache/qpid/server/logging/messages/ java/broker/src/main/java/org/apache/qpid/server/protocol/ java
Author: ritchiem Date: Mon Aug 3 13:24:29 2009 New Revision: 800363 URL: http://svn.apache.org/viewvc?rev=800363&view=rev Log: QPID-2002 : Change CON-1001 to make client ID optional so that the various stages of Open can be correctly logged. Client ID is not initially provided so we would be unable to log the protocol negotiation without removing this Modified ProtocolVersion Template to include a toString value to make it easier to log. There are two templates to update one in gentools/templ.java and one in common/templates Exposed verification methods to allow systests to reuse the code Modified: qpid/trunk/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java qpid/trunk/qpid/java/common/templates/model/ProtocolVersionListClass.vm Modified: qpid/trunk/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm?rev=800363&r1=800362&r2=800363&view=diff == --- qpid/trunk/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm (original) +++ qpid/trunk/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm Mon Aug 3 13:24:29 2009 @@ -39,12 +39,14 @@ { private final byte _majorVersion; private final byte _minorVersion; +private final String _stringFormat; public ProtocolVersion(byte majorVersion, byte minorVersion) { _majorVersion = majorVersion; _minorVersion = minorVersion; +_stringFormat = _majorVersion+"-"+_minorVersion; } public byte getMajorVersion() @@ -57,6 +59,10 @@ return _minorVersion; } +public String toString() +{ +return _stringFormat; +} public int compareTo(Object o) { Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties?rev=800363&r1=800362&r2=800363&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties Mon Aug 3 13:24:29 2009 @@ -235,7 +235,7 @@ #Connection # 0 - Client id # 1 - Protocol Version -CON-1001 = Open : Client ID {0}[ : Protocol Version : {1}] +CON-1001 = Open[ : Client ID : {0}][ : Protocol Version : {1}] CON-1002 = Close #Channel Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java?rev=800363&r1=800362&r2=800363&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java Mon Aug 3 13:24:29 2009 @@ -54,6 +54,9 @@ import org.apache.qpid.server.handler.ServerMethodDispatcherImpl; import org.apache.qpid.server.logging.actors.AMQPConnectionActor; import org.apache.qpid.server.logging.actors.CurrentActor; +import org.apache.qpid.server.logging.subjects.ConnectionLogSubject; +import org.apache.qpid.server.logging.LogSubject; +import org.apache.qpid.server.logging.messages.ConnectionMessages; import org.apache.qpid.server.management.Managable; import org.apache.qpid.server.management.ManagedObject; import org.apache.qpid.server.output.ProtocolOutputConverter; @@ -139,6 +142,7 @@ private final long _sessionID = idGenerator.getAndIncrement(); private AMQPConnectionActor _actor; +private LogSubject _logSubject; public ManagedObject getManagedObject() { @@ -156,6 +160,8 @@ _actor = new AMQPConnectionActor(this, virtualHostRegistry.getApplicationRegistry().getRootMessageLogger()); +_actor.message(ConnectionMessages.CON_1001(null, null, false, false)); + try { IoServiceConfig config = session.getServiceConfig(); @@ -171,6 +177,8 @@ } } +// This is only used by two tests that do pro
svn commit: r800364 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
Author: ritchiem Date: Mon Aug 3 13:25:02 2009 New Revision: 800364 URL: http://svn.apache.org/viewvc?rev=800364&view=rev Log: Updated AlertingTest to use new methods in Abstract super class Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=800364&r1=800363&r2=800364&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Mon Aug 3 13:25:02 2009 @@ -34,7 +34,7 @@ import javax.jms.Session; import java.io.File; -public class AlertingTest extends QpidTestCase +public class AlertingTest extends AbstractTestLogging { private String VIRTUALHOST = "test"; private Session _session; @@ -42,7 +42,6 @@ private Queue _destination; private int _numMessages; -private LogMonitor _monitor; private static final int ALERT_LOG_WAIT_PERIOD = 5000; private static final String MESSAGE_COUNT_ALERT = "MESSAGE_COUNT_ALERT"; @@ -58,9 +57,6 @@ // Update the configuration to make our virtualhost Persistent. makeVirtualHostPersistent(VIRTUALHOST); -//Create a log file monitor -_monitor = new LogMonitor(_outputFile); - _numMessages = 50; // Then we do the normal setup stuff like starting the broker, getting a connection etc. @@ -193,8 +189,7 @@ assertEquals("Broker has invalid message count for test", 2, messageCount); // Ensure the alert has not occured yet -assertEquals("Alert has already occured", 0, - _monitor.findMatches(MESSAGE_COUNT_ALERT).size()); +assertLoggingNotYetOccured(MESSAGE_COUNT_ALERT); // Trigger the new value sendMessage(_session, _destination, 3); - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800365 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/protocol/ test/java/org/apache/qpid/server/protocol/
Author: ritchiem Date: Mon Aug 3 13:25:40 2009 New Revision: 800365 URL: http://svn.apache.org/viewvc?rev=800365&view=rev Log: Removed stale constructor, updated two test cases to use other constructor, there is no impact as the tests were passing in null for the removed parameter Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java?rev=800365&r1=800364&r2=800365&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java Mon Aug 3 13:25:40 2009 @@ -177,20 +177,6 @@ } } -// This is only used by two tests that do provide null values for stateManager -// so we can safely remove this and refactor. -public AMQMinaProtocolSession(IoSession session, VirtualHostRegistry virtualHostRegistry, AMQCodecFactory codecFactory, - AMQStateManager stateManager) throws AMQException -{ -_stateManager = stateManager; -_minaProtocolSession = session; -session.setAttachment(this); - -_codecFactory = codecFactory; - -_actor = new AMQPConnectionActor(this, virtualHostRegistry.getApplicationRegistry().getRootMessageLogger()); -} - private AMQProtocolSessionMBean createMBean() throws AMQException { try Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?rev=800365&r1=800364&r2=800365&view=diff == --- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original) +++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Mon Aug 3 13:25:40 2009 @@ -111,8 +111,7 @@ IApplicationRegistry appRegistry = ApplicationRegistry.getInstance(); _protocolSession = -new AMQMinaProtocolSession(new TestIoSession(), appRegistry.getVirtualHostRegistry(), new AMQCodecFactory(true), - null); +new AMQMinaProtocolSession(new TestIoSession(), appRegistry.getVirtualHostRegistry(), new AMQCodecFactory(true)); // Need to authenticate session for it to work, (well for logging to work) _protocolSession.setAuthorizedID(new Principal() { Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java?rev=800365&r1=800364&r2=800365&view=diff == --- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java (original) +++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java Mon Aug 3 13:25:40 2009 @@ -41,7 +41,7 @@ public void testChannels() throws Exception { _session = new AMQMinaProtocolSession(new TestIoSession(), _appRegistry - .getVirtualHostRegistry(), new AMQCodecFactory(true), null); + .getVirtualHostRegistry(), new AMQCodecFactory(true)); // Need to authenticate session for it to work, (well for logging to work) _session.setAuthorizedID(new Principal() - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800366 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging: LogActor.java actors/AbstractActor.java
Author: ritchiem Date: Mon Aug 3 13:26:33 2009 New Revision: 800366 URL: http://svn.apache.org/viewvc?rev=800366&view=rev Log: QPID-2002 : Added message(LogMessage message) to the LogActor Interface and the ability to retrieve the RootMessageLogger Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java?rev=800366&r1=800365&r2=800366&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java Mon Aug 3 13:26:33 2009 @@ -40,4 +40,21 @@ * @param message The message to log */ public void message(LogSubject subject, LogMessage message); -} \ No newline at end of file + +/** + * Logs the specified LogMessage against this actor + * + * Currently logging has a global setting however this will later be revised and + * as such the LogActor will need to take into consideration any new configuration + * as a means of enabling the logging of LogActors and LogSubjects. + * + * @param message The message to log + */ +public void message(LogMessage message); + +/** + * + * @return the RootMessageLogger that is currently in use by this LogActor. + */ +RootMessageLogger getRootMessageLogger(); +} \ No newline at end of file Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java?rev=800366&r1=800365&r2=800366&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Mon Aug 3 13:26:33 2009 @@ -51,4 +51,9 @@ } } +public RootMessageLogger getRootMessageLogger() +{ +return _rootLogger; +} + } - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800368 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/logging/messages/ broker/src/main/java/org/apache/qpid/server/p
Author: ritchiem Date: Mon Aug 3 13:27:39 2009 New Revision: 800368 URL: http://svn.apache.org/viewvc?rev=800368&view=rev Log: QPID-2002: Added testing of Channel Logging Added: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockProtocolSession.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=800368&r1=800367&r2=800368&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Mon Aug 3 13:27:39 2009 @@ -57,6 +57,12 @@ import org.apache.qpid.server.txn.LocalTransactionalContext; import org.apache.qpid.server.txn.NonTransactionalContext; import org.apache.qpid.server.txn.TransactionalContext; +import org.apache.qpid.server.logging.LogActor; +import org.apache.qpid.server.logging.LogSubject; +import org.apache.qpid.server.logging.messages.ChannelMessages; +import org.apache.qpid.server.logging.subjects.ChannelLogSubject; +import org.apache.qpid.server.logging.actors.AMQPChannelActor; +import org.apache.qpid.server.logging.actors.CurrentActor; public class AMQChannel { @@ -111,13 +117,22 @@ // Why do we need this reference ? - ritchiem private final AMQProtocolSession _session; -private boolean _closing; +private boolean _closing; + +private LogActor _actor; +private LogSubject _logSubject; public AMQChannel(AMQProtocolSession session, int channelId, MessageStore messageStore) throws AMQException { _session = session; _channelId = channelId; + +_actor = new AMQPChannelActor(this, session.getLogActor().getRootMessageLogger()); +_logSubject = new ChannelLogSubject(this); + +_actor.message(ChannelMessages.CHN_1001()); + _storeContext = new StoreContext("Session: " + session.getClientIdentifier() + "; channel: " + channelId); @@ -371,6 +386,8 @@ private void setClosing(boolean closing) { _closing = closing; + +CurrentActor.get().message(_logSubject, ChannelMessages.CHN_1003()); } private void unsubscribeAllConsumers() throws AMQException @@ -774,6 +791,8 @@ boolean wasSuspended = _suspended.getAndSet(suspended); if (wasSuspended != suspended) { +_actor.message(_logSubject, ChannelMessages.CHN_1002(suspended ? "Stopped" : "Started")); + if (wasSuspended) { // may need to deliver queued messages @@ -865,6 +884,8 @@ public void setCredit(final long prefetchSize, final int prefetchCount) { +//fixme +//_actor.message(ChannelMessages.CHN_100X(prefetchSize, prefetchCount); _creditManager.setCreditLimits(prefetchSize, prefetchCount); } @@ -906,4 +927,9 @@ { return _recordDeliveryMethod; } + +public LogActor getLogActor() +{ +return _actor; +} } Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties?rev=800368&r1=800367&r2=800368&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties Mon Aug 3 13:27:39 2009 @@ -239,8 +239,8 @@ CON-1002 = Close #Channel -# 0 - count -CHN-1001 = Create : Prefetch {0, number} +CHN-1001 = Create +# : Prefetch Size {0,number} : Count {1,number} # 0 - flow CHN-1002 = Flow {0} CHN-1003 = Close Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java URL: http://svn.apache.org/viewvc
svn commit: r800369 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
Author: ritchiem Date: Mon Aug 3 13:28:36 2009 New Revision: 800369 URL: http://svn.apache.org/viewvc?rev=800369&view=rev Log: QPID-2002 : Added QUEUE constant = queue to QTC Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=800369&r1=800368&r2=800369&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Mon Aug 3 13:28:36 2009 @@ -180,6 +180,7 @@ // the connections created for a given test protected List _connections = new ArrayList(); +public static final String QUEUE = "queue"; public QpidTestCase(String name) { - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800370 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
Author: ritchiem Date: Mon Aug 3 13:29:19 2009 New Revision: 800370 URL: http://svn.apache.org/viewvc?rev=800370&view=rev Log: QPID-2002 : Updated ConnectionLoggingTest to use new validation methods in Abstract parent Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java?rev=800370&r1=800369&r2=800370&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Mon Aug 3 13:29:19 2009 @@ -77,8 +77,7 @@ String log = results.get(0); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open //1 & 2 -assertTrue("CON-1001 is not the first CON message", - log.contains("CON-1001")); +validateMessageID("CON-1001",log); //We get the size so that we can validate the last three CON- messages int resultsSize = results.size(); @@ -88,28 +87,28 @@ // 3 - Assert the options are correct log = results.get(resultsSize - 1); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 -assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001")); -assertTrue("Client ID option is not present", log.contains("Client ID :")); -assertTrue("Client ID value is not present", log.contains(connection.getClientID())); +validateMessageID("CON-1001",log); +assertTrue("Client ID option is not present", fromMessage(log).contains("Client ID :")); +assertTrue("Client ID value is not present", fromMessage(log).contains(connection.getClientID())); -assertTrue("Protocol Version option is not present", log.contains("Protocol Version :")); +assertTrue("Protocol Version option is not present", fromMessage(log).contains("Protocol Version :")); //fixme there is no way currently to find out the negotiated protocol version // The delegate is the versioned class ((AMQConnection)connection)._delegate log = results.get(resultsSize - 2); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Protocol Version : 0-9 -assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001")); -assertTrue("Protocol Version option is not present", log.contains("Protocol Version :")); +validateMessageID("CON-1001",log); +assertTrue("Protocol Version option is not present", fromMessage(log).contains("Protocol Version :")); //fixme agani we should check the version // Check that client ID is not present in log -assertTrue("Client ID option is present", !log.contains("Client ID :")); +assertTrue("Client ID option is present", !fromMessage(log).contains("Client ID :")); log = results.get(resultsSize - 3); -assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001")); +validateMessageID("CON-1001",log); // Check that PV is not present in log -assertTrue("Protocol Version option is present", !log.contains("Protocol Version :")); +assertTrue("Protocol Version option is present", !fromMessage(log).contains("Protocol Version :")); // Check that client ID is not present in log -assertTrue("Client ID option is present", !log.contains("Client ID :")); +assertTrue("Client ID option is present", !fromMessage(log).contains("Client ID :")); connection.close(); } @@ -149,7 +148,7 @@ // Validate Close message occurs String log = results.get(resultsSize - 1); -assertTrue("Incorrect CON message, not CON-1002", log.contains("CON-1002")); +validateMessageID("CON-1002",log); assertTrue("Message does not end with close:" + log, log.endsWith("Close")); // Extract connection ID to validate there is a CON-1001 messasge for it @@ -158,7 +157,7 @@ //Previous log message should be the open log = results.get(resultsSize - 2); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 -assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001")); -assertEquals("Connection IDs do not match", connectionID, extractConnectionID(log)); +validateMessageID("CON-1001",log); +assertEquals("Connection IDs do not match", connectionID, extractConnectionID(fromActor(log))); } } ---
svn commit: r800371 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
Author: ritchiem Date: Mon Aug 3 13:30:01 2009 New Revision: 800371 URL: http://svn.apache.org/viewvc?rev=800371&view=rev Log: Removed unused method that only throws an Exception Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=800371&r1=800370&r2=800371&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Mon Aug 3 13:30:01 2009 @@ -88,7 +88,7 @@ private final Timer _houseKeepingTimer; private VirtualHostConfiguration _configuration; - + public void setAccessableName(String name) { _logger.warn("Setting Accessable Name for VirualHost is not allowed. (" @@ -386,11 +386,6 @@ return _exchangeFactory; } -public ApplicationRegistry getApplicationRegistry() -{ -throw new UnsupportedOperationException(); -} - public MessageStore getMessageStore() { return _messageStore; - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800372 - in /qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server: exchange/ logging/actors/ logging/subjects/ protocol/ queue/ security/access/ store/ util/
Author: ritchiem Date: Mon Aug 3 13:31:23 2009 New Revision: 800372 URL: http://svn.apache.org/viewvc?rev=800372&view=rev Log: QPID-1230 : Removed MockProtocolSession, Updated all references to use InternalTestProtocolSession IPTS was also updated to take a VirtualHost parameter that is then used to configured the AMQProtocolSession Removed: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockProtocolSession.java Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java?rev=800372&r1=800371&r2=800372&view=diff == --- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java (original) +++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java Mon Aug 3 13:31:23 2009 @@ -33,6 +33,7 @@ import org.apache.qpid.server.txn.NonTransactionalContext; import org.apache.qpid.server.txn.TransactionalContext; import org.apache.qpid.server.RequiredDeliveryException; +import org.apache.qpid.server.virtualhost.VirtualHost; import org.apache.qpid.server.subscription.Subscription; import org.apache.qpid.server.protocol.AMQProtocolSession; import org.apache.log4j.Logger; @@ -463,14 +464,14 @@ new LinkedList() ); -Message(String id, String... headers) throws AMQException +Message(AMQProtocolSession protocolSession, String id, String... headers) throws AMQException { -this(id, getHeaders(headers)); +this(protocolSession, id, getHeaders(headers)); } -Message(String id, FieldTable headers) throws AMQException +Message(AMQProtocolSession protocolSession, String id, FieldTable headers) throws AMQException { -this(_messageStore.getNewMessageId(),getPublishRequest(id), getContentHeader(headers), null); +this(protocolSession, _messageStore.getNewMessageId(),getPublishRequest(id), getContentHeader(headers), null); } public IncomingMessage getIncomingMessage() @@ -478,7 +479,7 @@ return _incoming; } -private Message(long messageId, +private Message(AMQProtocolSession protocolsession, long messageId, MessagePublishInfo publish, ContentHeaderBody header, List bodies) throws AMQException @@ -487,7 +488,7 @@ -_incoming = new TestIncomingMessage(getMessageId(),publish,_txnContext,new MockProtocolSession(_messageStore)); +_incoming = new TestIncomingMessage(getMessageId(),publish, _txnContext, protocolsession); _incoming.setContentHeaderBody(header); Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid
svn commit: r800374 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/logging/actors/ main/java/org/apache/qpid/server/logging/rawloggers/ main/java/org/apache/qpid/server/protoc
Author: ritchiem Date: Mon Aug 3 13:33:05 2009 New Revision: 800374 URL: http://svn.apache.org/viewvc?rev=800374&view=rev Log: QPID-2002 : Updates to integrate Logging with test ant test runs. MaxChannelsTest/AMQProtoSessionMBean - Ensured CurrentActor is correctly set and removed. Log4jMessageLogger - Correctly Set log level to ensure messages are logged. AbstractActor - Null validation of RootLogger Log4jMessasgeLoggerTest - Updated and removed erroneous tests that were based on inherited log levels. AbstractTestLogSubject - Updated to correctly parse IP given by the use of InternalTestProtocolSession TestApplicationRegistry - Created RootMessageLogger Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLogger.java qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLoggerTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java?rev=800374&r1=800373&r2=800374&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Mon Aug 3 13:33:05 2009 @@ -32,6 +32,10 @@ public AbstractActor(RootMessageLogger rootLogger) { +if(rootLogger == null) +{ +throw new NullPointerException("RootMessageLogger cannot be null"); +} _rootLogger = rootLogger; } Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLogger.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLogger.java?rev=800374&r1=800373&r2=800374&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLogger.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/rawloggers/Log4jMessageLogger.java Mon Aug 3 13:33:05 2009 @@ -41,6 +41,7 @@ _level = Level.toLevel(level); _rawMessageLogger = Logger.getLogger(logger); +_rawMessageLogger.setLevel(_level); } public void rawMessage(String message) Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java?rev=800374&r1=800373&r2=800374&view=diff == --- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java (original) +++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java Mon Aug 3 13:33:05 2009 @@ -65,6 +65,8 @@ import org.apache.qpid.management.common.mbeans.annotations.MBeanDescription; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.server.AMQChannel; +import org.apache.qpid.server.logging.actors.CurrentActor; +import org.apache.qpid.server.logging.LogActor; import org.apache.qpid.server.management.AMQManagedObject; import org.apache.qpid.server.management.ManagedObject; @@ -185,6 +187,7 @@ */ public void commitTransactions(int channelId) throws JMException { +CurrentActor.set(getLogActor()); try { AMQChannel channel = _session.getChannel(channelId); @@ -199,6 +202,10 @@ { throw new MBeanException(ex, ex.toString()); } +finally +{ +CurrentActor.remove(); +} } /** @@ -209,6 +216,7 @@ */ public void rollbackTransactions(int channelId) throws JMException { +CurrentActor.set(getLogActor()); try { AMQChannel channel = _session.getChannel(channelId); @@ -223,6 +231,10 @@ { throw new MBeanException(ex, ex.toString()); } +fi
svn commit: r800375 - in /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging: AbstractTestLogging.java ChannelLoggingTest.java ConnectionLoggingTest.java
Author: ritchiem Date: Mon Aug 3 13:33:54 2009 New Revision: 800375 URL: http://svn.apache.org/viewvc?rev=800375&view=rev Log: QPID-2002 : Added new getLog method to AbstractTestLogging that retreives the string starting "MESSAGE." This ensures that the LoggingTests are parsing the logged message and not erroneously picking up a section based on the log4j format configuration. i.e. the [qpid.message] logger name was causing issues with searching for the first '[' to get Subject/Actor Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=800375&r1=800374&r2=800375&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Mon Aug 3 13:33:54 2009 @@ -96,9 +96,7 @@ protected String fromMessage(String log) { -int messageStart = log.indexOf("MESSAGE"); - -int startSubject = log.indexOf("]", messageStart) + 1; +int startSubject = log.indexOf("]") + 1; int start = log.indexOf("]", startSubject) + 1; // If we don't have a subject then the second indexOf will return 0 @@ -111,6 +109,19 @@ return log.substring(start).trim(); } +/** + * Extract the Subject from the Log Message. + * + * The subject is the second block inclosed in brackets '[ ]'. + * + * If there is no Subject or the second block of brackets '[ ]' cannot be + * identified then an empty String ("") is returned. + * + * The brackets '[ ]' are not included in the returned String. + * + * @param log The log message to process + * @return the Subject string or the empty string ("") if the subject can't be identified. + */ protected String fromSubject(String log) { int start = log.indexOf("[") + 1; @@ -118,27 +129,94 @@ start = log.indexOf("[", start) + 1; // There may not be a subject so in that case return nothing. -if (start == -1) +if (start == 0) { return ""; } int end = log.indexOf("]", start); -return log.substring(start, end); +try +{ +return log.substring(start, end); +} +catch (IndexOutOfBoundsException iobe) +{ +return ""; +} } +/** + * Extract the actor segment from the log message. + * The Actor segment is the first section enclosed in '[ ]'. + * + * No analysis is performed to ensure that the first '[ ]' section of the + * given log is really an Actor segment. + * + * The brackets '[ ]' are not included in the returned String. + * + * @param log the Log Message + * @return the Actor segment or "" if unable to locate '[ ]' section + */ protected String fromActor(String log) { int start = log.indexOf("[") + 1; int end = log.indexOf("]", start); -return log.substring(start, end).trim(); +try +{ +return log.substring(start, end).trim(); +} +catch (IndexOutOfBoundsException iobe) +{ +return ""; +} } +/** + * Given our log message extract the connection ID: + * + * The log string will contain the connectionID identified by 'con:' + * + * So extract the value shown here by X: + * + * 'con:X(' + * + * Extract the value between the ':' and '(' and process it as an Integer + * + * If we are unable to find the right index or process the substring as an + * Integer then return -1. + * + * @param log the log String to process + * @return the connection ID or -1. + */ protected int extractConnectionID(String log) { int conIDStart = log.indexOf("con:") + 4; int conIDEnd = log.indexOf("(", conIDStart); -return Integer.parseInt(log.substring(conIDStart, conIDEnd)); +try +{ +return Integer.parseInt(log.substring(conIDStart, conIDEnd)); +} +catch (Exception e) +{ +return -1; +} +} + +/** + * Extract the log entry from the raw log line which will contain other + * log4j formatting. + * + * This formatting may impead our testing proc
svn commit: r800376 - in /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging: AbstractTestLogging.java ConnectionLoggingTest.java
Author: ritchiem Date: Mon Aug 3 13:34:33 2009 New Revision: 800376 URL: http://svn.apache.org/viewvc?rev=800376&view=rev Log: QPID-2002 : Updated ConnectionLoggingTest to protect against message reordering of connection closure during negotiation. Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=800376&r1=800375&r2=800376&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Mon Aug 3 13:34:33 2009 @@ -24,6 +24,9 @@ import org.apache.qpid.util.LogMonitor; import java.io.IOException; +import java.util.List; +import java.util.HashMap; +import java.util.LinkedList; public class AbstractTestLogging extends QpidTestCase { @@ -53,7 +56,7 @@ protected void validateMessageID(String id, String log) { -assertEquals("Incorrect CHN message",id, getMessageID(log)); +assertEquals("Incorrect message",id, getMessageID(log)); } protected String getMessageID(String log) @@ -219,4 +222,41 @@ return rawLog.substring(start); } +/** + * Given a list of messages that have been pulled out of a log file + * Process the results splitting the log statements in to lists based on the + * actor's connection ID. + * + * So for each log entry extract the Connecition ID from the Actor of the log + * + * Then use that as a key to a HashMap storing the list of log messages for + * that connection. + * + * @param logMessages The list of mixed connection log messages + * @return Map indexed by connection id to a list of log messages just for that connection. + */ + protected HashMap> splitResultsOnConnectionID(List logMessages) + { + HashMap> connectionSplitList = new HashMap>(); + + for (String log : logMessages) + { + // Get the connectionID from the Actor in the Message Log. + int cID = extractConnectionID(fromActor(getLog(log))); + + List connectionData = connectionSplitList.get(cID); + + // Create the initial List if we don't have one already + if (connectionData == null) + { + connectionData = new LinkedList(); + connectionSplitList.put(cID, connectionData); + } + + // Store the log + connectionData.add(log); + } + + return connectionSplitList; + } } Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java?rev=800376&r1=800375&r2=800376&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java Mon Aug 3 13:34:33 2009 @@ -20,9 +20,16 @@ */ package org.apache.qpid.server.logging; +import org.apache.qpid.test.unit.client.forwardall.Client; + import javax.jms.Connection; import java.io.File; import java.util.List; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.SortedSet; +import java.util.Collections; +import java.util.TreeSet; public class ConnectionLoggingTest extends AbstractTestLogging { @@ -65,11 +72,26 @@ List results = _monitor.findMatches(CONNECTION_PREFIX); // Validation +// We should have at least three messages when running InVM but when running External +// we will get 0-10 negotiation on con:0 whcih may close at some random point +// MESSAGE [con:0(/127.0.0.1:46926)] CON-1001 : Open +// MESSAGE [con:0(/127.0.0.1:46926)] CON-1001 : Open : Protocol Version : 0-10 +// MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open +// MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open : Protocol Version : 0-9 +// MESSAGE [con:0(/127.0.0.1:46926)] CON-1002 : Close +// MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 + +//So check how many connections we have in the result set and extract the la
svn commit: r800439 - in /qpid/trunk/qpid/java: systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java test-profiles/010Excludes
Author: ritchiem Date: Mon Aug 3 16:00:51 2009 New Revision: 800439 URL: http://svn.apache.org/viewvc?rev=800439&view=rev Log: QPID-2019 : Update Exclude mechanism so we can exclude the new logging tests from the CPP broker Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java qpid/trunk/qpid/java/test-profiles/010Excludes Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=800439&r1=800438&r2=800439&view=diff == --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Mon Aug 3 16:00:51 2009 @@ -251,7 +251,8 @@ public void run(TestResult testResult) { -if (_exclusionList != null && (_exclusionList.contains(getClass().getName() + "#*") || +if (_exclusionList != null && (_exclusionList.contains(getClass().getPackage().getName() + ".*") || + _exclusionList.contains(getClass().getName() + "#*") || _exclusionList.contains(getClass().getName() + "#" + getName( { _logger.info("Test: " + getName() + " is excluded"); Modified: qpid/trunk/qpid/java/test-profiles/010Excludes URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/010Excludes?rev=800439&r1=800438&r2=800439&view=diff == --- qpid/trunk/qpid/java/test-profiles/010Excludes (original) +++ qpid/trunk/qpid/java/test-profiles/010Excludes Mon Aug 3 16:00:51 2009 @@ -77,3 +77,5 @@ // QPID-1225 : Temporary remove this test until the problem has been addressed org.apache.qpid.server.security.acl.SimpleACLTest#testClientPublishInvalidQueueSuccess +// CPP Broker does not follow the same Logging convention as the Java broker +org.apache.qpid.server.logging.* - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800485 - /qpid/trunk/qpid/cpp/src/Makefile.am
Author: tross Date: Mon Aug 3 18:23:40 2009 New Revision: 800485 URL: http://svn.apache.org/viewvc?rev=800485&view=rev Log: Moved qpid/management/Manageable.cpp and qpid/management/ManagementObject.cpp from the broker library to the common library. These may be used for client-side QMF applications. Modified: qpid/trunk/qpid/cpp/src/Makefile.am Modified: qpid/trunk/qpid/cpp/src/Makefile.am URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/Makefile.am?rev=800485&r1=800484&r2=800485&view=diff == --- qpid/trunk/qpid/cpp/src/Makefile.am (original) +++ qpid/trunk/qpid/cpp/src/Makefile.am Mon Aug 3 18:23:40 2009 @@ -406,6 +406,8 @@ qpid/log/OstreamOutput.h \ qpid/log/Selector.cpp\ qpid/log/Statement.cpp \ + qpid/management/Manageable.cpp \ + qpid/management/ManagementObject.cpp \ qpid/memory.h\ qpid/pointer_to_other.h \ qpid/ptr_map.h \ @@ -616,13 +618,11 @@ qpid/broker/TxPublish.h \ qpid/broker/Vhost.cpp \ qpid/broker/Vhost.h \ - qpid/management/IdAllocator.h\ - qpid/management/Manageable.cpp \ + qpid/management/IdAllocator.h \ qpid/management/ManagementAgent.cpp \ - qpid/management/ManagementAgent.h\ + qpid/management/ManagementAgent.h \ qpid/management/ManagementExchange.cpp \ - qpid/management/ManagementExchange.h \ - qpid/management/ManagementObject.cpp \ + qpid/management/ManagementExchange.h \ qpid/sys/TCPIOPlugin.cpp - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800487 - /qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile
Author: tross Date: Mon Aug 3 18:24:20 2009 New Revision: 800487 URL: http://svn.apache.org/viewvc?rev=800487&view=rev Log: Updated the include path to use the new cpp/includes directory. Modified: qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile Modified: qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile?rev=800487&r1=800486&r2=800487&view=diff == --- qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile (original) +++ qpid/trunk/qpid/cpp/examples/qmf-agent/Makefile Mon Aug 3 18:24:20 2009 @@ -25,7 +25,7 @@ CC = gcc LIB_DIR = $(QPID_DIR)/cpp/src/.libs -CC_INCLUDES = -I$(SRC_DIR) -I$(QPID_DIR)/cpp/src -I$(QPID_DIR)/cpp/src/gen -I$(GEN_DIR) +CC_INCLUDES = -I$(SRC_DIR) -I$(QPID_DIR)/cpp/include -I$(GEN_DIR) CC_FLAGS = -g -O3 LD_FLAGS = -lqmfagent -lqmfcommon -L$(LIB_DIR) SPEC_DIR = $(QPID_DIR)/specs - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800508 - in /qpid/trunk/qpid/java/management/eclipse-plugin: ./ icons/ src/main/java/org/apache/qpid/management/ui/ src/main/java/org/apache/qpid/management/ui/views/
Author: robbie Date: Mon Aug 3 19:32:59 2009 New Revision: 800508 URL: http://svn.apache.org/viewvc?rev=800508&view=rev Log: QPID-2021: move the refresh button to the right side of the Refresh Interval combo box for clarity, add icons for various 'manager' mbeans, remove Thumbs.db file from repository. Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/configuration_management.gif qpid/trunk/qpid/java/management/eclipse-plugin/icons/logging_management.gif qpid/trunk/qpid/java/management/eclipse-plugin/icons/server_information.gif qpid/trunk/qpid/java/management/eclipse-plugin/icons/user_management.gif qpid/trunk/qpid/java/management/eclipse-plugin/icons/virtualhost_manager.gif Removed: qpid/trunk/qpid/java/management/eclipse-plugin/icons/Thumbs.db Modified: qpid/trunk/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif qpid/trunk/qpid/java/management/eclipse-plugin/icons/refresh.gif qpid/trunk/qpid/java/management/eclipse-plugin/plugin.xml qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/configuration_management.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/configuration_management.gif?rev=800508&view=auto == Files qpid/trunk/qpid/java/management/eclipse-plugin/icons/configuration_management.gif (added) and qpid/trunk/qpid/java/management/eclipse-plugin/icons/configuration_management.gif Mon Aug 3 19:32:59 2009 differ Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/logging_management.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/logging_management.gif?rev=800508&view=auto == Files qpid/trunk/qpid/java/management/eclipse-plugin/icons/logging_management.gif (added) and qpid/trunk/qpid/java/management/eclipse-plugin/icons/logging_management.gif Mon Aug 3 19:32:59 2009 differ Modified: qpid/trunk/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif?rev=800508&r1=800507&r2=800508&view=diff == Binary files - no diff available. Modified: qpid/trunk/qpid/java/management/eclipse-plugin/icons/refresh.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/refresh.gif?rev=800508&r1=800507&r2=800508&view=diff == Binary files - no diff available. Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/server_information.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/server_information.gif?rev=800508&view=auto == Files qpid/trunk/qpid/java/management/eclipse-plugin/icons/server_information.gif (added) and qpid/trunk/qpid/java/management/eclipse-plugin/icons/server_information.gif Mon Aug 3 19:32:59 2009 differ Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/user_management.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/user_management.gif?rev=800508&view=auto == Files qpid/trunk/qpid/java/management/eclipse-plugin/icons/user_management.gif (added) and qpid/trunk/qpid/java/management/eclipse-plugin/icons/user_management.gif Mon Aug 3 19:32:59 2009 differ Added: qpid/trunk/qpid/java/management/eclipse-plugin/icons/virtualhost_manager.gif URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/icons/virtualhost_manager.gif?rev=800508&view=auto == Files qpid/trunk/qpid/java/management/eclipse-plugin/icons/virtualhost_manager.gif (added) and qpid/trunk/qpid/java/management/eclipse-plugin/icons/virtualhost_manager.gif Mon Aug 3 19:32:59 2009 differ Modified: qpid/trunk/qpid/java/management/eclipse-plugin/plugin.xml URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/plugin.xml?rev=800508&r1=800507&r2=800508&view=diff == --- qpid/trunk/qpid/java/management/eclipse-plugin/plugin.xml (original) +++ qpid/trunk/qpid/java/management/eclipse-plugin/plugin.xml Mon Aug 3
svn commit: r800519 - in /qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views: NotificationsTabControl.java VHNotificationsTabControl.java
Author: robbie Date: Mon Aug 3 19:56:18 2009 New Revision: 800519 URL: http://svn.apache.org/viewvc?rev=800519&view=rev Log: QPID-2014: prompt the user for confirmation before clearing all Notifications for the selected vhost/mbean Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java?rev=800519&r1=800518&r2=800519&view=diff == --- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java (original) +++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java Mon Aug 3 19:56:18 2009 @@ -186,10 +186,21 @@ IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection(); if(!ss.isEmpty()) { +//clear selected Notifications serverRegistry.clearNotifications(_mbean, ss.toList()); } else if(_notifications != null) { +//clear all the notifications, if there are any + +//check the user is certain of this clear-all operation +int response = ViewUtility.popupOkCancelConfirmationMessage( +"Clear Notifications", "Clear all Notifications for this MBean?"); +if(response != SWT.OK) +{ +return; +} + synchronized(this) { List newList = new ArrayList(); Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java?rev=800519&r1=800518&r2=800519&view=diff == --- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java (original) +++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java Mon Aug 3 19:56:18 2009 @@ -136,10 +136,21 @@ IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection(); if(!ss.isEmpty()) { +//clear selected Notifications serverRegistry.clearNotifications(null, ss.toList()); } else if(_notifications != null) { +//clear all the notifications, if there are any + +//check the user is certain of this clear-all operation +int response = ViewUtility.popupOkCancelConfirmationMessage( +"Clear Notifications", "Clear all Notifications for this VirtualHost?"); +if(response != SWT.OK) +{ +return; +} + synchronized(this) { serverRegistry.clearNotifications(null, _notifications); - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800550 - /qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
Author: robbie Date: Mon Aug 3 20:36:17 2009 New Revision: 800550 URL: http://svn.apache.org/viewvc?rev=800550&view=rev Log: QPID-2014: when a user sets a new message interval to view, use the interval size as the step change for the Next and Previous buttons Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java?rev=800550&r1=800549&r2=800550&view=diff == --- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java (original) +++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java Mon Aug 3 20:36:17 2009 @@ -93,15 +93,17 @@ private Text _fromMsgText; private Text _toMsgText; +private static final String FROM_DEFAULT = "1"; +private static final String TO_DEFAULT = "50"; +private long _interval = 50; //(to-from)+1 private Long _fromMsg = new Long(FROM_DEFAULT); private Long _toMsg = new Long(TO_DEFAULT); private TabularDataSupport _messages = null; private ManagedQueue _qmb; -private static final String FROM_DEFAULT = "1"; -private static final String TO_DEFAULT = "50"; -private long INTERVAL = 50; +private Button _previousButton; +private Button _nextButton; private static final String MSG_AMQ_ID = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[0]; private static final String MSG_HEADER = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[1]; @@ -252,9 +254,9 @@ _toolkit.createLabel(viewMessageRangeComposite, " "); //spacer -final Button previousButton = _toolkit.createButton(viewMessageRangeComposite, "< Prev " + INTERVAL, SWT.PUSH); -previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); -previousButton.addSelectionListener(new SelectionAdapter() +_previousButton = _toolkit.createButton(viewMessageRangeComposite, "< Prev " + _interval, SWT.PUSH); +_previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); +_previousButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { @@ -266,16 +268,16 @@ } //make 'from' be 'from - INTERVAL', or make it 1 if that would make it 0 or less -_fromMsg = (_fromMsg - INTERVAL < 1) ? 1 : _fromMsg - INTERVAL; +_fromMsg = (_fromMsg - _interval < 1) ? 1 : _fromMsg - _interval; _fromMsgText.setText(_fromMsg.toString()); refresh(_mbean); } }); -final Button nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next " + INTERVAL + " >", SWT.PUSH); -nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); -nextButton.addSelectionListener(new SelectionAdapter() +_nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next " + _interval + " >", SWT.PUSH); +_nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); +_nextButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { @@ -287,7 +289,7 @@ } //make 'to' be 'to + INTERVAL', or make it Long.MAX_VALUE if that would too large -_toMsg = (Long.MAX_VALUE - _toMsg > INTERVAL) ? _toMsg + INTERVAL : Long.MAX_VALUE; +_toMsg = (Long.MAX_VALUE - _toMsg > _interval) ? _toMsg + _interval : Long.MAX_VALUE; _toMsgText.setText(_toMsg.toString()); refresh(_mbean); @@ -718,6 +720,10 @@ _fromMsg = from; _toMsg = to; +_interval = (to - from) + 1; +_previousButton.setText("< Prev " + _interval); +_nextButton.setText("Next " + _interval + " >"); + refresh(_mbean); } - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800555 - in /qpid/trunk/qpid/cpp/src/tests: qrsh.cpp qrsh_server.cpp
Author: astitcher Date: Mon Aug 3 20:45:46 2009 New Revision: 800555 URL: http://svn.apache.org/viewvc?rev=800555&view=rev Log: Fixed missing #include lines Modified: qpid/trunk/qpid/cpp/src/tests/qrsh.cpp qpid/trunk/qpid/cpp/src/tests/qrsh_server.cpp Modified: qpid/trunk/qpid/cpp/src/tests/qrsh.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qrsh.cpp?rev=800555&r1=800554&r2=800555&view=diff == --- qpid/trunk/qpid/cpp/src/tests/qrsh.cpp (original) +++ qpid/trunk/qpid/cpp/src/tests/qrsh.cpp Mon Aug 3 20:45:46 2009 @@ -26,7 +26,7 @@ #include #include - +#include #include #include Modified: qpid/trunk/qpid/cpp/src/tests/qrsh_server.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qrsh_server.cpp?rev=800555&r1=800554&r2=800555&view=diff == --- qpid/trunk/qpid/cpp/src/tests/qrsh_server.cpp (original) +++ qpid/trunk/qpid/cpp/src/tests/qrsh_server.cpp Mon Aug 3 20:45:46 2009 @@ -19,7 +19,7 @@ * */ - +#include #include #include #include - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800581 - /qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
Author: shuston Date: Mon Aug 3 21:43:36 2009 New Revision: 800581 URL: http://svn.apache.org/viewvc?rev=800581&view=rev Log: Add needed 'extern' for building on Windows Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h?rev=800581&r1=800580&r2=800581&view=diff == --- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Mon Aug 3 21:43:36 2009 @@ -323,10 +323,10 @@ * Must be >= the current sequence number. * Used by cluster to replicate queues. */ -void setPosition(framing::SequenceNumber pos); +QPID_BROKER_EXTERN void setPosition(framing::SequenceNumber pos); /** return current position sequence number for the next message on the queue. */ -framing::SequenceNumber getPosition(); +QPID_BROKER_EXTERN framing::SequenceNumber getPosition(); int getEventMode(); void setQueueEventManager(QueueEvents&); QPID_BROKER_EXTERN void insertSequenceNumbers(const std::string& key); - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org
svn commit: r800583 - /qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c
Author: shuston Date: Mon Aug 3 21:44:15 2009 New Revision: 800583 URL: http://svn.apache.org/viewvc?rev=800583&view=rev Log: Return value to silence compiler warnings Modified: qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c Modified: qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c?rev=800583&r1=800582&r2=800583&view=diff == --- qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c (original) +++ qpid/trunk/qpid/cpp/src/tests/dlclose_noop.c Mon Aug 3 21:44:15 2009 @@ -26,5 +26,5 @@ */ #include -void* dlclose(void* handle) {} +void* dlclose(void* handle) { return 0; } - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org