svn commit: r792094 [2/2] - in /qpid/trunk/qpid/java: ./ client/ common/ lib/ lib/poms/

2009-07-08 Thread rhs
Added: qpid/trunk/qpid/java/lib/poms/derby-10.3.2.1.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/derby-10.3.2.1.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/derby-10.3.2.1.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/derby-10.3.2.1.pom Wed Jul  8 10:41:03 2009
@@ -0,0 +1,43 @@
+
+  4.0.0
+  org.apache.derby
+  derby
+  Derby Engine
+  10.3.2.1
+  
+  http://db.apache.org/derby/
+  
+http://issues.apache.org/jira/browse/DERBY
+  
+  2004
+  
+
+  Derby User List
+  derby-user-subscr...@db.apache.org
+  derby-user-unsubscr...@db.apache.org
+  
http://issues.apache.org/eyebrowse/summarizelist?listname=derby-u...@db.apache.org
+
+
+  Derby Developer List
+  derby-dev-subscr...@db.apache.org
+  derby-dev-unsubscr...@db.apache.org
+  
http://issues.apache.org/eyebrowse/summarizelist?listname=derby-...@db.apache.org
+
+
+  Derby Commit List
+  derby-commits-subscr...@db.apache.org
+  derby-commits-unsubscr...@db.apache.org
+  
http://issues.apache.org/eyebrowse/summarizelist?listname=derby-comm...@db.apache.org
+
+  
+  
+
scm:svn:http://svn.apache.org/repos/asf/db/derby/code/trunk
+
scm:svn:https://svn.apache.org/repos/asf/db/derby/code/trunk
+
http://svn.apache.org/viewcvs.cgi/db/derby/code/trunk/?root=Apache-SVN
+  
+  
+Apache Software Foundation
+http://db.apache.org/
+  
+  
+
\ No newline at end of file

Added: qpid/trunk/qpid/java/lib/poms/geronimo-jms_1.1_spec-1.0.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/geronimo-jms_1.1_spec-1.0.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/geronimo-jms_1.1_spec-1.0.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/geronimo-jms_1.1_spec-1.0.pom Wed Jul  8 
10:41:03 2009
@@ -0,0 +1,6 @@
+
+  4.0.0
+  org.apache.geronimo.specs
+  geronimo-jms_1.1_spec
+  1.0
+
\ No newline at end of file

Added: qpid/trunk/qpid/java/lib/poms/junit-3.8.1.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/junit-3.8.1.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/junit-3.8.1.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/junit-3.8.1.pom Wed Jul  8 10:41:03 2009
@@ -0,0 +1,29 @@
+
+http://maven.apache.org/POM/4.0.0"; 
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd ">
+  4.0.0
+  junit
+  junit
+  3.8.1
+  JUnit
+  http://junit.org
+  
+JUnit is a regression testing framework written by Erich Gamma and Kent 
Beck. It is used by the developer who implements unit tests in Java.
+  
+  
+JUnit
+http://www.junit.org
+  
+  
+
+  Common Public License Version 1.0
+  http://www.opensource.org/licenses/cpl1.0.txt
+
+  
+  
+http://junit.cvs.sourceforge.net/junit/
+  
+  
+  
+

Added: qpid/trunk/qpid/java/lib/poms/log4j-1.2.12.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/log4j-1.2.12.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/log4j-1.2.12.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/log4j-1.2.12.pom Wed Jul  8 10:41:03 2009
@@ -0,0 +1,6 @@
+
+  4.0.0
+  log4j
+  log4j
+  1.2.12
+
\ No newline at end of file

Added: qpid/trunk/qpid/java/lib/poms/mina-core-1.0.1.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/mina-core-1.0.1.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/mina-core-1.0.1.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/mina-core-1.0.1.pom Wed Jul  8 10:41:03 2009
@@ -0,0 +1,34 @@
+
+  
+build
+org.apache.mina
+1.0.1
+  
+  4.0.0
+  mina-core
+  Apache MINA Core API
+  1.0.1
+  
+
+  org.slf4j
+  slf4j-simple
+  1.0
+  provided
+
+
+  backport-util-concurrent
+  backport-util-concurrent
+  2.2
+  compile
+
+
+  easymock
+  easymock
+  1.2_Java1.3
+  test
+
+  
+  
+deployed
+  
+
\ No newline at end of file

Added: qpid/trunk/qpid/java/lib/poms/mina-filter-ssl-1.0.1.pom
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/lib/poms/mina-filter-ssl-1.0.1.pom?rev=792094&view=auto
==
--- qpid/trunk/qpid/java/lib/poms/mina-filter-ssl-1.0.1.pom (added)
+++ qpid/trunk/qpid/java/lib/poms/mina-filter-ssl-1.0.1.pom Wed Jul  8 10:41:03 
2009
@@ -0,0 +1,27 @@
+
+  
+build
+org.apache.mina
+1.0.1
+  
+  4.0.0
+  mina-filter-ssl
+  Apache MINA SSL Filter
+  1.0.1
+  
+
+  org.apache.mina
+  mina-core
+

svn commit: r792103 - in /qpid/trunk/qpid/cpp/src: qpid/broker/Message.cpp qpid/broker/Message.h qpid/broker/Queue.cpp qpid/broker/Queue.h qpid/cluster/ClusterPlugin.cpp tests/cluster_test.cpp

2009-07-08 Thread gsim
Author: gsim
Date: Wed Jul  8 11:48:57 2009
New Revision: 792103

URL: http://svn.apache.org/viewvc?rev=792103&view=rev
Log:
QPID-1974: Fixes (and tests) for updating lvq state to new cluster members.


Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/Message.h
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp
qpid/trunk/qpid/cpp/src/tests/cluster_test.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp?rev=792103&r1=792102&r2=792103&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp Wed Jul  8 11:48:57 2009
@@ -401,4 +401,19 @@
 return getProperties()->getApplicationHeaders();
 }
 
+
+void Message::setUpdateDestination(const std::string& d)
+{
+updateDestination = d;
+}
+
+
+bool Message::isUpdateMessage()
+{
+return updateDestination.size() && isA() 
+&& getMethod()->getDestination() == 
updateDestination;
+}
+
+std::string Message::updateDestination;
+
 }} // namespace qpid::broker

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Message.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Message.h?rev=792103&r1=792102&r2=792103&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Message.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Message.h Wed Jul  8 11:48:57 2009
@@ -160,6 +160,9 @@
 void setDequeueCompleteCallback(MessageCallback& cb);
 void resetDequeueCompleteCallback();
 
+bool isUpdateMessage();
+static void setUpdateDestination(const std::string&);
+
   private:
 typedef std::map > Replacement;
 
@@ -186,6 +189,7 @@
 mutable boost::intrusive_ptr empty;
 MessageCallback* enqueueCallback;
 MessageCallback* dequeueCallback;
+static std::string updateDestination;
 };
 
 }}

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=792103&r1=792102&r2=792103&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Jul  8 11:48:57 2009
@@ -570,7 +570,7 @@
 string key = ft->getAsString(qpidVQMatchProperty);
 
 i = lvq.find(key);
-if (i == lvq.end()){
+if (i == lvq.end() || msg->isUpdateMessage()){
 messages.push_back(qm);
 listeners.populate(copy);
 lvq[key] = msg; 

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=792103&r1=792102&r2=792103&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Wed Jul  8 11:48:57 2009
@@ -300,9 +300,15 @@
 ManagementMethod (uint32_t methodId, management::Args& args, 
std::string& text);
 
 /** Apply f to each Message on the queue. */
-template  void eachMessage(F f) const {
+template  void eachMessage(F f) {
 sys::Mutex::ScopedLock l(messageLock);
-std::for_each(messages.begin(), messages.end(), f);
+if (lastValueQueue) {
+for (Messages::iterator i = messages.begin(); i != 
messages.end(); ++i) {
+f(checkLvqReplace(*i));
+}
+} else {
+std::for_each(messages.begin(), messages.end(), f);
+}
 }
 
 /** Apply f to each QueueBinding on the queue */

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp?rev=792103&r1=792102&r2=792103&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp Wed Jul  8 11:48:57 
2009
@@ -34,6 +34,7 @@
 #include "qpid/management/ManagementAgent.h"
 #include "qpid/management/IdAllocator.h"
 #include "qpid/broker/Exchange.h"
+#include "qpid/broker/Message.h"
 #include "qpid/broker/Queue.h"
 #include "qpid/broker/SessionState.h"
 #include "qpid/client/ConnectionSettings.h"
@@ -136,6 +137,7 @@
 broker->setConnectionFactory(
 boost::shared_ptr(
 new ConnectionCodec::Factory(broker->getConnectionFactory(), 
*cluster)

svn commit: r792139 - in /qpid/trunk/qpid/cpp: bindings/qmf/ruby/Makefile.am configure.ac m4/ac_pkg_swig.m4

2009-07-08 Thread tross
Author: tross
Date: Wed Jul  8 13:50:09 2009
New Revision: 792139

URL: http://svn.apache.org/viewvc?rev=792139&view=rev
Log:
Added version check for SWIG in the configure script.  This should properly 
disable SWIG for
distributions with too-old versions.

Added:
qpid/trunk/qpid/cpp/m4/ac_pkg_swig.m4
Modified:
qpid/trunk/qpid/cpp/bindings/qmf/ruby/Makefile.am
qpid/trunk/qpid/cpp/configure.ac

Modified: qpid/trunk/qpid/cpp/bindings/qmf/ruby/Makefile.am
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf/ruby/Makefile.am?rev=792139&r1=792138&r2=792139&view=diff
==
--- qpid/trunk/qpid/cpp/bindings/qmf/ruby/Makefile.am (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf/ruby/Makefile.am Wed Jul  8 13:50:09 2009
@@ -31,7 +31,7 @@
 dist_rubylib_DATA = qmf.rb
 
 $(generated_file_list): $(srcdir)/ruby.i $(srcdir)/../qmfengine.i
-   swig -ruby -c++ -Wall -I/usr/include $(INCLUDES) $(QPID_CXXFLAGS) -o 
qmfengine.cpp $(srcdir)/ruby.i
+   $(SWIG) -ruby -c++ -Wall -I/usr/include $(INCLUDES) $(QPID_CXXFLAGS) -o 
qmfengine.cpp $(srcdir)/ruby.i
 
 AM_CPPFLAGS = $(QPID_CXXFLAGS) $(INCLUDES) -I$(srcdir) -I$(RUBY_INC) 
-I$(RUBY_INC_ARCH)
 AM_CXXFLAGS = $(QPID_CXXFLAGS)

Modified: qpid/trunk/qpid/cpp/configure.ac
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/configure.ac?rev=792139&r1=792138&r2=792139&view=diff
==
--- qpid/trunk/qpid/cpp/configure.ac (original)
+++ qpid/trunk/qpid/cpp/configure.ac Wed Jul  8 13:50:09 2009
@@ -150,7 +150,8 @@
 test -z "$RUBY" && AC_MSG_ERROR([Missing ruby installation (try "yum install 
ruby").])
 
 # Swig binding generator is needed for the script (Ruby, Python, etc.) 
bindings.
-AC_CHECK_PROG([SWIG], [swig], [swig])
+AC_PROG_SWIG(1.3.26)
+test ! -x "$SWIG" && SWIG=""
 AC_ARG_WITH([swig],
   [AS_HELP_STRING([--with-swig], [Use swig to generate qmf bindings.])],
   [case "$withval" in

Added: qpid/trunk/qpid/cpp/m4/ac_pkg_swig.m4
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/m4/ac_pkg_swig.m4?rev=792139&view=auto
==
--- qpid/trunk/qpid/cpp/m4/ac_pkg_swig.m4 (added)
+++ qpid/trunk/qpid/cpp/m4/ac_pkg_swig.m4 Wed Jul  8 13:50:09 2009
@@ -0,0 +1,118 @@
+# ===
+#   http://www.nongnu.org/autoconf-archive/ac_pkg_swig.html
+# ===
+#
+# SYNOPSIS
+#
+#   AC_PROG_SWIG([major.minor.micro])
+#
+# DESCRIPTION
+#
+#   This macro searches for a SWIG installation on your system. If found you
+#   should call SWIG via $(SWIG). You can use the optional first argument to
+#   check if the version of the available SWIG is greater than or equal to
+#   the value of the argument. It should have the format: N[.N[.N]] (N is a
+#   number between 0 and 999. Only the first N is mandatory.)
+#
+#   If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that
+#   the swig package is this version number or higher.
+#
+#   In configure.in, use as:
+#
+# AC_PROG_SWIG(1.3.17)
+# SWIG_ENABLE_CXX
+# SWIG_MULTI_MODULE_SUPPORT
+# SWIG_PYTHON
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Sebastian Huber 
+#   Copyright (c) 2008 Alan W. Irwin 
+#   Copyright (c) 2008 Rafael Laboissiere 
+#   Copyright (c) 2008 Andrew Collier 
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see .
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as

svn commit: r792157 - in /qpid/trunk/qpid/java: ./ test-profiles/ test-profiles/test_resources/ test-profiles/test_resources/ssl/server_db/ test_resources/

2009-07-08 Thread rhs
Author: rhs
Date: Wed Jul  8 14:22:11 2009
New Revision: 792157

URL: http://svn.apache.org/viewvc?rev=792157&view=rev
Log:
moved test profiles and related resources into test-profiles subdirectory

Added:
qpid/trunk/qpid/java/test-profiles/
qpid/trunk/qpid/java/test-profiles/010ExcludeList   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/010ExcludeList
qpid/trunk/qpid/java/test-profiles/010ExcludeList-noPrefetch   (props 
changed)
  - copied unchanged from r792093, 
qpid/trunk/qpid/java/010ExcludeList-noPrefetch
qpid/trunk/qpid/java/test-profiles/010ExcludeList-ssl   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/010ExcludeList-ssl
qpid/trunk/qpid/java/test-profiles/010ExcludeList-store   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/010ExcludeList-store
qpid/trunk/qpid/java/test-profiles/08ExcludeList   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/08ExcludeList
qpid/trunk/qpid/java/test-profiles/08ExcludeList-nonvm   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/08ExcludeList-nonvm
qpid/trunk/qpid/java/test-profiles/08ExcludeList-nopersistence   (props 
changed)
  - copied unchanged from r792093, 
qpid/trunk/qpid/java/08ExcludeList-nopersistence
qpid/trunk/qpid/java/test-profiles/ExcludeList   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/ExcludeList
qpid/trunk/qpid/java/test-profiles/XAExcludeList   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/XAExcludeList
qpid/trunk/qpid/java/test-profiles/clean-dir   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/clean-dir
qpid/trunk/qpid/java/test-profiles/cpp.async.testprofile   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/cpp.async.testprofile
qpid/trunk/qpid/java/test-profiles/cpp.cluster.testprofile   (contents, 
props changed)
  - copied, changed from r792093, 
qpid/trunk/qpid/java/cpp.cluster.testprofile
qpid/trunk/qpid/java/test-profiles/cpp.noprefetch.testprofile   (contents, 
props changed)
  - copied, changed from r792093, 
qpid/trunk/qpid/java/cpp.noprefetch.testprofile
qpid/trunk/qpid/java/test-profiles/cpp.ssl.testprofile   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/cpp.ssl.testprofile
qpid/trunk/qpid/java/test-profiles/cpp.testprofile   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/cpp.testprofile
qpid/trunk/qpid/java/test-profiles/default-longrunning.testprofile   
(contents, props changed)
  - copied, changed from r792093, 
qpid/trunk/qpid/java/default-longrunning.testprofile
qpid/trunk/qpid/java/test-profiles/default.testprofile   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/default.testprofile
qpid/trunk/qpid/java/test-profiles/java-derby.testprofile   (contents, 
props changed)
  - copied, changed from r792093, 
qpid/trunk/qpid/java/java-derby.testprofile
qpid/trunk/qpid/java/test-profiles/java.testprofile   (contents, props 
changed)
  - copied, changed from r792093, qpid/trunk/qpid/java/java.testprofile
qpid/trunk/qpid/java/test-profiles/log4j-test.xml   (props changed)
  - copied unchanged from r792093, qpid/trunk/qpid/java/log4j-test.xml
qpid/trunk/qpid/java/test-profiles/test-provider.properties   (props 
changed)
  - copied unchanged from r792093, 
qpid/trunk/qpid/java/test-provider.properties
qpid/trunk/qpid/java/test-profiles/test_resources/   (props changed)
  - copied from r792093, qpid/trunk/qpid/java/test_resources/
Removed:
qpid/trunk/qpid/java/010ExcludeList
qpid/trunk/qpid/java/010ExcludeList-noPrefetch
qpid/trunk/qpid/java/010ExcludeList-ssl
qpid/trunk/qpid/java/010ExcludeList-store
qpid/trunk/qpid/java/08ExcludeList
qpid/trunk/qpid/java/08ExcludeList-nonvm
qpid/trunk/qpid/java/08ExcludeList-nopersistence
qpid/trunk/qpid/java/ExcludeList
qpid/trunk/qpid/java/XAExcludeList
qpid/trunk/qpid/java/clean-dir
qpid/trunk/qpid/java/cpp.async.testprofile
qpid/trunk/qpid/java/cpp.cluster.testprofile
qpid/trunk/qpid/java/cpp.noprefetch.testprofile
qpid/trunk/qpid/java/cpp.ssl.testprofile
qpid/trunk/qpid/java/cpp.testprofile
qpid/trunk/qpid/java/default-longrunning.testprofile
qpid/trunk/qpid/java/default.testprofile
qpid/trunk/qpid/java/java-derby.testprofile
qpid/trunk/qpid/java/java.testprofile
qpid/trunk/qpid/java/log4j-test.xml
qpid/trunk/qpid/java/test-provider.properties
qpid/trunk/qpid/java/test_resources/
Modified:
qpid/trunk/qpid/java/common.xml
qpid/trunk/qpid/java/module.xml
qpid/trunk/qpid/java/test-profiles/test_resources/ssl/server_db/cert8.db   
(props changed)
qpid/trunk/qpid/java/test-prof

svn commit: r792171 - /qpid/trunk/qpid/python/commands/qpid-config

2009-07-08 Thread tross
Author: tross
Date: Wed Jul  8 14:53:39 2009
New Revision: 792171

URL: http://svn.apache.org/viewvc?rev=792171&view=rev
Log:
Fixed a typo in the help text

Modified:
qpid/trunk/qpid/python/commands/qpid-config

Modified: qpid/trunk/qpid/python/commands/qpid-config
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/python/commands/qpid-config?rev=792171&r1=792170&r2=792171&view=diff
==
--- qpid/trunk/qpid/python/commands/qpid-config (original)
+++ qpid/trunk/qpid/python/commands/qpid-config Wed Jul  8 14:53:39 2009
@@ -118,7 +118,7 @@
 print " accept-mode, and the discard-unroutable 
delivery property is set to false, and"
 print " there is no queue to route to for the 
given message according to the bindings"
 print " on this exchange."
-print "--passiveDo not actually change teh broker state 
(exchange will not be created)"
+print "--passiveDo not actually change the broker state 
(exchange will not be created)"
 print "--durableExchange is durable"
 print "--sequence   Exchange will insert a 'qpid.msg_sequence' 
field in the message header"
 print " with a value that increments for each 
message forwarded."



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



svn commit: r792194 - /qpid/trunk/qpid/cpp/docs/api/user.doxygen.in

2009-07-08 Thread jonathan
Author: jonathan
Date: Wed Jul  8 15:45:18 2009
New Revision: 792194

URL: http://svn.apache.org/viewvc?rev=792194&view=rev
Log:
Added qpid:Exception to the client API documentation.


Modified:
qpid/trunk/qpid/cpp/docs/api/user.doxygen.in

Modified: qpid/trunk/qpid/cpp/docs/api/user.doxygen.in
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/docs/api/user.doxygen.in?rev=792194&r1=792193&r2=792194&view=diff
==
--- qpid/trunk/qpid/cpp/docs/api/user.doxygen.in (original)
+++ qpid/trunk/qpid/cpp/docs/api/user.doxygen.in Wed Jul  8 15:45:18 2009
@@ -457,7 +457,7 @@
 # with spaces.
 
 # INPUT= ../../src/qpid ../../src/gen/qpid
-INPUT  = ../../src/qpid/client/  
../../src/gen/qpid/client/no_keyword/ ../../src/qpid/framing/  
../../src/gen/qpid/client/ . ../../src/gen/qpid/framing/
+INPUT  = ../../src/qpid/client/  
../../src/gen/qpid/client/no_keyword/ ../../src/qpid/framing/  
../../src/gen/qpid/client/ . ../../src/gen/qpid/framing/ 
../../src/qpid/Exception.h
 
 
 # If the value of the INPUT tag contains directories, you can use the 



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



[CONF] Apache Qpid: Operational Logging - Status Update - Test Plan (page edited)

2009-07-08 Thread confluence










Page Edited :
qpid :
Operational Logging - Status Update - Test Plan



 
Operational Logging - Status Update - Test Plan
has been edited by Martin Ritchie
(Jul 08, 2009).
 

 
 (View changes)
 

Content:
Test Plan
This plan is to test the new logging functionality presented in the Status Update Design.



  Test Plan Objectives
  Performance Testing
  Operation Testing


Test Plan Objectives
This plan will define the various areas that must be tested to validate the new logging meets its requirements. This information will the be used during the subsequent technical design and development phases to ensure that the testing approaches defined in this plan are possible.

The plan will focus on two areas:

	Performance Testing
	Operation Testing




Performance Testing
One of the biggest risks of adding more logging to the broker is the potential performance impact they will have in terms of a) creating the messages to log and b) actually logging the message. Therefore validating our changes have a negligible performance impact is key.

Approach
A series of test must be written that cover all the log messages that the broker will generate. The approach to valiate any performance changes should then be to run the test multiple times to generate an average performance. The difference between the logging on and logging off performance should be within 3%. Based on previous performance tesing results this should give us an impact range of 1-5%. However, it should be noted that such a comparison technique will only ensure that the impact of the logging does not shift between each run. The test will not address any potential drift in performance of the broker as a whole, only the difference between logging on and logging off.

The test should run with interleaved test setups, i.e. Logging On then Loggging off. This will help minimise any external factors that could impact the timing. The time spent logging however, will still represent a very small percentage of time for a test case and as such the test will be more susceptible to other factors during the test run. 

Operation Testing
There are two componente to testing the functionality of the new logging. 

	Unit Testing
	System Testing



Unit Testing
Unit testing must be compelted on each module and code coverage should cover at least 80% (aiming towrds 100%) of the codebase. The unit testing however, will only verify that with the use of a test output logger that the module performs as expected.

System Testing
System testing will need to be performed to validate that the correct log messages appear in the right order when run as a full system. By using the test output logger used for the Unit testing it will be possible to validate an InVM broker correctly logs at the appropriate time. To complete system testing the log4j output from an external broker test run must be examined to ensure it contains the expected output. The alerting tests already perform this sort of external log validation so this should be easy to repllicate.

Additionally, we will want to add tests to understand how the system behaves under certain failure conditions. This will not be required as part of this initial work. However, when we remove log4j we need to understand what the differences will with any new logging framework in failure situations, i.e. disk Full, disk loss(crash, NFS delay).











Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences







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



svn commit: r792208 - in /qpid/trunk/qpid/cpp/src/qpid/broker: PersistableMessage.cpp PersistableMessage.h Queue.cpp Queue.h

2009-07-08 Thread cctrieloff
Author: cctrieloff
Date: Wed Jul  8 16:10:29 2009
New Revision: 792208

URL: http://svn.apache.org/viewvc?rev=792208&view=rev
Log:
More tests and complete fix for svn791672 commit -- correct requeue

Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp?rev=792208&r1=792207&r2=792208&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp Wed Jul  8 
16:10:29 2009
@@ -90,6 +90,16 @@
 }
 }
 
+bool PersistableMessage::isStoredOnQueue(PersistableQueue::shared_ptr queue){
+if (store && (queue->getPersistenceId()!=0)) {
+for (syncList::iterator i = synclist.begin(); i != synclist.end(); 
++i) {
+PersistableQueue::shared_ptr q(i->lock());
+if (q && q->getPersistenceId() == queue->getPersistenceId())  
return true;
+} 
+}
+return false;
+}
+
 void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, 
MessageStore* _store) { 
 if (_store){
 sys::ScopedLock l(storeLock);

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h?rev=792208&r1=792207&r2=792208&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h Wed Jul  8 
16:10:29 2009
@@ -111,6 +111,8 @@
  MessageStore* _store);
 
 QPID_BROKER_EXTERN void dequeueAsync();
+
+bool isStoredOnQueue(PersistableQueue::shared_ptr queue);
 };
 
 }}

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=792208&r1=792207&r2=792208&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Jul  8 16:10:29 2009
@@ -99,8 +99,7 @@
 eventMode(0),
 eventMgr(0),
 insertSeqNo(0),
-broker(b),
-lastForcedPosition(0)
+broker(b)
 {
 if (parent != 0 && broker != 0)
 {
@@ -211,6 +210,14 @@
 msg.payload->enqueueComplete(); // mark the message as enqueued
 messages.push_front(msg);
 listeners.populate(copy);
+
+// for persistLastNode - don't force a message twice to disk, but 
force it if no force before 
+if(inLastNodeFailure && persistLastNode && 
!msg.payload->isStoredOnQueue(shared_from_this())) {
+msg.payload->forcePersistent();
+if (msg.payload->isForcedPersistent() ){
+   enqueue(0, msg.payload);
+}
+}
 }
 copy.notify();
 }
@@ -660,7 +667,6 @@
 void Queue::clearLastNodeFailure()
 {
 inLastNodeFailure = false;
-lastForcedPosition = sequence;
 }
 
 void Queue::setLastNodeFailure()
@@ -669,19 +675,19 @@
 Mutex::ScopedLock locker(messageLock);
for ( Messages::iterator i = messages.begin(); i != messages.end(); ++i 
) {
 // don't force a message twice to disk.
-if(i->position > lastForcedPosition) {
+if(!i->payload->isStoredOnQueue(shared_from_this())) {
 if (lastValueQueue) checkLvqReplace(*i);
 i->payload->forcePersistent();
 if (i->payload->isForcedPersistent() ){
enqueue(0, i->payload);
 }
-lastForcedPosition = i->position;
 }
}
 inLastNodeFailure = true;
 }
 }
 
+
 // return true if store exists, 
 bool Queue::enqueue(TransactionContext* ctxt, boost::intrusive_ptr 
msg)
 {

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=792208&r1=792207&r2=792208&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Wed Jul  8 16:10:29 2009
@@ -106,7 +106,6 @@
 bool insertSeqNo;
 std::string seqNoKey;
 Broker* broker;
-framing::SequenceNumber lastForcedPosition;
 
 void push(boost::intrusive_ptr& msg, bool 
isRecovery=false);
 void setPolicy(std::auto_ptr policy);



-
Apa

svn commit: r792210 - /qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

2009-07-08 Thread cctrieloff
Author: cctrieloff
Date: Wed Jul  8 16:20:47 2009
New Revision: 792210

URL: http://svn.apache.org/viewvc?rev=792210&view=rev
Log:
 test for last commit

Modified:
qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=792210&r1=792209&r2=792210&view=diff
==
--- qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Wed Jul  8 16:20:47 2009
@@ -576,8 +576,25 @@
 queue2->setLastNodeFailure();
 BOOST_CHECK_EQUAL(testStore.enqCnt, 6u);
 
-}
+// check requeue 1
+intrusive_ptr msg4 = create_message("e", "C");
+intrusive_ptr msg5 = create_message("e", "D");
 
+framing::SequenceNumber sequence(1);
+QueuedMessage qmsg1(queue1.get(), msg4, sequence);
+QueuedMessage qmsg2(queue2.get(), msg5, ++sequence);
+
+queue1->requeue(qmsg1);
+BOOST_CHECK_EQUAL(testStore.enqCnt, 7u);
+
+// check requeue 2
+queue2->clearLastNodeFailure();
+queue2->requeue(qmsg2);
+BOOST_CHECK_EQUAL(testStore.enqCnt, 7u);
+queue2->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 8u);
+
+}
 
 
 QPID_AUTO_TEST_SUITE_END()



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



svn commit: r792237 - /qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp

2009-07-08 Thread gsim
Author: gsim
Date: Wed Jul  8 17:28:09 2009
New Revision: 792237

URL: http://svn.apache.org/viewvc?rev=792237&view=rev
Log:
Now that broker expects clients to send heartbeats, the client half of an 
inter-broker link must echo heratbeats (as these are set to the maximum allowed 
value for such links).


Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp?rev=792237&r1=792236&r2=792237&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp Wed Jul  8 
17:28:09 2009
@@ -216,9 +216,14 @@
 }
 
 void ConnectionHandler::Handler::heartbeat(){
-   // Do nothing - the purpose of heartbeats is just to make sure that 
there is some
-   // traffic on the connection within the heart beat interval, we check 
for the
-   // traffic and don't need to do anything in response to heartbeats
+// For general case, do nothing - the purpose of heartbeats is
+// just to make sure that there is some traffic on the connection
+// within the heart beat interval, we check for the traffic and
+// don't need to do anything in response to heartbeats.  The
+// exception is when we are in fact the client to another broker
+// (i.e. an inter-broker link), in which case we echo the
+// heartbeat back to the peer
+if (!serverMode) proxy.heartbeat();
 }
 
 void ConnectionHandler::Handler::start(const FieldTable& serverProperties,



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



svn commit: r792259 - in /qpid/trunk/qpid/cpp/src: qpid/broker/Queue.cpp tests/QueueTest.cpp

2009-07-08 Thread cctrieloff
Author: cctrieloff
Date: Wed Jul  8 18:58:27 2009
New Revision: 792259

URL: http://svn.apache.org/viewvc?rev=792259&view=rev
Log:
fix for regression in patch & test to prevent regression again
Simulate this:
  1. start 2 nodes
  2. create cluster durable lvq
  3. send a transient message to the queue
  4. kill one of the nodes (to trigger force persistent behaviour)...
  5. then restart it (to turn off force persistent behaviour)
  6. send another transient message with same lvq key as in 3
  7. kill the second node again (retrigger force persistent)
  8. stop and recover the first node



Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=792259&r1=792258&r2=792259&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Jul  8 18:58:27 2009
@@ -674,9 +674,9 @@
 if (persistLastNode){
 Mutex::ScopedLock locker(messageLock);
for ( Messages::iterator i = messages.begin(); i != messages.end(); ++i 
) {
+if (lastValueQueue) checkLvqReplace(*i);
 // don't force a message twice to disk.
 if(!i->payload->isStoredOnQueue(shared_from_this())) {
-if (lastValueQueue) checkLvqReplace(*i);
 i->payload->forcePersistent();
 if (i->payload->isForcedPersistent() ){
enqueue(0, i->payload);

Modified: qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=792259&r1=792258&r2=792259&view=diff
==
--- qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Wed Jul  8 18:58:27 2009
@@ -488,6 +488,53 @@
 
 }
 
+QPID_AUTO_TEST_CASE(testLVQRecover){
+
+/* simulate this
+  1. start 2 nodes
+  2. create cluster durable lvq
+  3. send a transient message to the queue
+  4. kill one of the nodes (to trigger force persistent behaviour)...
+  5. then restart it (to turn off force persistent behaviour)
+  6. send another transient message with same lvq key as in 3
+  7. kill the second node again (retrigger force persistent)
+  8. stop and recover the first node
+*/
+TestMessageStoreOC  testStore;
+client::QueueOptions args;
+// set queue mode
+args.setOrdering(client::LVQ);
+args.setPersistLastNode();
+
+Queue::shared_ptr queue1(new Queue("my-queue", true, &testStore));
+intrusive_ptr received;
+queue1->configure(args);
+   
+intrusive_ptr msg1 = create_message("e", "A");
+intrusive_ptr msg2 = create_message("e", "A");
+// 2
+string key;
+args.getLVQKey(key);
+BOOST_CHECK_EQUAL(key, "qpid.LVQ_key");
+
+
msg1->getProperties()->getApplicationHeaders().setString(key,"a");
+
msg2->getProperties()->getApplicationHeaders().setString(key,"a");
+   // 3
+queue1->deliver(msg1);
+// 4
+queue1->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 1u);
+// 5
+queue1->clearLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 1u);
+// 6
+queue1->deliver(msg2);
+BOOST_CHECK_EQUAL(testStore.enqCnt, 1u);
+queue1->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 2u);
+BOOST_CHECK_EQUAL(testStore.deqCnt, 1u);
+}
+
 void addMessagesToQueue(uint count, Queue& queue, uint oddTtl = 200, uint 
evenTtl = 0) 
 {
 for (uint i = 0; i < count; i++) {
@@ -594,6 +641,9 @@
 queue2->setLastNodeFailure();
 BOOST_CHECK_EQUAL(testStore.enqCnt, 8u);
 
+queue2->clearLastNodeFailure();
+queue2->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 8u);
 }
 
 



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



svn commit: r792285 - in /qpid/trunk/qpid/cpp/src/qpid/broker: PersistableMessage.cpp PersistableMessage.h Queue.cpp

2009-07-08 Thread cctrieloff
Author: cctrieloff
Date: Wed Jul  8 20:01:34 2009
New Revision: 792285

URL: http://svn.apache.org/viewvc?rev=792285&view=rev
Log:
Fix to cover this case:
  1. start two nodes
  2. create cluster durable queue and add some messages
  3. kill one node (trigger force-persistent behaviour)
  4. stop and recover remaining node
  5. add another node
  6. kill that new node again


Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h
qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp?rev=792285&r1=792284&r2=792285&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.cpp Wed Jul  8 
20:01:34 2009
@@ -100,13 +100,18 @@
 return false;
 }
 
-void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, 
MessageStore* _store) { 
+
+void PersistableMessage::addToSyncList(PersistableQueue::shared_ptr queue, 
MessageStore* _store) { 
 if (_store){
 sys::ScopedLock l(storeLock);
 store = _store;
 boost::weak_ptr q(queue);
 synclist.push_back(q);
 }
+}
+
+void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, 
MessageStore* _store) { 
+addToSyncList(queue, _store);
 enqueueAsync();
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h?rev=792285&r1=792284&r2=792285&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PersistableMessage.h Wed Jul  8 
20:01:34 2009
@@ -113,6 +113,9 @@
 QPID_BROKER_EXTERN void dequeueAsync();
 
 bool isStoredOnQueue(PersistableQueue::shared_ptr queue);
+
+void addToSyncList(PersistableQueue::shared_ptr queue, MessageStore* 
_store);
+
 };
 
 }}

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=792285&r1=792284&r2=792285&view=diff
==
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Jul  8 20:01:34 2009
@@ -182,6 +182,10 @@
 
 void Queue::recover(boost::intrusive_ptr& msg){
 push(msg, true);
+if (store){ 
+// setup synclist for recovered messages, so they don't get re-stored 
on lastNodeFailure
+msg->addToSyncList(shared_from_this(), store); 
+}
 msg->enqueueComplete(); // mark the message as enqueued
 mgntEnqStats(msg);
 



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



svn commit: r792286 - /qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

2009-07-08 Thread cctrieloff
Author: cctrieloff
Date: Wed Jul  8 20:02:36 2009
New Revision: 792286

URL: http://svn.apache.org/viewvc?rev=792286&view=rev
Log:
simulate this:
  1. start two nodes
  2. create cluster durable queue and add some messages
  3. kill one node (trigger force-persistent behaviour)
  4. stop and recover remaining node
  5. add another node
  6. kill that new node again
make sure that an attempt to re-enqueue a message does not happen which will 
result in the last man standing exiting with an error. 


Modified:
qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=792286&r1=792285&r2=792286&view=diff
==
--- qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Wed Jul  8 20:02:36 2009
@@ -646,6 +646,48 @@
 BOOST_CHECK_EQUAL(testStore.enqCnt, 8u);
 }
 
+QPID_AUTO_TEST_CASE(testLastNodeRecoverAndFail){
+/*
+simulate this:
+  1. start two nodes
+  2. create cluster durable queue and add some messages
+  3. kill one node (trigger force-persistent behaviour)
+  4. stop and recover remaining node
+  5. add another node
+  6. kill that new node again
+make sure that an attempt to re-enqueue a message does not happen which will 
+result in the last man standing exiting with an error. 
+
+we need to make sure that recover is safe, i.e. messages are
+not requeued to the store.
+*/
+TestMessageStoreOC  testStore;
+client::QueueOptions args;
+// set queue mode
+args.setPersistLastNode();
+
+Queue::shared_ptr queue1(new Queue("my-queue", true, &testStore));
+intrusive_ptr received;
+queue1->configure(args);
+   
+// check requeue 1
+intrusive_ptr msg1 = create_message("e", "C");
+intrusive_ptr msg2 = create_message("e", "D");
+
+queue1->recover(msg1);
+
+queue1->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 0u);
+
+queue1->clearLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 0u);
+
+queue1->deliver(msg2);
+BOOST_CHECK_EQUAL(testStore.enqCnt, 0u);
+queue1->setLastNodeFailure();
+BOOST_CHECK_EQUAL(testStore.enqCnt, 1u);
+
+}
 
 QPID_AUTO_TEST_SUITE_END()
 



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