rpms/qpidc/F-12 bz538355.patch,NONE,1.1 qpidc.spec,1.107,1.108
Nuno Santos
nsantos at fedoraproject.org
Wed Dec 2 21:48:53 UTC 2009
Author: nsantos
Update of /cvs/extras/rpms/qpidc/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10951
Modified Files:
qpidc.spec
Added Files:
bz538355.patch
Log Message:
Patch for BZ538355
bz538355.patch:
bindings/qmf/python/qmf.py | 5 ---
bindings/qmf/ruby/qmf.rb | 3 -
bindings/qmf/tests/agent_ruby.rb | 4 +-
bindings/qmf/tests/python_console.py | 15 +++++++++
bindings/qmf/tests/ruby_console_test.rb | 16 ++++++++--
src/qmf/engine/ObjectIdImpl.cpp | 51 +++++++++++++++++++++++++-------
src/qmf/engine/ObjectIdImpl.h | 16 +++++-----
src/qmf/engine/ResilientConnection.cpp | 2 -
8 files changed, 83 insertions(+), 29 deletions(-)
--- NEW FILE bz538355.patch ---
Index: cpp/src/qmf/engine/ObjectIdImpl.cpp
===================================================================
--- cpp/src/qmf/engine/ObjectIdImpl.cpp (revision 886044)
+++ cpp/src/qmf/engine/ObjectIdImpl.cpp (working copy)
@@ -24,7 +24,6 @@
using namespace qmf::engine;
using qpid::framing::Buffer;
-
void AgentAttachment::setBanks(uint32_t broker, uint32_t agent)
{
first =
@@ -121,28 +120,60 @@
return repr;
}
-bool ObjectIdImpl::operator==(const ObjectIdImpl& other) const
+#define ACTUAL_FIRST (agent == 0 ? first : first | agent->first)
+#define ACTUAL_OTHER (other.agent == 0 ? other.first : other.first | other.agent->first)
+
+uint8_t ObjectIdImpl::getFlags() const
{
- uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;
+ return (ACTUAL_FIRST & 0xF000000000000000LL) >> 60;
+}
- return first == otherFirst && second == other.second;
+uint16_t ObjectIdImpl::getSequence() const
+{
+ return (ACTUAL_FIRST & 0x0FFF000000000000LL) >> 48;
}
-bool ObjectIdImpl::operator<(const ObjectIdImpl& other) const
+uint32_t ObjectIdImpl::getBrokerBank() const
{
- uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;
+ return (ACTUAL_FIRST & 0x0000FFFFF0000000LL) >> 28;
+}
- return (first < otherFirst) || ((first == otherFirst) && (second < other.second));
+uint32_t ObjectIdImpl::getAgentBank() const
+{
+ return ACTUAL_FIRST & 0x000000000FFFFFFFLL;
}
-bool ObjectIdImpl::operator>(const ObjectIdImpl& other) const
+uint64_t ObjectIdImpl::getObjectNum() const
{
- uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;
+ return second;
+}
- return (first > otherFirst) || ((first == otherFirst) && (second > other.second));
+uint32_t ObjectIdImpl::getObjectNumHi() const
+{
+ return (uint32_t) (second >> 32);
}
+uint32_t ObjectIdImpl::getObjectNumLo() const
+{
+ return (uint32_t) (second & 0x00000000FFFFFFFFLL);
+}
+bool ObjectIdImpl::operator==(const ObjectIdImpl& other) const
+{
+ return ACTUAL_FIRST == ACTUAL_OTHER && second == other.second;
+}
+
+bool ObjectIdImpl::operator<(const ObjectIdImpl& other) const
+{
+ return (ACTUAL_FIRST < ACTUAL_OTHER) || ((ACTUAL_FIRST == ACTUAL_OTHER) && (second < other.second));
+}
+
+bool ObjectIdImpl::operator>(const ObjectIdImpl& other) const
+{
+ return (ACTUAL_FIRST > ACTUAL_OTHER) || ((ACTUAL_FIRST == ACTUAL_OTHER) && (second > other.second));
+}
+
+
//==================================================================
// Wrappers
//==================================================================
Index: cpp/src/qmf/engine/ObjectIdImpl.h
===================================================================
--- cpp/src/qmf/engine/ObjectIdImpl.h (revision 886044)
+++ cpp/src/qmf/engine/ObjectIdImpl.h (working copy)
@@ -51,15 +51,15 @@
void encode(qpid::framing::Buffer& buffer) const;
void fromString(const std::string& repr);
const std::string& asString() const;
- uint8_t getFlags() const { return (first & 0xF000000000000000LL) >> 60; }
- uint16_t getSequence() const { return (first & 0x0FFF000000000000LL) >> 48; }
- uint32_t getBrokerBank() const { return (first & 0x0000FFFFF0000000LL) >> 28; }
- uint32_t getAgentBank() const { return first & 0x000000000FFFFFFFLL; }
- uint64_t getObjectNum() const { return second; }
- uint32_t getObjectNumHi() const { return (uint32_t) (second >> 32); }
- uint32_t getObjectNumLo() const { return (uint32_t) (second & 0x00000000FFFFFFFFLL); }
+ uint8_t getFlags() const;
+ uint16_t getSequence() const;
+ uint32_t getBrokerBank() const;
+ uint32_t getAgentBank() const;
+ uint64_t getObjectNum() const;
+ uint32_t getObjectNumHi() const;
+ uint32_t getObjectNumLo() const;
bool isDurable() const { return getSequence() == 0; }
- void setValue(uint64_t f, uint64_t s) { first = f; second = s; }
+ void setValue(uint64_t f, uint64_t s) { first = f; second = s; agent = 0; }
bool operator==(const ObjectIdImpl& other) const;
bool operator<(const ObjectIdImpl& other) const;
Index: cpp/src/qmf/engine/ResilientConnection.cpp
===================================================================
--- cpp/src/qmf/engine/ResilientConnection.cpp (revision 886044)
+++ cpp/src/qmf/engine/ResilientConnection.cpp (working copy)
@@ -116,9 +116,9 @@
int delayMax;
int delayFactor;
qpid::sys::Condition cond;
- qpid::sys::Thread connThread;
deque<ResilientConnectionEventImpl> eventQueue;
set<RCSession::Ptr> sessions;
+ qpid::sys::Thread connThread;
};
}
}
Index: cpp/bindings/qmf/ruby/qmf.rb
===================================================================
--- cpp/bindings/qmf/ruby/qmf.rb (revision 886044)
+++ cpp/bindings/qmf/ruby/qmf.rb (working copy)
@@ -472,8 +472,7 @@
end
def ==(other)
- return (@impl.getObjectNumHi == other.impl.getObjectNumHi) &&
- (@impl.getObjectNumLo == other.impl.getObjectNumLo)
+ return @impl == other.impl
end
def to_s
Index: cpp/bindings/qmf/python/qmf.py
===================================================================
--- cpp/bindings/qmf/python/qmf.py (revision 886044)
+++ cpp/bindings/qmf/python/qmf.py (working copy)
@@ -35,7 +35,6 @@
from qmfengine import (O_EQ, O_NE, O_LT, O_LE, O_GT, O_GE, O_RE_MATCH, O_RE_NOMATCH,
E_NOT, E_AND, E_OR, E_XOR)
-
##==============================================================================
## CONNECTION
##==============================================================================
@@ -561,10 +560,8 @@
def __eq__(self, other):
if not isinstance(other, self.__class__): return False
- return (self.impl.getObjectNumHi() == other.impl.getObjectNumHi() and
- self.impl.getObjectNumLo() == other.impl.getObjectNumLo())
+ return self.impl == other.impl
-
def __ne__(self, other):
return not self.__eq__(other)
Index: cpp/bindings/qmf/tests/agent_ruby.rb
===================================================================
--- cpp/bindings/qmf/tests/agent_ruby.rb (revision 886044)
+++ cpp/bindings/qmf/tests/agent_ruby.rb (working copy)
@@ -83,7 +83,7 @@
class App < Qmf::AgentHandler
def get_query(context, query, userId)
-# puts "Query: user=#{userId} context=#{context} class=#{query.class_name} object_num=#{query.object_id.object_num_low if query.object_id}"
+# puts "Query: user=#{userId} context=#{context} class=#{query.class_name} object_num=#{query.object_id if query.object_id}"
if query.class_name == 'parent'
@agent.query_response(context, @parent)
elsif query.object_id == @parent_oid
@@ -93,7 +93,7 @@
end
def method_call(context, name, object_id, args, userId)
-# puts "Method: user=#{userId} context=#{context} method=#{name} object_num=#{object_id.object_num_low if object_id} args=#{args}"
+# puts "Method: user=#{userId} context=#{context} method=#{name} object_num=#{object_id if object_id} args=#{args}"
retCode = 0
retText = "OK"
Index: cpp/bindings/qmf/tests/ruby_console_test.rb
===================================================================
--- cpp/bindings/qmf/tests/ruby_console_test.rb (revision 886044)
+++ cpp/bindings/qmf/tests/ruby_console_test.rb (working copy)
@@ -214,9 +214,21 @@
fail("Didn't find a non-broker agent")
end
+ def test_E_filter_by_object_id
+ mgmt_exchange = @qmfc.object(:class => "exchange", 'name' => "qpid.management")
+ assert(mgmt_exchange, "No Management Exchange")
+
+ bindings = @qmfc.objects(:class => "binding", 'exchangeRef' => mgmt_exchange.object_id)
+ if bindings.size == 0
+ fail("No bindings found on management exchange")
+ end
+
+ bindings.each do |binding|
+ assert_equal(binding.exchangeRef, mgmt_exchange.object_id)
+ end
+ end
+
end
app = ConsoleTest.new
-
-
Index: cpp/bindings/qmf/tests/python_console.py
===================================================================
--- cpp/bindings/qmf/tests/python_console.py (revision 886044)
+++ cpp/bindings/qmf/tests/python_console.py (working copy)
@@ -151,6 +151,21 @@
newList = qmf.getObjects(_objectId=parent.getObjectId())
self.assertEqual(len(newList), 1)
+ def test_E_filter_by_object_id(self):
+ self.startQmf()
+ qmf = self.qmf
+
+ list = qmf.getObjects(_class="exchange", name="qpid.management")
+ self.assertEqual(len(list), 1, "No Management Exchange")
+ mgmt_exchange = list[0]
+
+ bindings = qmf.getObjects(_class="binding", exchangeRef=mgmt_exchange.getObjectId())
+ if len(bindings) == 0:
+ self.fail("No bindings found on management exchange")
+
+ for binding in bindings:
+ self.assertEqual(binding.exchangeRef, mgmt_exchange.getObjectId())
+
def getProperty(self, msg, name):
for h in msg.headers:
if hasattr(h, name): return getattr(h, name)
Index: qpidc.spec
===================================================================
RCS file: /cvs/extras/rpms/qpidc/F-12/qpidc.spec,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -p -r1.107 -r1.108
--- qpidc.spec 3 Nov 2009 15:54:22 -0000 1.107
+++ qpidc.spec 2 Dec 2009 21:48:53 -0000 1.108
@@ -12,7 +12,7 @@
Name: qpidc
Version: 0.5.%{qpid_svnrev}
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Libraries for Qpid C++ client applications
Group: System Environment/Libraries
License: ASL 2.0
@@ -22,6 +22,7 @@ Source1: rhm-0.5.%{rhm_svnrev}.tar.gz
Source2: qpidd.pp
Patch0: so_number.patch
Patch1: qmf.patch
+Patch2: bz538355.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: boost-devel
@@ -245,6 +246,7 @@ exit 0
%setup -T -D -b 1
%patch0
%patch1
+%patch2
%define perftests "perftest topic_listener topic_publisher latencytest client_test txtest"
@@ -521,6 +523,9 @@ fi
%postun -n qmf -p /sbin/ldconfig
%changelog
+* Wed Dec 2 2009 Nuno Santos <nsantos at redhat.com> - 0.5.829175-3
+- Patch for BZ538355
+
* Tue Nov 3 2009 Nuno Santos <nsantos at redhat.com> - 0.5.829175-2
- Add patch for qmf fixes
More information about the fedora-extras-commits
mailing list