You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/06/25 18:57:19 UTC
qpid-proton git commit: NO-JIRA: Fix broken ruby build. Swig changes
may require clean rebuild.
Repository: qpid-proton
Updated Branches:
refs/heads/master f2987949b -> f965610ab
NO-JIRA: Fix broken ruby build. Swig changes may require clean rebuild.
- Finished incomplete namespace change.
- Fixed swig warnings about invalid class name.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f965610a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f965610a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f965610a
Branch: refs/heads/master
Commit: f965610ab88159f5c2cdf1547e5bc0e787161555
Parents: f298794
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Jun 25 12:54:44 2015 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Jun 25 12:54:44 2015 -0400
----------------------------------------------------------------------
proton-c/bindings/ruby/lib/codec/data.rb | 16 ++---
proton-c/bindings/ruby/lib/core/message.rb | 6 +-
proton-c/bindings/ruby/lib/core/url.rb | 2 +-
.../bindings/ruby/lib/messenger/messenger.rb | 4 +-
proton-c/bindings/ruby/lib/reactor/container.rb | 2 +-
proton-c/bindings/ruby/lib/types/array.rb | 10 ++--
proton-c/bindings/ruby/lib/types/described.rb | 2 +-
proton-c/bindings/ruby/lib/types/hash.rb | 4 +-
proton-c/bindings/ruby/lib/util/wrapper.rb | 12 ++--
proton-c/bindings/ruby/ruby.i | 46 +++++++--------
.../ruby/spec/qpid/proton/array_spec.rb | 4 +-
.../bindings/ruby/spec/qpid/proton/data_spec.rb | 12 ++--
.../spec/qpid/proton/exception_handling_spec.rb | 2 +-
.../bindings/ruby/spec/qpid/proton/hash_spec.rb | 2 +-
.../ruby/spec/qpid/proton/message_spec.rb | 8 +--
.../ruby/spec/qpid/proton/messenger_spec.rb | 8 +--
proton-c/bindings/ruby/spec/spec_helper.rb | 10 ++--
tests/ruby/proton_tests/interop.rb | 62 ++++++++++----------
tests/ruby/proton_tests/smoke.rb | 2 +-
19 files changed, 107 insertions(+), 107 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/codec/data.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/codec/data.rb b/proton-c/bindings/ruby/lib/codec/data.rb
index efefa99..010177d 100644
--- a/proton-c/bindings/ruby/lib/codec/data.rb
+++ b/proton-c/bindings/ruby/lib/codec/data.rb
@@ -234,7 +234,7 @@ module Qpid::Proton::Codec
#
# @example
#
- # data = Qpid::Proton::Data.new
+ # data = Qpid::Proton::Codec::Data.new
# data.put_list
# data.enter
# data.int = 1
@@ -271,7 +271,7 @@ module Qpid::Proton::Codec
#
# @example
#
- # data = Qpid::Proton::Data.new
+ # data = Qpid::Proton::Codec::Data.new
# data.put_map
# data.enter
# data.string = "key"
@@ -324,7 +324,7 @@ module Qpid::Proton::Codec
# @example
#
# # create an array of integer values
- # data = Qpid::Proton::Data.new
+ # data = Qpid::Proton::Codec::Data.new
# data.put_array(false, INT)
# data.enter
# data.int = 1
@@ -387,7 +387,7 @@ module Qpid::Proton::Codec
#
# @example
#
- # data = Qpid::Proton::Data.new
+ # data = Qpid::Proton::Codec::Data.new
# data.put_described
# data.enter
# data.symbol = "value-descriptor"
@@ -409,7 +409,7 @@ module Qpid::Proton::Codec
type = self.type
value = type.get(self)
self.exit
- Described.new(descriptor, value)
+ Qpid::Proton::Types::Described.new(descriptor, value)
end
# Checks if the current node is a described value.
@@ -433,7 +433,7 @@ module Qpid::Proton::Codec
check(Cproton.pn_data_put_null(@data))
end
- # Utility method for Qpid::Proton::Mapping
+ # Utility method for Qpid::Proton::Codec::Mapping
#
# @private
#
@@ -772,7 +772,7 @@ module Qpid::Proton::Codec
# @data.uuid = 0 # sets to 00000000-0000-0000-0000-000000000000
#
def uuid=(value)
- raise ArgumentError, "invalid uuid: #{value}" if value.nil?
+ raise ::ArgumentError, "invalid uuid: #{value}" if value.nil?
# if the uuid that was submitted was numeric value, then translated
# it into a hex string, otherwise assume it was a string represtation
@@ -780,7 +780,7 @@ module Qpid::Proton::Codec
if value.is_a? Numeric
value = "%032x" % value
else
- raise ArgumentError, "invalid uuid: #{value}" if !valid_uuid?(value)
+ raise ::ArgumentError, "invalid uuid: #{value}" if !valid_uuid?(value)
value = (value[0, 8] +
value[9, 4] +
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/core/message.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/message.rb b/proton-c/bindings/ruby/lib/core/message.rb
index 0b89016..53e7092 100644
--- a/proton-c/bindings/ruby/lib/core/message.rb
+++ b/proton-c/bindings/ruby/lib/core/message.rb
@@ -275,7 +275,7 @@ module Qpid::Proton
# * count - the delivery count
#
def delivery_count=(count)
- raise ArgumentError.new("invalid count: #{count}") if count.nil? || !([Float, Fixnum].include?(count.class))
+ raise ::ArgumentError.new("invalid count: #{count}") if count.nil? || !([Float, Fixnum].include?(count.class))
raise RangeError.new("count out of range: #{count}") if count < 0
Cproton.pn_message_set_delivery_count(@impl, count.floor)
@@ -465,7 +465,7 @@ module Qpid::Proton
#
def expires=(time)
raise TypeError.new("invalid expiry time: #{time}") if time.nil?
- raise ArgumentError.new("expiry time cannot be negative: #{time}") if time < 0
+ raise ::ArgumentError.new("expiry time cannot be negative: #{time}") if time < 0
Cproton.pn_message_set_expiry_time(@impl, time)
end
@@ -483,7 +483,7 @@ module Qpid::Proton
#
def creation_time=(time)
raise TypeError.new("invalid time: #{time}") if time.nil?
- raise ArgumentError.new("time cannot be negative") if time < 0
+ raise ::ArgumentError.new("time cannot be negative") if time < 0
Cproton.pn_message_set_creation_time(@impl, time)
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/core/url.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/url.rb b/proton-c/bindings/ruby/lib/core/url.rb
index a68811a..1fa1222 100644
--- a/proton-c/bindings/ruby/lib/core/url.rb
+++ b/proton-c/bindings/ruby/lib/core/url.rb
@@ -34,7 +34,7 @@ module Qpid::Proton
if url
@url = Cproton.pn_url_parse(url)
if @url.nil?
- raise ArgumentError.new("invalid url: #{url}")
+ raise ::ArgumentError.new("invalid url: #{url}")
end
else
@url = Cproton.pn_url
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/messenger/messenger.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/messenger/messenger.rb b/proton-c/bindings/ruby/lib/messenger/messenger.rb
index f96a535..36bcf74 100644
--- a/proton-c/bindings/ruby/lib/messenger/messenger.rb
+++ b/proton-c/bindings/ruby/lib/messenger/messenger.rb
@@ -313,10 +313,10 @@ module Qpid::Proton::Messenger
#
def put(message)
if message.nil?
- raise Qpid::Proton::TypeError.new("invalid message: #{message}")
+ raise TypeError.new("invalid message: #{message}")
end
unless message.kind_of?(Qpid::Proton::Message)
- raise Qpid::Proton::ArgumentError.new("invalid message type: #{message.class}")
+ raise ::ArgumentError.new("invalid message type: #{message.class}")
end
# encode the message first
message.pre_encode
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/reactor/container.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/reactor/container.rb b/proton-c/bindings/ruby/lib/reactor/container.rb
index 93b49bb..2a7a030 100644
--- a/proton-c/bindings/ruby/lib/reactor/container.rb
+++ b/proton-c/bindings/ruby/lib/reactor/container.rb
@@ -90,7 +90,7 @@ module Qpid::Proton::Reactor
elsif !options[:address].nil?
connector.address = URLs.new([Qpid::Proton::URL.new(options[:address])])
else
- raise ArgumentError.new("either :url or :urls or :address required")
+ raise ::ArgumentError.new("either :url or :urls or :address required")
end
connector.heartbeat = options[:heartbeat] if !options[:heartbeat].nil?
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/types/array.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/types/array.rb b/proton-c/bindings/ruby/lib/types/array.rb
index 5677295..f5c6b50 100644
--- a/proton-c/bindings/ruby/lib/types/array.rb
+++ b/proton-c/bindings/ruby/lib/types/array.rb
@@ -57,7 +57,7 @@ class Array # :nodoc:
# Used to declare an array as an AMQP array.
#
- # The value, if defined, is an instance of Qpid::Proton::ArrayHeader
+ # The value, if defined, is an instance of Qpid::Proton::Types::ArrayHeader
attr_accessor :proton_array_header
# Returns true if the array is the a Proton described type.
@@ -84,7 +84,7 @@ class Array # :nodoc:
data.enter
each do |element|
# get the proton type for the element
- mapping = Qpid::Proton::Mapping.for_class(element.class)
+ mapping = Qpid::Proton::Codec::Mapping.for_class(element.class)
# add the element
mapping.put(data, element)
end
@@ -115,9 +115,9 @@ class Array # :nodoc:
type = data.type
- if type == Qpid::Proton::LIST
+ if type == Qpid::Proton::Codec::LIST
result = proton_get_list(data)
- elsif type == Qpid::Proton::ARRAY
+ elsif type == Qpid::Proton::Codec::ARRAY
result = proton_get_array(data)
else
raise TypeError, "element is not a list and not an array"
@@ -153,7 +153,7 @@ class Array # :nodoc:
descriptor = data.symbol
end
- elements.proton_array_header = Qpid::Proton::ArrayHeader.new(type, descriptor)
+ elements.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(type, descriptor)
(0...count).each do |which|
if data.next
etype = data.type
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/types/described.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/types/described.rb b/proton-c/bindings/ruby/lib/types/described.rb
index ca9fa24..7c09d3f 100644
--- a/proton-c/bindings/ruby/lib/types/described.rb
+++ b/proton-c/bindings/ruby/lib/types/described.rb
@@ -49,7 +49,7 @@ module Qpid::Proton::Types
end
def ==(that) # :nodoc:
- (that.is_a?(Qpid::Proton::Described) &&
+ (that.is_a?(Qpid::Proton::Types::Described) &&
(self.descriptor == that.descriptor) &&
(self.value == that.value))
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/types/hash.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/types/hash.rb b/proton-c/bindings/ruby/lib/types/hash.rb
index f2e6117..e6836d5 100644
--- a/proton-c/bindings/ruby/lib/types/hash.rb
+++ b/proton-c/bindings/ruby/lib/types/hash.rb
@@ -44,9 +44,9 @@ class Hash # :nodoc:
data.enter
each_pair do |key, value|
- type = Qpid::Proton::Mapping.for_class(key.class)
+ type = Qpid::Proton::Codec::Mapping.for_class(key.class)
type.put(data, key)
- type = Qpid::Proton::Mapping.for_class(value.class)
+ type = Qpid::Proton::Codec::Mapping.for_class(value.class)
type.put(data, value)
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/lib/util/wrapper.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/wrapper.rb b/proton-c/bindings/ruby/lib/util/wrapper.rb
index a2df413..8db1c4e 100644
--- a/proton-c/bindings/ruby/lib/util/wrapper.rb
+++ b/proton-c/bindings/ruby/lib/util/wrapper.rb
@@ -69,11 +69,11 @@ module Qpid::Proton::Util
registry_key = get_key(object.impl)
unless attachment_method.nil?
record = Cproton.__send__(attachment_method, object.impl)
- rbkey = Cproton.pn_rbkey_new
- Cproton.pn_rbkey_set_registry(rbkey, Cproton.pn_rb2void(Qpid::Proton::Util::Wrapper.registry))
- Cproton.pn_rbkey_set_method(rbkey, "delete")
- Cproton.pn_rbkey_set_key_value(rbkey, registry_key)
- Cproton.pn_record_def(record, RBCTX, Cproton.pn_rbkey__class());
+ rbkey = Cproton.Pn_rbkey_new
+ Cproton.Pn_rbkey_set_registry(rbkey, Cproton.pn_rb2void(Qpid::Proton::Util::Wrapper.registry))
+ Cproton.Pn_rbkey_set_method(rbkey, "delete")
+ Cproton.Pn_rbkey_set_key_value(rbkey, registry_key)
+ Cproton.pn_record_def(record, RBCTX, Cproton.Pn_rbkey__class());
Cproton.pn_record_set(record, RBCTX, rbkey)
end
Qpid::Proton::Util::Wrapper.registry[registry_key] = object
@@ -96,7 +96,7 @@ module Qpid::Proton::Util
rbkey = Cproton.pni_void2rbkey(Cproton.pn_record_get(record, RBCTX))
# if we don't have a key, then we don't have an object
return nil if rbkey.nil?
- registry_key = Cproton.pn_rbkey_get_key_value(rbkey)
+ registry_key = Cproton.Pn_rbkey_get_key_value(rbkey)
else
registry_key = get_key(impl)
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
index 3d4090e..4b0bff4 100644
--- a/proton-c/bindings/ruby/ruby.i
+++ b/proton-c/bindings/ruby/ruby.i
@@ -467,22 +467,22 @@ bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZ
%inline %{
-#define CID_pn_rbkey CID_pn_void
+#define CID_Pn_rbkey CID_pn_void
typedef struct {
void *registry;
char *method;
char *key_value;
-} pn_rbkey_t;
+} Pn_rbkey_t;
-void pn_rbkey_initialize(pn_rbkey_t *rbkey) {
+void Pn_rbkey_initialize(Pn_rbkey_t *rbkey) {
assert(rbkey);
rbkey->registry = NULL;
rbkey->method = NULL;
rbkey->key_value = NULL;
}
-void pn_rbkey_finalize(pn_rbkey_t *rbkey) {
+void Pn_rbkey_finalize(Pn_rbkey_t *rbkey) {
if(rbkey && rbkey->registry && rbkey->method && rbkey->key_value) {
rb_funcall((VALUE )rbkey->registry, rb_intern(rbkey->method), 1, rb_str_new2(rbkey->key_value));
}
@@ -492,45 +492,45 @@ void pn_rbkey_finalize(pn_rbkey_t *rbkey) {
}
}
-#define pn_rbkey_inspect NULL
-#define pn_rbkey_compare NULL
-#define pn_rbkey_hashcode NULL
+#define Pn_rbkey_inspect NULL
+#define Pn_rbkey_compare NULL
+#define Pn_rbkey_hashcode NULL
-PN_CLASSDEF(pn_rbkey)
+PN_CLASSDEF(Pn_rbkey)
-void pn_rbkey_set_registry(pn_rbkey_t *rbkey, void *registry) {
+void Pn_rbkey_set_registry(Pn_rbkey_t *rbkey, void *registry) {
assert(rbkey);
rbkey->registry = registry;
}
-void *pn_rbkey_get_registry(pn_rbkey_t *rbkey) {
+void *Pn_rbkey_get_registry(Pn_rbkey_t *rbkey) {
assert(rbkey);
return rbkey->registry;
}
-void pn_rbkey_set_method(pn_rbkey_t *rbkey, char *method) {
+void Pn_rbkey_set_method(Pn_rbkey_t *rbkey, char *method) {
assert(rbkey);
rbkey->method = method;
}
-char *pn_rbkey_get_method(pn_rbkey_t *rbkey) {
+char *Pn_rbkey_get_method(Pn_rbkey_t *rbkey) {
assert(rbkey);
return rbkey->method;
}
-void pn_rbkey_set_key_value(pn_rbkey_t *rbkey, char *key_value) {
+void Pn_rbkey_set_key_value(Pn_rbkey_t *rbkey, char *key_value) {
assert(rbkey);
rbkey->key_value = malloc(strlen(key_value) + 1);
strncpy(rbkey->key_value, key_value, strlen(key_value) + 1);
}
-char *pn_rbkey_get_key_value(pn_rbkey_t *rbkey) {
+char *Pn_rbkey_get_key_value(Pn_rbkey_t *rbkey) {
assert(rbkey);
return rbkey->key_value;
}
-pn_rbkey_t *pni_void2rbkey(void *object) {
- return (pn_rbkey_t *)object;
+Pn_rbkey_t *pni_void2rbkey(void *object) {
+ return (Pn_rbkey_t *)object;
}
VALUE pn_void2rb(void *object) {
@@ -580,27 +580,27 @@ int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *OUTPUT, size_t *OUTPUT_SIZE);
typedef struct {
VALUE handler_key;
- } pni_rbhandler_t;
+ } Pni_rbhandler_t;
- static pni_rbhandler_t *pni_rbhandler(pn_handler_t *handler) {
- return (pni_rbhandler_t *) pn_handler_mem(handler);
+ static Pni_rbhandler_t *pni_rbhandler(pn_handler_t *handler) {
+ return (Pni_rbhandler_t *) pn_handler_mem(handler);
}
static void pni_rbdispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
- pni_rbhandler_t *rbh = pni_rbhandler(handler);
+ Pni_rbhandler_t *rbh = pni_rbhandler(handler);
VALUE rbhandler = pni_ruby_get_from_registry(rbh->handler_key);
rb_funcall(rbhandler, rb_intern("dispatch"), 2, SWIG_NewPointerObj(event, SWIGTYPE_p_pn_event_t, 0), INT2FIX(type));
}
static void pni_rbhandler_finalize(pn_handler_t *handler) {
- pni_rbhandler_t *rbh = pni_rbhandler(handler);
+ Pni_rbhandler_t *rbh = pni_rbhandler(handler);
pni_ruby_delete_from_registry(rbh->handler_key);
}
pn_handler_t *pn_rbhandler(VALUE handler) {
- pn_handler_t *chandler = pn_handler_new(pni_rbdispatch, sizeof(pni_rbhandler_t), pni_rbhandler_finalize);
- pni_rbhandler_t *rhy = pni_rbhandler(chandler);
+ pn_handler_t *chandler = pn_handler_new(pni_rbdispatch, sizeof(Pni_rbhandler_t), pni_rbhandler_finalize);
+ Pni_rbhandler_t *rhy = pni_rbhandler(chandler);
VALUE ruby_key = rb_class_new_instance(0, NULL, rb_cObject);
pni_ruby_add_to_registry(ruby_key, handler);
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
index 3af6907..2f26fdf 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
@@ -22,7 +22,7 @@ require "spec_helper"
describe "The extended array type" do
before :each do
- @data = Qpid::Proton::Data.new
+ @data = Qpid::Proton::Codec::Data.new
@list = random_list(rand(100))
@undescribed = random_array(rand(100))
@description = random_string(128)
@@ -83,7 +83,7 @@ describe "The extended array type" do
it "raises an error when the elements of an Array are dissimilar and is put into a Data object" do
value = []
- value.proton_array_header = Qpid::Proton::ArrayHeader.new(Qpid::Proton::INT)
+ value.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT)
value << random_string(16)
expect {
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
index 2e10b8a..c8c7d18 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
@@ -26,7 +26,7 @@ module Qpid
describe "A data object" do
before :each do
- @data = Qpid::Proton::Data.new
+ @data = Qpid::Proton::Codec::Data.new
end
it "can be initialized" do
@@ -341,13 +341,13 @@ module Qpid
it "raises an error on a null UUID" do
expect {
@data.uuid = nil
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "raises an error on a malformed UUID" do
expect {
@data.uuid = random_string(36)
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "can set a UUID from an integer value" do
@@ -416,7 +416,7 @@ module Qpid
it "can hold an array" do
values = []
(1..(rand(100) + 5)).each { values << rand(2**16) }
- @data.put_array false, Qpid::Proton::INT
+ @data.put_array false, Qpid::Proton::Codec::INT
@data.enter
values.each { |value| @data.int = value }
@data.exit
@@ -432,13 +432,13 @@ module Qpid
values = []
(1..(rand(100) + 5)).each { values << random_string(64) }
descriptor = random_string(32)
- @data.put_array true, Qpid::Proton::STRING
+ @data.put_array true, Qpid::Proton::Codec::STRING
@data.enter
@data.symbol = descriptor
values.each { |value| @data.string = value }
@data.exit
- expect(@data.array).to match_array([values.size, true, Qpid::Proton::STRING])
+ expect(@data.array).to match_array([values.size, true, Qpid::Proton::Codec::STRING])
@data.enter
@data.next
expect(@data.symbol).to eq(descriptor)
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
index ccdf688..e296a69 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
@@ -22,7 +22,7 @@ module Qpid
module Proton
class ExceptionHandlingClass
- include Qpid::Proton::ExceptionHandling
+ include Qpid::Proton::Util::ErrorHandler
def error
"This is a test error: #{Time.new}"
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
index 8cf0c63..7568ac1 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
@@ -22,7 +22,7 @@ require "spec_helper"
describe "The extended hash type" do
before :each do
- @data = Qpid::Proton::Data.new
+ @data = Qpid::Proton::Codec::Data.new
@hash = random_hash(rand(128) + 64)
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
index ba33a38..36e4695 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
@@ -143,7 +143,7 @@ module Qpid
it "raises an error on a nil delivery count" do
expect {
@message.delivery_count = nil
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "raises an error on a negative delivery count" do
@@ -155,7 +155,7 @@ module Qpid
it "raises an error on a non-numeric delivery count" do
expect {
@message.delivery_count = "farkle"
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "converts a floating point delivery count to its integer portion" do
@@ -272,7 +272,7 @@ module Qpid
it "raises an error on a negative expiry time" do
expect {
@message.expires = (0-(rand(65535)))
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "can have a zero expiry time" do
@@ -295,7 +295,7 @@ module Qpid
it "raises an error on a negative creation time" do
expect {
@message.creation_time = (0 - rand(65535))
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "can have a zero creation time" do
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
index ec60fdb..8e50331 100644
--- a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
+++ b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
@@ -26,7 +26,7 @@ module Qpid
describe "A messenger" do
before (:each) do
- @messenger = Qpid::Proton::Messenger.new
+ @messenger = Qpid::Proton::Messenger::Messenger.new
end
after (:each) do
@@ -43,7 +43,7 @@ module Qpid
it "will accept an assigned name" do
name = random_string(16)
- msgr = Qpid::Proton::Messenger.new(name)
+ msgr = Qpid::Proton::Messenger::Messenger.new(name)
expect(msgr.name).to eq(name)
end
@@ -263,7 +263,7 @@ module Qpid
before (:each) do
# create a receiver
@port = 5700 + rand(1024)
- @receiver = Qpid::Proton::Messenger.new("receiver")
+ @receiver = Qpid::Proton::Messenger::Messenger.new("receiver")
@receiver.subscribe("amqp://~0.0.0.0:#{@port}")
@messenger.timeout = 0
@receiver.timeout = 0
@@ -299,7 +299,7 @@ module Qpid
it "raises an error when queueing an invalid object" do
expect {
@messenger.put("This is not a message")
- }.to raise_error(ArgumentError)
+ }.to raise_error(::ArgumentError)
end
it "can place a message in the outgoing queue" do
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/proton-c/bindings/ruby/spec/spec_helper.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/spec/spec_helper.rb b/proton-c/bindings/ruby/spec/spec_helper.rb
index aa1e346..346cb0e 100644
--- a/proton-c/bindings/ruby/spec/spec_helper.rb
+++ b/proton-c/bindings/ruby/spec/spec_helper.rb
@@ -110,13 +110,13 @@ def random_array(length, described = false, description = nil)
# create the array header
case
- when type == 0 then type = Qpid::Proton::INT
- when type == 1 then type = Qpid::Proton::STRING
- when type == 2 then type = Qpid::Proton::FLOAT
- when type == 3 then type = Qpid::Proton::UUID
+ when type == 0 then type = Qpid::Proton::Codec::INT
+ when type == 1 then type = Qpid::Proton::Codec::STRING
+ when type == 2 then type = Qpid::Proton::Codec::FLOAT
+ when type == 3 then type = Qpid::Proton::Codec::UUID
end
- result.proton_array_header = Qpid::Proton::ArrayHeader.new(type, description)
+ result.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(type, description)
return result
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/tests/ruby/proton_tests/interop.rb
----------------------------------------------------------------------
diff --git a/tests/ruby/proton_tests/interop.rb b/tests/ruby/proton_tests/interop.rb
index c1a201c..1d50483 100755
--- a/tests/ruby/proton_tests/interop.rb
+++ b/tests/ruby/proton_tests/interop.rb
@@ -13,7 +13,7 @@ if ((RUBY_VERSION.split(".").map {|x| x.to_i} <=> [1, 9]) < 0)
end
class InteropTest < Test::Unit::TestCase
- Data = Qpid::Proton::Data
+ Data = Qpid::Proton::Codec::Data
Message = Qpid::Proton::Message
def setup
@@ -59,49 +59,49 @@ class InteropTest < Test::Unit::TestCase
end
def assert_array_next(expected, header)
- assert_next(Qpid::Proton::ARRAY, expected)
+ assert_next(Qpid::Proton::Codec::ARRAY, expected)
result = @data.type.get(@data)
assert_equal(result.proton_array_header, header)
end
def test_message
decode_message_file("message")
- assert_next(Qpid::Proton::STRING, "hello")
+ assert_next(Qpid::Proton::Codec::STRING, "hello")
assert !@data.next
end
def test_primitives
decode_data_file("primitives")
- assert_next(Qpid::Proton::BOOL, true)
- assert_next(Qpid::Proton::BOOL, false)
- assert_next(Qpid::Proton::UBYTE, 42)
- assert_next(Qpid::Proton::USHORT, 42)
- assert_next(Qpid::Proton::SHORT, -42)
- assert_next(Qpid::Proton::UINT, 12345)
- assert_next(Qpid::Proton::INT, -12345)
- assert_next(Qpid::Proton::ULONG, 12345)
- assert_next(Qpid::Proton::LONG, -12345)
- assert_next(Qpid::Proton::FLOAT, 0.125)
- assert_next(Qpid::Proton::DOUBLE, 0.125)
+ assert_next(Qpid::Proton::Codec::BOOL, true)
+ assert_next(Qpid::Proton::Codec::BOOL, false)
+ assert_next(Qpid::Proton::Codec::UBYTE, 42)
+ assert_next(Qpid::Proton::Codec::USHORT, 42)
+ assert_next(Qpid::Proton::Codec::SHORT, -42)
+ assert_next(Qpid::Proton::Codec::UINT, 12345)
+ assert_next(Qpid::Proton::Codec::INT, -12345)
+ assert_next(Qpid::Proton::Codec::ULONG, 12345)
+ assert_next(Qpid::Proton::Codec::LONG, -12345)
+ assert_next(Qpid::Proton::Codec::FLOAT, 0.125)
+ assert_next(Qpid::Proton::Codec::DOUBLE, 0.125)
assert !@data.next
end
def test_strings
decode_data_file("strings")
- assert_next(Qpid::Proton::BINARY, "abc\0defg")
- assert_next(Qpid::Proton::STRING, "abcdefg")
- assert_next(Qpid::Proton::SYMBOL, "abcdefg")
- assert_next(Qpid::Proton::BINARY, "")
- assert_next(Qpid::Proton::STRING, "")
- assert_next(Qpid::Proton::SYMBOL, "")
+ assert_next(Qpid::Proton::Codec::BINARY, "abc\0defg")
+ assert_next(Qpid::Proton::Codec::STRING, "abcdefg")
+ assert_next(Qpid::Proton::Codec::SYMBOL, "abcdefg")
+ assert_next(Qpid::Proton::Codec::BINARY, "")
+ assert_next(Qpid::Proton::Codec::STRING, "")
+ assert_next(Qpid::Proton::Codec::SYMBOL, "")
assert !@data.next
end
def test_described
decode_data_file("described")
- assert_next(Qpid::Proton::DESCRIBED, Qpid::Proton::Described.new("foo-descriptor", "foo-value"))
+ assert_next(Qpid::Proton::Codec::DESCRIBED, Qpid::Proton::Types::Described.new("foo-descriptor", "foo-value"))
assert(@data.described?)
- assert_next(Qpid::Proton::DESCRIBED, Qpid::Proton::Described.new(12, 13))
+ assert_next(Qpid::Proton::Codec::DESCRIBED, Qpid::Proton::Types::Described.new(12, 13))
assert(@data.described?)
assert !@data.next
end
@@ -109,33 +109,33 @@ class InteropTest < Test::Unit::TestCase
def test_described_array
decode_data_file("described_array")
assert_array_next((0...10).to_a,
- Qpid::Proton::ArrayHeader.new(Qpid::Proton::INT,
+ Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT,
"int-array"))
end
def test_arrays
decode_data_file("arrays")
assert_array_next((0...100).to_a,
- Qpid::Proton::ArrayHeader.new(Qpid::Proton::INT))
+ Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT))
assert_array_next(["a", "b", "c"],
- Qpid::Proton::ArrayHeader.new(Qpid::Proton::STRING))
+ Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::STRING))
assert_array_next([],
- Qpid::Proton::ArrayHeader.new(Qpid::Proton::INT))
+ Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT))
assert !@data.next
end
def test_lists
decode_data_file("lists")
- assert_next(Qpid::Proton::LIST, [32, "foo", true])
- assert_next(Qpid::Proton::LIST, [])
+ assert_next(Qpid::Proton::Codec::LIST, [32, "foo", true])
+ assert_next(Qpid::Proton::Codec::LIST, [])
assert !@data.next
end
def test_maps
decode_data_file("maps")
- assert_next(Qpid::Proton::MAP, {"one" => 1, "two" => 2, "three" => 3 })
- assert_next(Qpid::Proton::MAP, {1 => "one", 2 => "two", 3 => "three"})
- assert_next(Qpid::Proton::MAP, {})
+ assert_next(Qpid::Proton::Codec::MAP, {"one" => 1, "two" => 2, "three" => 3 })
+ assert_next(Qpid::Proton::Codec::MAP, {1 => "one", 2 => "two", 3 => "three"})
+ assert_next(Qpid::Proton::Codec::MAP, {})
assert !@data.next
end
end
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f965610a/tests/ruby/proton_tests/smoke.rb
----------------------------------------------------------------------
diff --git a/tests/ruby/proton_tests/smoke.rb b/tests/ruby/proton_tests/smoke.rb
old mode 100644
new mode 100755
index b9265e8..5fc990a
--- a/tests/ruby/proton_tests/smoke.rb
+++ b/tests/ruby/proton_tests/smoke.rb
@@ -5,7 +5,7 @@ require 'qpid_proton'
class SmokeTest < Test::Unit::TestCase
- Messenger = Qpid::Proton::Messenger
+ Messenger = Qpid::Proton::Messenger::Messenger
Message = Qpid::Proton::Message
def setup
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org