summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf/ruby
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-09-21 16:24:38 +0000
committerTed Ross <tross@apache.org>2009-09-21 16:24:38 +0000
commit4c9e6b30e9410cb32367be87ca9bbf941df750dc (patch)
treeb64a637ec4e4edf0c5240d0cfcc9b006f42b486c /cpp/bindings/qmf/ruby
parenta5283e144f9107e3e735379ddd68d8d29e9fdb53 (diff)
downloadqpid-python-4c9e6b30e9410cb32367be87ca9bbf941df750dc.tar.gz
Added Ruby test infrastructure and Console tests in Ruby
Fixed issues identified by the new tests: - Improper formatting of object-id in get-query - Remote (non-broker-resident) agents not visible to the console - object.update() and object.merge() not implemented git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@817312 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf/ruby')
-rw-r--r--cpp/bindings/qmf/ruby/qmf.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb
index 4a4c863521..cba9759135 100644
--- a/cpp/bindings/qmf/ruby/qmf.rb
+++ b/cpp/bindings/qmf/ruby/qmf.rb
@@ -402,13 +402,18 @@ module Qmf
end
def update()
+ raise "No linkage to broker" unless @broker
+ newer = @broker.console.get_objects(Query.new(:object_id => object_id))
+ raise "Expected exactly one update for this object" unless newer.size == 1
+ mergeUpdate(newer[0])
end
def mergeUpdate(newObject)
+ @impl.merge(newObject.impl)
end
def deleted?()
- @delete_time > 0
+ @impl.isDeleted
end
def index()
@@ -523,7 +528,11 @@ module Qmf
@impl.getException
end
- def arguments
+ def text
+ exception.asString
+ end
+
+ def args
Arguments.new(@impl.getArgs)
end
end
@@ -542,13 +551,13 @@ module Qmf
if kwargs.include?(:key)
@impl = Qmfengine::Query.new(kwargs[:key])
elsif kwargs.include?(:object_id)
- @impl = Qmfengine::Query.new(kwargs[:object_id])
+ @impl = Qmfengine::Query.new(kwargs[:object_id].impl)
else
package = kwargs[:package] if kwargs.include?(:package)
if kwargs.include?(:class)
@impl = Qmfengine::Query.new(kwargs[:class], package)
else
- raise ArgumentError, "Invalid arguments, use :key or :class[,:package]"
+ raise ArgumentError, "Invalid arguments, use :key, :object_id or :class[,:package]"
end
end
end
@@ -930,7 +939,7 @@ module Qmf
class Broker < ConnectionHandler
include MonitorMixin
- attr_reader :impl, :conn
+ attr_reader :impl, :conn, :console
def initialize(console, conn)
super()