You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2017/01/10 15:58:36 UTC

[15/55] [partial] qpid-proton-j git commit: PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/error_handler.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/error_handler.rb b/proton-c/bindings/ruby/lib/util/error_handler.rb
deleted file mode 100644
index da51214..0000000
--- a/proton-c/bindings/ruby/lib/util/error_handler.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides mixin functionality for dealing with exception conditions.
-  #
-  # @private
-  module ErrorHandler
-
-    def self.included(base)
-      base.extend(self)
-
-      unless defined? base.to_be_wrapped
-        class << base
-          @@to_be_wrapped = []
-        end
-      end
-
-      define_method :method_added do |name|
-        if (!@@to_be_wrapped.nil?) && (@@to_be_wrapped.include? name)
-          @@to_be_wrapped.delete name
-          create_exception_handler_wrapper(name)
-        end
-      end
-    end
-
-    def can_raise_error(method_names, options = {})
-      error_class = options[:error_class]
-      below = options[:below] || 0
-      # coerce the names to be an array
-      Array(method_names).each do |method_name|
-        # if the method doesn't already exist then queue this aliasing
-        unless self.method_defined? method_name
-          @@to_be_wrapped ||= []
-          @@to_be_wrapped << method_name
-        else
-          create_exception_handler_wrapper(method_name, error_class, below)
-        end
-      end
-    end
-
-    def create_exception_handler_wrapper(method_name, error_class = nil, below = 0)
-      original_method_name = method_name.to_s
-      wrapped_method_name = "_excwrap_#{original_method_name}"
-      alias_method wrapped_method_name, original_method_name
-      define_method original_method_name do |*args, &block|
-        # need to get a reference to the method object itself since
-        # calls to Class.send interfere with Messenger.send
-        method = self.method(wrapped_method_name.to_sym)
-        rc = method.call(*args, &block)
-        check_for_error(rc, error_class) if rc < below
-        return rc
-      end
-    end
-
-    # Raises an Proton-specific error if a return code is non-zero.
-    #
-    # Expects the class to provide an +error+ method.
-    def check_for_error(code, error_class = nil)
-
-      raise ::ArgumentError.new("Invalid error code: #{code}") if code.nil?
-
-      return code if code > 0
-
-      case(code)
-
-      when Qpid::Proton::Error::NONE
-        return
-
-      when Qpid::Proton::Error::EOS
-        raise Qpid::Proton::EOSError.new(self.error)
-
-      when Qpid::Proton::Error::ERROR
-        raise Qpid::Proton::ProtonError.new(self.error)
-
-      when Qpid::Proton::Error::OVERFLOW
-        raise Qpid::Proton::OverflowError.new(self.error)
-
-      when Qpid::Proton::Error::UNDERFLOW
-        raise Qpid::Proton::UnderflowError.new(self.error)
-
-      when Qpid::Proton::Error::ARGUMENT
-        raise Qpid::Proton::ArgumentError.new(self.error)
-
-      when Qpid::Proton::Error::STATE
-        raise Qpid::Proton::StateError.new(self.error)
-
-      when Qpid::Proton::Error::TIMEOUT
-        raise Qpid::Proton::TimeoutError.new(self.error)
-
-      when Qpid::Proton::Error::INPROGRESS
-        return
-
-      when Qpid::Proton::Error::INTERRUPTED
-        raise Qpid::Proton::InterruptedError.new(self.error)
-
-      when Qpid::Proton::Error::INPROGRESS
-        raise Qpid::Proton::InProgressError.new(self.error)
-
-      else
-
-        raise ::ArgumentError.new("Unknown error code: #{code}")
-
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/handler.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/handler.rb b/proton-c/bindings/ruby/lib/util/handler.rb
deleted file mode 100644
index e7d07b1..0000000
--- a/proton-c/bindings/ruby/lib/util/handler.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # @private
-  module Handler
-
-    def chandler(handler, on_error)
-      return nil if handler.nil?
-
-      if handler.instance_of?(Qpid::Proton::Handler::WrappedHandler)
-        impl = handler.impl
-        Cproton.pn_incref(impl)
-        return impl
-      else
-        cadaptor = Qpid::Proton::Handler::CAdaptor.new(handler, on_error)
-        rbhandler = Cproton.pn_rbhandler(cadaptor)
-        return rbhandler
-      end
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/reactor.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/reactor.rb b/proton-c/bindings/ruby/lib/util/reactor.rb
deleted file mode 100644
index 0bcb557..0000000
--- a/proton-c/bindings/ruby/lib/util/reactor.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  module Reactor
-
-    def create_session(connection, handler = nil)
-      session = connection.session
-      session.open
-      return session
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/swig_helper.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/swig_helper.rb b/proton-c/bindings/ruby/lib/util/swig_helper.rb
deleted file mode 100644
index d60e9e4..0000000
--- a/proton-c/bindings/ruby/lib/util/swig_helper.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides helper functions for writing wrapper functions for the
-  # underlying C APIs.
-  #
-  # Before defining any mutators the class must define the name of the
-  # prefix for methods with the constant PROTON_METOD_PREFIX.
-  #
-  # == Mutators, Setters And Getters
-  #
-  # There are three types of wrappers that are supported:
-  #
-  # [proton_writer] Defines a set-only method for the named attribute.
-  # [proton_reader] Defines a get-only method for the named attribute.
-  # [proton_accessor] Defines both a set- and a get-method for the named
-  #                  attribute.
-  # [proton_caller] A simple wrapper for calling an underlying method,
-  #                  avoids repetitive boiler plate coding.
-  #
-  # == Arguments
-  #
-  # [:is_or_get => {:is, :get}] For both the getter and the mutator types
-  # you can also declare that the method uses "is" instead of "get" in the
-  # underlying API. Such methods are then defined with "?"
-  #
-  # @example
-  #   class Terminus
-  #
-  #     include WrapperHelper
-  #
-  #     PROTON_METHOD_PREFIX = "pn_terminus"
-  #
-  #     # add methods "type" and "type=" that call "pn_terminus_{get,set}_type"
-  #     proton_accessor :type
-  #
-  #     # adds the method "dynamic?" that calls "pn_terminus_is_dynamic"
-  #     proton_accessor :dynamic, :is_or_get => :is
-  #
-  #     # adds a method named "foo" that calls "pn_terminus_foo"
-  #     proton_caller :foo
-  #
-  #   end
-  #
-  # @private
-  module SwigHelper
-
-    def self.included(base)
-      base.extend ClassMethods
-    end
-
-    module ClassMethods # :nodoc:
-
-      def create_wrapper_method(name, proton_method, with_arg = false)
-        if with_arg
-          define_method "#{name}" do |arg|
-            Cproton.__send__(proton_method.to_sym, @impl, arg)
-          end
-        else
-          define_method "#{name}" do
-            Cproton.__send__(proton_method.to_sym, @impl)
-          end
-        end
-      end
-
-      # Defines a method that calls an underlying C library function.
-      def proton_caller(name, options = {})
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_#{name}"
-        # drop the trailing '?' if this is a property method
-        proton_method = proton_method[0..-2] if proton_method.end_with? "?"
-        create_wrapper_method(name, proton_method)
-      end
-
-      def proton_writer(name, options = {})
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_set_#{name}"
-        create_wrapper_method("#{name}=", proton_method, true)
-      end
-
-      def proton_reader(name, options = {})
-        an_is_method = options[:is_or_get] == :is
-        prefix = (an_is_method) ? "is" : "get"
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_#{prefix}_#{name}"
-        name = "#{name}?" if an_is_method
-        create_wrapper_method(name, proton_method)
-      end
-
-      def proton_accessor(name, options = {})
-        proton_writer(name, options)
-        proton_reader(name, options)
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/timeout.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/timeout.rb b/proton-c/bindings/ruby/lib/util/timeout.rb
deleted file mode 100644
index f4647f5..0000000
--- a/proton-c/bindings/ruby/lib/util/timeout.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides methods for converting between milliseconds, seconds
-  # and timeout values.
-  #
-  # @private
-  module Timeout
-
-    def sec_to_millis(s)
-      return (s * 1000).to_int
-    end
-
-    def millis_to_sec(ms)
-      return (ms.to_f / 1000.0).to_int
-    end
-
-    def timeout_to_millis(s)
-      return Cproton::PN_MILLIS_MAX if s.nil?
-
-      return sec_to_millis(s)
-    end
-
-    def millis_to_timeout(ms)
-      return nil if ms == Cproton::PN_MILLIS_MAX
-
-      return millis_to_sec(ms)
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/uuid.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/uuid.rb b/proton-c/bindings/ruby/lib/util/uuid.rb
deleted file mode 100644
index 882715b..0000000
--- a/proton-c/bindings/ruby/lib/util/uuid.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  module UUID
-
-    def generate_uuid
-      # generate a UUID based on what APIs are available with the current
-      # version of Ruby
-      SecureRandom.uuid
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/lib/util/version.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/version.rb b/proton-c/bindings/ruby/lib/util/version.rb
deleted file mode 100644
index f9962ba..0000000
--- a/proton-c/bindings/ruby/lib/util/version.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # The major version for the underlying Proton library.
-  # @private
-  VERSION_MAJOR = Cproton::PN_VERSION_MAJOR
-
-  # The minor version for the underlying Proton library.
-  # @private
-  VERSION_MINOR = Cproton::PN_VERSION_MINOR
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index 8db1c4e..0000000
--- a/proton-c/bindings/ruby/lib/util/wrapper.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-#--
-# 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.
-#++
-
-module Qpid::Proton::Util
-
-  # @private
-  module Wrapper
-
-    # @private
-    def impl=(impl)
-      @impl = impl
-    end
-
-    # @private
-    def impl
-      @impl
-    end
-
-    def self.registry
-      @registry ||= {}
-    end
-
-    def self.included(base)
-      base.extend(ClassMethods)
-    end
-
-    # Adds methods to the target class for storing and retrieving pure Ruby
-    # wrappers to underlying Proton structures.
-    #
-    # Such wrappers are stored in a registry using a key. The key is then
-    # attached to the Proton structure as a record. That record lives for as
-    # long as the Proton structure lives, and when the structure is released
-    # the record acts as hook to also delete the Ruby wrapper object from the
-    # registry.
-    #
-    # @private
-    #
-    module ClassMethods
-
-      # @private
-      def get_key(impl)
-        ("%032x" % Cproton.pni_address_of(impl))
-      end
-
-      # Stores the given object for later retrieval.
-      #
-      # @param object [Object] The object.
-      # @param attachment_method [Symbol] The Proton attachment method.
-      #
-      def store_instance(object, attachment_method = nil)
-        # ensure the impl has a reference to the wrapper object
-        object.impl.instance_eval { @proton_wrapper = object }
-        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());
-          Cproton.pn_record_set(record, RBCTX, rbkey)
-        end
-        Qpid::Proton::Util::Wrapper.registry[registry_key] = object
-      end
-
-      # Retrieves the wrapper object with the supplied Proton struct.
-      #
-      # @param impl [Object] The wrapper for the Proton struct.
-      # @param attachment_method [Symbol] The Proton attachment method.
-      #
-      # @return [Object] The Ruby wrapper object.
-      #
-      def fetch_instance(impl, attachment_method = nil)
-        # if the impl has a wrapper already attached, then return it
-        if impl.instance_variable_defined?(:@proton_wrapper)
-          return impl.instance_variable_get(:@proton_wrapper)
-        end
-        unless attachment_method.nil?
-          record = Cproton.__send__(attachment_method, impl)
-          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)
-        else
-          registry_key = get_key(impl)
-        end
-        # if the object's not in the registry then return
-        return nil unless Qpid::Proton::Util::Wrapper.registry.has_key?(registry_key)
-
-        result = Qpid::Proton::Util::Wrapper.registry[registry_key]
-        # result = nil unless result.weakref_alive?
-        if result.nil?
-          raise Qpid::Proton::ProtonError.new("missing object for key=#{registry_key}")
-        else
-          # update the impl since the Swig wrapper for it may have changed
-          result.impl = impl
-        end
-        return result
-      end
-
-    end
-
-  end
-
-  # @private
-  RBCTX = Wrapper.hash.to_i
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/qpid_proton.gemspec
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/qpid_proton.gemspec b/proton-c/bindings/ruby/qpid_proton.gemspec
deleted file mode 100644
index 1acaff1..0000000
--- a/proton-c/bindings/ruby/qpid_proton.gemspec
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- encoding: utf-8 -*-
-lib = File.expand_path('lib/', __FILE__)
-$:.unshift lib unless $:.include?(lib)
-
-# Generate the Swig wrapper
-system "swig -ruby -I/usr/include -o ext/cproton/cproton.c ruby.i"
-
-Gem::Specification.new do |s|
-  s.name        = "qpid_proton"
-  s.version     = "0.3"
-  s.licenses    = ['Apache-2.0']
-  s.platform    = Gem::Platform::RUBY
-  s.authors     = ["Darryl L. Pierce"]
-  s.email       = ["proton@qpid.apache.org"]
-  s.homepage    = "http://qpid.apache.org/proton"
-  s.summary     = "Ruby language bindings for the Qpid Proton messaging framework"
-  s.description = <<-EOF
-Proton is a high performance, lightweight messaging library. It can be used in
-the widest range of messaging applications including brokers, client libraries,
-routers, bridges, proxies, and more. Proton is based on the AMQP 1.0 messaging
-standard.
-EOF
-
-  s.extensions   = "ext/cproton/extconf.rb"
-  s.files        = Dir[
-                "LICENSE",
-                "TODO",
-                "ChangeLog",
-                "ext/cproton/*.rb",
-                "ext/cproton/*.c",
-                "lib/**/*.rb",
-                ]
-  s.require_path = 'lib'
-  s.add_runtime_dependency "json"
-end
-

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
deleted file mode 100644
index d5979f3..0000000
--- a/proton-c/bindings/ruby/ruby.i
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- * 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.
- */
-%module cproton
-
-%{
-#include <proton/engine.h>
-#include <proton/message.h>
-#include <proton/sasl.h>
-#include <proton/messenger.h>
-#include <proton/ssl.h>
-#include <proton/types.h>
-#include <proton/url.h>
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-%}
-
-/*
-NOTE: According to ccache-swig man page: "Known problems are using
-preprocessor directives within %inline blocks and the use of \u2019#pragma SWIG\u2019."
-This includes using macros in an %inline section.
-
-Keep preprocessor directives and macro expansions in the normal header section.
-*/
-
-%include <cstring.i>
-
-%cstring_output_withsize(char *OUTPUT, size_t *OUTPUT_SIZE)
-%cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1));
-%cstring_output_maxsize(char *OUTPUT, size_t MAX_OUTPUT_SIZE)
-
-%{
-#if !defined(RSTRING_LEN)
-#  define RSTRING_LEN(x) (RSTRING(X)->len)
-#  define RSTRING_PTR(x) (RSTRING(x)->ptr)
-#endif
-%}
-
-%typemap(in) pn_bytes_t {
-  if ($input == Qnil) {
-    $1.start = NULL;
-    $1.size = 0;
-  } else {
-    $1.start = RSTRING_PTR($input);
-    if (!$1.start) {
-      $1.size = 0;
-    }
-    $1.size = RSTRING_LEN($input);
-  }
-}
-
-%typemap(out) pn_bytes_t {
-  $result = rb_str_new($1.start, $1.size);
-}
-
-%typemap(in) pn_atom_t
-{
-  if ($input == Qnil)
-    {
-      $1.type = PN_NULL;
-    }
-  else
-    {
-      switch(TYPE($input))
-        {
-        case T_TRUE:
-          $1.type = PN_BOOL;
-          $1.u.as_bool = true;
-          break;
-
-        case T_FALSE:
-          $1.type = PN_BOOL;
-          $1.u.as_bool = false;
-          break;
-
-        case T_FLOAT:
-          $1.type = PN_FLOAT;
-          $1.u.as_float = NUM2DBL($input);
-          break;
-
-        case T_STRING:
-          $1.type = PN_STRING;
-          $1.u.as_bytes.start = RSTRING_PTR($input);
-          if ($1.u.as_bytes.start)
-            {
-              $1.u.as_bytes.size = RSTRING_LEN($input);
-            }
-          else
-            {
-              $1.u.as_bytes.size = 0;
-            }
-          break;
-
-        case T_FIXNUM:
-          $1.type = PN_INT;
-          $1.u.as_int = FIX2LONG($input);
-          break;
-
-        case T_BIGNUM:
-          $1.type = PN_LONG;
-          $1.u.as_long = NUM2LL($input);
-          break;
-
-        }
-    }
-}
-
-%typemap(out) pn_atom_t
-{
-  switch($1.type)
-    {
-    case PN_NULL:
-      $result = Qnil;
-      break;
-
-    case PN_BOOL:
-      $result = $1.u.as_bool ? Qtrue : Qfalse;
-      break;
-
-    case PN_BYTE:
-      $result = INT2NUM($1.u.as_byte);
-      break;
-
-    case PN_UBYTE:
-      $result = UINT2NUM($1.u.as_ubyte);
-      break;
-
-    case PN_SHORT:
-      $result = INT2NUM($1.u.as_short);
-      break;
-
-    case PN_USHORT:
-      $result = UINT2NUM($1.u.as_ushort);
-      break;
-
-    case PN_INT:
-      $result = INT2NUM($1.u.as_int);
-      break;
-
-     case PN_UINT:
-      $result = UINT2NUM($1.u.as_uint);
-      break;
-
-    case PN_LONG:
-      $result = LL2NUM($1.u.as_long);
-      break;
-
-    case PN_ULONG:
-      $result = ULL2NUM($1.u.as_ulong);
-      break;
-
-    case PN_FLOAT:
-      $result = rb_float_new($1.u.as_float);
-      break;
-
-    case PN_DOUBLE:
-      $result = rb_float_new($1.u.as_double);
-      break;
-
-    case PN_STRING:
-      $result = rb_str_new($1.u.as_bytes.start, $1.u.as_bytes.size);
-      break;
-
-    default:
-       break;
-    }
-}
-
-%typemap (in) pn_decimal32_t
-{
-  $1 = FIX2UINT($input);
-}
-
-%typemap (out) pn_decimal32_t
-{
-  $result = ULL2NUM($1);
-}
-
-%typemap (in) pn_decimal64_t
-{
-  $1 = NUM2ULL($input);
-}
-
-%typemap (out) pn_decimal64_t
-{
-  $result = ULL2NUM($1);
-}
-
-%typemap (in) pn_decimal128_t
-{
-  int index;
-
-  for(index = 0; index < 16; index++)
-    {
-      VALUE element = rb_ary_entry($input, index);
-      $1.bytes[16 - (index + 1)] = FIX2INT(element);
-    }
-}
-
-%typemap (out) pn_decimal128_t
-{
-  int index;
-
-  $result = rb_ary_new2(16);
-  for(index = 0; index < 16; index++)
-    {
-      rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index]));
-    }
-}
-
-%typemap (in) pn_uuid_t
-{
-  int index;
-
-  for(index = 0; index < 16; index++)
-    {
-      VALUE element = rb_ary_entry($input, index);
-      $1.bytes[16 - (index + 1)] = FIX2INT(element);
-    }
-}
-
-%typemap (out) pn_uuid_t
-{
-  int index;
-
-  $result = rb_ary_new2(16);
-  for(index = 0; index < 16; index++)
-    {
-      rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index]));
-    }
-}
-
-int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_encode;
-
-ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_link_send;
-
-%rename(pn_link_recv) wrap_pn_link_recv;
-%inline %{
-  int wrap_pn_link_recv(pn_link_t *link, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_link_recv(link, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_link_recv;
-
-ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_transport_input;
-
-%rename(pn_transport_output) wrap_pn_transport_output;
-%inline %{
-  int wrap_pn_transport_output(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_output(transport, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_output;
-
-%rename(pn_transport_peek) wrap_pn_transport_peek;
-%inline %{
-  int wrap_pn_transport_peek(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_peek(transport, OUTPUT, *OUTPUT_SIZE);
-    if(sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_peek;
-
-%rename(pn_delivery) wrap_pn_delivery;
-%inline %{
-  pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {
-    return pn_delivery(link, pn_dtag(STRING, LENGTH));
-  }
-%}
-%ignore pn_delivery;
-
-// Suppress "Warning(451): Setting a const char * variable may leak memory." on pn_delivery_tag_t
-%warnfilter(451) pn_delivery_tag_t;
-%rename(pn_delivery_tag) wrap_pn_delivery_tag;
-%inline %{
-  void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) {
-    pn_delivery_tag_t tag = pn_delivery_tag(delivery);
-    *ALLOC_OUTPUT = malloc(tag.size);
-    *ALLOC_SIZE = tag.size;
-    memcpy(*ALLOC_OUTPUT, tag.start, tag.size);
-  }
-%}
-%ignore pn_delivery_tag;
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_cipher_name;
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_protocol_name;
-
-%inline %{
-#if defined(RUBY20) || defined(RUBY21)
-
-  typedef void *non_blocking_return_t;
-#define RB_BLOCKING_CALL rb_thread_call_without_gvl
-
-#elif defined(RUBY19)
-
-    typedef VALUE non_blocking_return_t;
-#define RB_BLOCKING_CALL rb_thread_blocking_region
-
-#endif
-  %}
-
-%rename(pn_messenger_send) wrap_pn_messenger_send;
-%rename(pn_messenger_recv) wrap_pn_messenger_recv;
-%rename(pn_messenger_work) wrap_pn_messenger_work;
-
-%inline %{
-
-#if defined(RB_BLOCKING_CALL)
-
-    static non_blocking_return_t pn_messenger_send_no_gvl(void *args) {
-    VALUE result = Qnil;
-    pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-    int *limit = (int *)((void **)args)[1];
-
-    int rc = pn_messenger_send(messenger, *limit);
-
-    result = INT2NUM(rc);
-    return (non_blocking_return_t )result;
-    }
-
-    static non_blocking_return_t pn_messenger_recv_no_gvl(void *args) {
-    VALUE result = Qnil;
-    pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-    int *limit = (int *)((void **)args)[1];
-
-    int rc = pn_messenger_recv(messenger, *limit);
-
-    result = INT2NUM(rc);
-    return (non_blocking_return_t )result;
-  }
-
-    static non_blocking_return_t pn_messenger_work_no_gvl(void *args) {
-      VALUE result = Qnil;
-      pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-      int *timeout = (int *)((void **)args)[1];
-
-      int rc = pn_messenger_work(messenger, *timeout);
-
-      result = INT2NUM(rc);
-      return (non_blocking_return_t )result;
-    }
-
-#endif
-
-  int wrap_pn_messenger_send(pn_messenger_t *messenger, int limit) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-
-    // only release the gil if we're blocking
-    if(pn_messenger_is_blocking(messenger)) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &limit;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_send_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-    }
-
-#else // !defined(RB_BLOCKING_CALL)
-    result = pn_messenger_send(messenger, limit);
-#endif // defined(RB_BLOCKING_CALL)
-
-    return result;
-  }
-
-  int wrap_pn_messenger_recv(pn_messenger_t *messenger, int limit) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-    // only release the gil if we're blocking
-    if(pn_messenger_is_blocking(messenger)) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &limit;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_recv_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-
-    } else {
-      result = pn_messenger_recv(messenger, limit);
-    }
-#else // !defined(RB_BLOCKING_CALL)
-    result = pn_messenger_recv(messenger, limit);
-#endif // defined(RB_BLOCKING_CALL)
-
-      return result;
-  }
-
-  int wrap_pn_messenger_work(pn_messenger_t *messenger, int timeout) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-    // only release the gil if we're blocking
-    if(timeout) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &timeout;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_work_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-    } else {
-      result = pn_messenger_work(messenger, timeout);
-    }
-#else
-    result = pn_messenger_work(messenger, timeout);
-#endif
-
-    return result;
-  }
-
-%}
-
-%ignore pn_messenger_send;
-%ignore pn_messenger_recv;
-%ignore pn_messenger_work;
-
-%{
-typedef struct Pn_rbkey_t {
-  void *registry;
-  char *method;
-  char *key_value;
-} Pn_rbkey_t;
-
-void Pn_rbkey_initialize(void *vp_rbkey) {
-  Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_rbkey;
-  assert(rbkey);
-  rbkey->registry = NULL;
-  rbkey->method = NULL;
-  rbkey->key_value = NULL;
-}
-
-void Pn_rbkey_finalize(void *vp_rbkey) {
-  Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_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));
-  }
-  if(rbkey->key_value) {
-    free(rbkey->key_value);
-    rbkey->key_value = NULL;
-  }
-}
-
-/* NOTE: no macro or preprocessor definitions in %inline sections */
-#define CID_Pn_rbkey CID_pn_void
-#define Pn_rbkey_inspect NULL
-#define Pn_rbkey_compare NULL
-#define Pn_rbkey_hashcode NULL
-
-pn_class_t* Pn_rbkey__class(void) {
-    static pn_class_t clazz = PN_CLASS(Pn_rbkey);
-    return &clazz;
-}
-
-Pn_rbkey_t *Pn_rbkey_new(void) {
-    return (Pn_rbkey_t *) pn_class_new(Pn_rbkey__class(), sizeof(Pn_rbkey_t));
-}
-%}
-
-pn_class_t* Pn_rbkey__class(void);
-Pn_rbkey_t *Pn_rbkey_new(void);
-
-%inline %{
-
-Pn_rbkey_t *Pn_rbkey_new(void);
-
-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) {
-  assert(rbkey);
-  return rbkey->registry;
-}
-
-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) {
-  assert(rbkey);
-  return rbkey->method;
-}
-
-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) {
-  assert(rbkey);
-  return rbkey->key_value;
-}
-
-Pn_rbkey_t *pni_void2rbkey(void *object) {
-  return (Pn_rbkey_t *)object;
-}
-
-VALUE pn_void2rb(void *object) {
-  return (VALUE )object;
-}
-
-void *pn_rb2void(VALUE object) {
-  return (void *)object;
-}
-
-VALUE pni_address_of(void *object) {
-  return ULL2NUM((unsigned long )object);
-}
-
-%}
-
-//%rename(pn_collector_put) wrap_pn_collector_put;
-//%inline %{
-//  pn_event_t *wrap_pn_collector_put(pn_collector_t *collector, void *context,
-//                               pn_event_type_t type) {
-//    return pn_collector_put(collector, PN_RBREF, context, type);
-//  }
-//  %}
-//%ignore pn_collector_put;
-
-int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_ssl_get_peer_hostname;
-
-%inline %{
-
-  VALUE pni_ruby_get_proton_module() {
-    VALUE mQpid = rb_define_module("Qpid");
-    return rb_define_module_under(mQpid, "Proton");
-  }
-
-  void pni_ruby_add_to_registry(VALUE key, VALUE value) {
-    VALUE result = rb_funcall(pni_ruby_get_proton_module(), rb_intern("add_to_registry"), 2, key, value);
-  }
-
-  VALUE pni_ruby_get_from_registry(VALUE key) {
-     return rb_funcall(pni_ruby_get_proton_module(), rb_intern("get_from_registry"), 1, key);
-  }
-
-  void pni_ruby_delete_from_registry(VALUE stored_key) {
-    rb_funcall(pni_ruby_get_proton_module(), rb_intern("delete_from_registry"), 1, stored_key);
-  }
-
-  typedef struct {
-    VALUE handler_key;
-  } Pni_rbhandler_t;
-
-  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);
-    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_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);
-
-    VALUE ruby_key = rb_class_new_instance(0, NULL, rb_cObject);
-    pni_ruby_add_to_registry(ruby_key, handler);
-
-    rhy->handler_key = ruby_key;
-
-    return chandler;
-  }
-
-%}
-
-%include "proton/cproton.i"

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index 2f26fdf..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# 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.
-#
-
-require "spec_helper"
-
-describe "The extended array type" do
-
-  before :each do
-    @data        = Qpid::Proton::Codec::Data.new
-    @list        = random_list(rand(100))
-    @undescribed = random_array(rand(100))
-    @description = random_string(128)
-    @described   = random_array(rand(100), true, @description)
-  end
-
-  it "can be created like a normal array" do
-    value = []
-
-    expect(value).to respond_to(:proton_put)
-    expect(value).to respond_to(:proton_array_header)
-    expect(value.class).to respond_to(:proton_get)
-    expect(value).to respond_to :proton_described?
-  end
-
-  it "raises an error when putting into a nil Data object" do
-    expect {
-      @list.proton_put(nil)
-    }.to raise_error
-  end
-
-  it "raises an error when getting from a nil Data object" do
-    expect {
-      Array.proton_get(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when the data object is empty" do
-    expect {
-      Array.proton_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when the current object is not a list" do
-    @data.string = random_string(128)
-    @data.rewind
-
-    expect {
-      Array.proton_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "does not have an array header when it's a simple list" do
-    expect(@list.proton_described?).to eq(false)
-  end
-
-  it "can be put into a Data object as a list" do
-    @list.proton_put(@data)
-    result = Array.proton_get(@data)
-    expect(result).to match_array(@list)
-    expect(result.proton_array_header).to eq(nil)
-  end
-
-  it "has an array header when it's an AMQP array" do
-    expect(@undescribed.proton_array_header).not_to be_nil
-    expect(@described.proton_array_header).not_to be_nil
-  end
-
-  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::Types::ArrayHeader.new(Qpid::Proton::Codec::INT)
-    value << random_string(16)
-
-    expect {
-      value.proton_put(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "can be put into a Data object as an undescribed array" do
-    @undescribed.proton_put(@data)
-    result = Array.proton_get(@data)
-    be_close_array(@undescribed, result)
-
-    expect(result.proton_array_header).not_to be_nil
-    expect(result.proton_array_header).to eq(@undescribed.proton_array_header)
-    expect(result.proton_array_header.described?).to eq(false)
-  end
-
-  it "can be put into a Data object as a described array" do
-    @described.proton_put(@data)
-    result = Array.proton_get(@data)
-    be_close_array(@described, result)
-
-    expect(result.proton_array_header).not_to be_nil
-    expect(result.proton_array_header).to eq(@described.proton_array_header)
-    expect(result.proton_array_header.described?).to eq(true)
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index c8c7d18..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
+++ /dev/null
@@ -1,493 +0,0 @@
-#
-# 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.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-    describe "A data object" do
-
-      before :each do
-        @data = Qpid::Proton::Codec::Data.new
-      end
-
-      it "can be initialized" do
-        expect(@data).not_to be_nil
-      end
-
-      it "can hold a null" do
-        @data.null
-        expect(@data.null?).to eq(true)
-      end
-
-      it "can hold a true boolean" do
-        @data.bool = true
-        expect(@data.bool).to eq(true)
-      end
-
-      it "can hold a false boolean" do
-        @data.bool = false
-        expect(@data.bool).to eq(false)
-      end
-
-      it "raises an error on a negative ubyte" do
-        expect {
-          @data.ubyte = (0 - (rand(127) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a null ubyte" do
-        expect {
-          @data.ubyte = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold an unsigned byte" do
-        value = rand(255)
-        @data.ubyte = value
-        expect(@data.ubyte).to eq(value)
-      end
-
-      it "can hold a byte" do
-        value = rand(128)
-        @data.byte = value
-        expect(@data.byte).to eq(value)
-      end
-
-      it "can hold a negative byte" do
-        value = 0 - (rand(126) + 1)
-        @data.byte = value
-        expect(@data.byte).to eq(value)
-      end
-
-      it "raises an error on a negative ushort" do
-        expect {
-          @data.ushort = (0 - (rand(65535) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a nil ushort" do
-        expect {
-          @data.ushort = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero unsigned short" do
-        @data.ushort = 0
-        expect(@data.ushort).to eq(0)
-      end
-
-      it "can hold an unsigned short" do
-        value = rand(2**15) + 1
-        @data.ushort = value
-        expect(@data.ushort).to eq(value)
-      end
-
-      it "raises an error on a nil short" do
-        expect {
-          @data.short = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a short" do
-        value = rand(2**15) + 1
-        @data.short = value
-        expect(@data.short).to eq(value)
-      end
-
-      it "can hold a zero short" do
-        @data.short = 0
-        expect(@data.short).to eq(0)
-      end
-
-      it "can hold a negative short" do
-        value = (0 - (rand(2**15) + 1))
-        @data.short = value
-        expect(@data.short).to eq(value)
-      end
-
-      it "raises an error on a nil uint" do
-        expect {
-          @data.uint = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative uint" do
-        expect {
-          @data.uint = (0 - (rand(2**32) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "can hold an unsigned integer" do
-        value = rand(2**32) + 1
-        @data.uint = value
-        expect(@data.uint).to eq(value)
-      end
-
-      it "can hold a zero unsigned integer" do
-        @data.uint = 0
-        expect(@data.uint).to eq(0)
-      end
-
-      it "raise an error on a null integer" do
-        expect {
-          @data.int = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold an integer" do
-        value = rand(2**31) + 1
-        @data.int = value
-        expect(@data.int).to eq(value)
-      end
-
-      it "can hold zero as an integer" do
-        @data.int = 0
-        expect(@data.int).to eq(0)
-      end
-
-      it "raises an error on a null character" do
-        expect {
-          @data.char = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a character" do
-        source = random_string(256)
-        index = rand(source.length)
-        value = source[index,1].bytes.to_a[0]
-        @data.char = value
-        expect(@data.char).to eq(value)
-      end
-
-      it "raises an error on a null ulong" do
-        expect {
-          @data.ulong = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative ulong" do
-        expect {
-          @data.ulong = (0 - (rand(2**63) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "can have a zero unsigned long" do
-        @data.ulong = 0
-        expect(@data.ulong).to eq(0)
-      end
-
-      it "can hold an unsigned long" do
-        value = rand(2**63) + 1
-        @data.ulong = value
-        expect(@data.ulong).to eq(value)
-      end
-
-      it "raises an error on a null long" do
-        expect {
-          @data.long = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a zero long" do
-        @data.long = 0
-        expect(@data.long).to eq(0)
-      end
-
-      it "can hold a long" do
-        value = rand(2**63) + 1
-        @data.long = value
-        expect(@data.long).to eq(value)
-      end
-
-      it "raise an error on a null timestamp" do
-        expect {
-          @data.timestamp = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can handle a negative timestamp" do
-        last_year = Time.now - (60*60*24*365)
-        @data.timestamp = last_year
-        expect(@data.timestamp).to eq(last_year.to_i)
-      end
-
-      it "can handle a zero timestamp" do
-        @data.timestamp = 0
-        expect(@data.timestamp).to eq(0)
-      end
-
-      it "can hold a timestamp" do
-        next_year = Time.now + (60*60*24*365)
-        @data.timestamp = next_year
-        expect(@data.timestamp).to eq(next_year.to_i)
-      end
-
-      it "raises an error on a null float" do
-        expect {
-          @data.float = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a negative float" do
-        value = 0.0 - (1.0 + rand(2.0**15)).to_f
-        @data.float = value
-        expect(@data.float).to eq(value)
-      end
-
-      it "can hold a zero float" do
-        @data.float = 0.0
-        expect(@data.float).to eq(0.0)
-      end
-
-      it "can hold a float" do
-        value = (1.0 + rand(2.0**15)).to_f
-        @data.float = value
-        expect(@data.float).to eq(value)
-      end
-
-      it "raise an error on a null double" do
-        expect {
-          @data.double = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a negative double" do
-        value = 0.0 - (1.0 + rand(2.0**31)).to_f
-        @data.double = value
-        expect(@data.double).to eq(value)
-      end
-
-      it "can hold a zero double" do
-        @data.double = 0.0
-        expect(@data.double).to eq(0.0)
-      end
-
-      it "can hold a double" do
-        value = (1.0 + rand(2.0**31)).to_f
-        @data.double = value
-        expect(@data.double).to eq(value)
-      end
-
-      it "raises an error on a null decimal32" do
-        expect {
-          @data.decimal32 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal32" do
-        @data.decimal32 = 0
-        expect(@data.decimal32).to eq(0)
-      end
-
-      it "can hold a decimal32" do
-        value = 1 + rand(2**31)
-        @data.decimal32 = value
-        expect(@data.decimal32).to eq(value)
-      end
-
-      it "raises an error on a null decimal64" do
-        expect {
-          @data.decimal64 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal64" do
-        @data.decimal64 = 0
-        expect(@data.decimal64).to eq(0)
-      end
-
-      it "can hold a decimal64" do
-        value = 1 + rand(2**63)
-        @data.decimal64 = value
-        expect(@data.decimal64).to eq(value)
-      end
-
-      it "raises an error on a null decimal128" do
-        expect {
-          @data.decimal128 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal128" do
-        @data.decimal128 = 0
-        expect(@data.decimal128).to eq(0)
-      end
-
-      it "can hold a decimal128" do
-        value = rand(2**127)
-        @data.decimal128 = value
-        expect(@data.decimal128).to eq(value)
-      end
-
-      it "raises an error on a null UUID" do
-        expect {
-          @data.uuid = nil
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises an error on a malformed UUID" do
-        expect {
-          @data.uuid = random_string(36)
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can set a UUID from an integer value" do
-        @data.uuid = 336307859334295828133695192821923655679
-        expect(@data.uuid).to eq("fd0289a5-8eec-4a08-9283-81d02c9d2fff")
-      end
-
-      it "can hold a UUID" do
-        value = "fd0289a5-8eec-4a08-9283-81d02c9d2fff"
-        @data.uuid = value
-        expect(@data.uuid).to eq(value)
-      end
-
-      it "can hold a null binary" do
-        @data.binary = nil
-        expect(@data.binary).to eq("")
-      end
-
-      it "can hold a binary" do
-        value = random_string(128)
-        @data.binary = value
-        expect(@data.binary).to eq(value)
-      end
-
-      it "can hold a null string" do
-        @data.string = nil
-        expect(@data.string).to eq("")
-      end
-
-      it "can hold a string" do
-        value = random_string(128)
-        @data.string = value
-        expect(@data.string).to eq(value)
-      end
-
-      it "can hold a null symbol" do
-        @data.symbol = nil
-        expect(@data.symbol).to eq("")
-      end
-
-      it "can hold a symbol" do
-        value = random_string(128)
-        @data.symbol = value
-        expect(@data.symbol).to eq(value)
-      end
-
-      it "can hold a described value" do
-        name = random_string(16)
-        value = random_string(16)
-        @data.put_described
-        @data.enter
-        @data.symbol = name
-        @data.string = value
-        @data.exit
-
-        expect(@data.described?).to eq(true)
-        @data.enter
-        @data.next
-        expect(@data.symbol).to eq(name)
-        @data.next
-        expect(@data.string).to eq(value)
-      end
-
-      it "raises an error when setting the wrong type in an array"
-
-      it "can hold an array" do
-        values = []
-        (1..(rand(100) + 5)).each { values << rand(2**16) }
-        @data.put_array false, Qpid::Proton::Codec::INT
-        @data.enter
-        values.each { |value| @data.int = value }
-        @data.exit
-
-        @data.enter
-        values.each do |value|
-          @data.next
-          expect(@data.int).to eq(value)
-        end
-      end
-
-      it "can hold a described array" do
-        values = []
-        (1..(rand(100) + 5)).each { values << random_string(64) }
-        descriptor = random_string(32)
-        @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::Codec::STRING])
-        @data.enter
-        @data.next
-        expect(@data.symbol).to eq(descriptor)
-        values.each do |value|
-          @data.next
-          expect(@data.string).to eq(value)
-        end
-      end
-
-      it "can hold a list" do
-        values = []
-        (1..(rand(100) + 5)).each { values << random_string(128) }
-        @data.put_list
-        @data.enter
-        values.each {|value| @data.string = value}
-        @data.exit
-
-        @data.enter
-        values.each do |value|
-          @data.next
-          expect(@data.string).to eq(value)
-        end
-      end
-
-      it "can hold a map" do
-        keys = []
-        (1..(rand(100) + 5)).each {keys << random_string(128)}
-        values = {}
-        keys.each {|key| values[key] = random_string(128)}
-
-        @data.put_map
-        @data.enter
-        keys.each do |key|
-          @data.string = key
-          @data.string = values[key]
-        end
-        @data.exit
-
-        @data.enter
-        keys.each do |key|
-          @data.next
-          expect(@data.string).to eq(key)
-          @data.next
-          expect(@data.string).to eq(values[key])
-        end
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index e296a69..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# 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.
-#
-
-module Qpid
-
-  module Proton
-
-    class ExceptionHandlingClass
-      include Qpid::Proton::Util::ErrorHandler
-
-      def error
-        "This is a test error: #{Time.new}"
-      end
-    end
-
-    describe "The exception handling mixin" do
-
-      before (:each) do
-        @handler = Qpid::Proton::ExceptionHandlingClass.new
-      end
-
-      it "does not raise an error on a zero code" do
-        expect {
-          @handler.check_for_error(0)
-        }.to_not raise_error
-      end
-
-      it "raises EOS on PN_EOS" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::EOS)
-        }.to raise_error(Qpid::Proton::EOSError)
-      end
-
-      it "raises Error on PN_ERR" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::ERROR)
-        }.to raise_error(Qpid::Proton::ProtonError)
-      end
-
-      it "raises Overflow on PN_OVERFLOW" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::OVERFLOW)
-        }.to raise_error(Qpid::Proton::OverflowError)
-      end
-
-      it "raises Underflow on PN_UNDERFLOW" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::UNDERFLOW)
-        }.to raise_error(Qpid::Proton::UnderflowError)
-      end
-
-      it "raises Argument on PN_ARG_ERR" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::ARGUMENT)
-        }.to raise_error(Qpid::Proton::ArgumentError)
-      end
-
-      it "raises Timeout on PN_TIMEOUT" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::TIMEOUT)
-        }.to raise_error(Qpid::Proton::TimeoutError)
-      end
-
-      it "raises an Ruby ArgumentError on a nil code" do
-        expect {
-          @handler.check_for_error(nil)
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises a Ruby ArgumentError on an unknown value" do
-        expect {
-          @handler.check_for_error("farkle")
-        }.to raise_error(::ArgumentError)
-      end
-
-    end
-
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index 7568ac1..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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.
-#
-
-require "spec_helper"
-
-describe "The extended hash type" do
-
-  before :each do
-    @data = Qpid::Proton::Codec::Data.new
-    @hash = random_hash(rand(128) + 64)
-  end
-
-  it "raises an error when put into a nil Data instance" do
-    expect {
-      @hash.proton_data_put(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "can be put into an instance of Data" do
-    @hash.proton_data_put(@data)
-    result = Hash.proton_data_get(@data)
-    expect(result.keys).to match_array(@hash.keys)
-    expect(result.values).to match_array(@hash.values)
-  end
-
-  it "raises an error when retrieved from a nil Data instance" do
-    expect {
-      Hash.proton_data_get(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when trying to get what is not a Hash" do
-    @data.string = random_string(128)
-    @data.rewind
-
-    expect {
-      Hash.proton_data_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-end

http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/2f85988e/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
deleted file mode 100644
index 36e4695..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
+++ /dev/null
@@ -1,638 +0,0 @@
-#
-# 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.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-    describe "A message" do
-
-      before (:each) do
-        @message = Qpid::Proton::Message.new
-      end
-
-      it "can be created" do
-        expect(@message).not_to be_nil
-      end
-
-      it "can be cleared" do
-        subject = random_string(16)
-        @message.subject = subject
-        expect(@message.subject).to eq(subject)
-        @message.clear
-        expect(@message.subject).not_to eq(subject)
-      end
-
-      it "can be durable" do
-        @message.durable = true
-        expect(@message.durable).to eq(true)
-        @message.durable = false
-        expect(@message.durable).to eq(false)
-      end
-
-      it "raises an error when setting durable to nil" do
-        expect {
-          @message.durable = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the priority to nil" do
-        expect {
-          @message.priority = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the priority to a non-number" do
-        expect {
-          @message.priority = "abck"
-        }.to raise_error(TypeError)
-      end
-
-      it "sets the priority to the integer portion when a float" do
-        priority = rand(100) / 10
-        @message.priority = priority
-        expect(@message.priority).to eq(priority.floor)
-      end
-
-      it "rejects a priority with too large of a value" do
-        expect {
-          @message.priority = (rand(100) + 256)
-        }.to raise_error(RangeError)
-      end
-
-      it "rejects a negative priority" do
-        expect {
-          @message.priority = (0 - (rand(255) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "has a priority" do
-        priority = rand(256)
-        @message.priority = priority
-        expect(@message.priority).to eq(priority)
-      end
-
-      it "raises an error when setting the time-to-live to nil" do
-        expect {
-          @message.ttl = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the time-to-live to a non-number" do
-        expect {
-          @message.ttl = random_string(5)
-        }.to raise_error(TypeError)
-      end
-
-      it "sets the time-to-live to the integer portion when a float" do
-        ttl = (rand(32767) / 10)
-        @message.ttl = ttl
-        expect(@message.ttl).to eq(ttl.floor)
-      end
-
-      it "raises an error when the time-to-live is negative" do
-        expect {
-          @message.ttl = (0 - rand(1000))
-        }.to raise_error(RangeError)
-      end
-
-      it "has a time-to-live" do
-        ttl = rand(32767)
-        @message.ttl = ttl
-        expect(@message.ttl).to eq(ttl)
-      end
-
-      it "raises an error when setting first acquirer to nil" do
-        expect {
-          @message.first_acquirer = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises and error when setting first acquirer to a non-boolean" do
-        expect {
-          @message.first_acquirer = random_string(16)
-        }.to raise_error(TypeError)
-      end
-
-      it "has a first acquirer" do
-        @message.first_acquirer = true
-        expect(@message.first_acquirer?).to eq(true)
-
-        @message.first_acquirer = false
-        expect(@message.first_acquirer?).to eq(false)
-      end
-
-      it "raises an error on a nil delivery count" do
-        expect {
-          @message.delivery_count = nil
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises an error on a negative delivery count" do
-        expect {
-          @message.delivery_count = -1
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a non-numeric delivery count" do
-        expect {
-          @message.delivery_count = "farkle"
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "converts a floating point delivery count to its integer portion" do
-          count = rand(255) / 10.0
-          @message.delivery_count = count
-          expect(@message.delivery_count).to eq(count.floor)
-        end
-
-      it "has a delivery count" do
-        count = rand(255)
-        @message.delivery_count = count
-        expect(@message.delivery_count).to eq(count)
-      end
-
-      it "allows setting a nil id" do
-        @message.id = nil
-        expect(@message.id).to be_nil
-      end
-
-      it "has an id" do
-        id = random_string(16)
-        @message.id = id
-        expect(@message.id).to eq(id)
-      end
-
-      it "allows setting a nil user id" do
-        @message.user_id = nil
-        expect(@message.user_id).to eq("")
-      end
-
-      it "has a user id" do
-        id = random_string(16)
-        @message.user_id = id
-        expect(@message.user_id).to eq(id)
-      end
-
-      it "allows setting a nil address" do
-        @message.address = nil
-        expect(@message.address).to be_nil
-      end
-
-      it "has an address" do
-        address = "//0.0.0.0/#{random_string(16)}"
-        @message.address = address
-        expect(@message.address).to eq(address)
-      end
-
-      it "allows setting a nil subject" do
-        @message.subject = nil
-        expect(@message.subject).to be_nil
-      end
-
-      it "has a subject" do
-        subject = random_string(50)
-        @message.subject = subject
-        expect(@message.subject).to eq(subject)
-      end
-
-      it "will allow a nil reply-to address" do
-        @message.reply_to = nil
-        expect(@message.reply_to).to be_nil
-      end
-
-      it "has a reply-to address" do
-        address = "//0.0.0.0/#{random_string(16)}"
-        @message.reply_to = address
-        expect(@message.reply_to).to eq(address)
-      end
-
-      it "will allow a nil correlation id" do
-        @message.correlation_id = nil
-        expect(@message.correlation_id).to be_nil
-      end
-
-      it "has a correlation id" do
-        id = random_string(25)
-        @message.correlation_id = id
-        expect(@message.correlation_id).to eq(id)
-      end
-
-      it "will allow a nil content type" do
-        @message.content_type = nil
-        expect(@message.content_type).to be_nil
-      end
-
-      it "will allow an empty content type" do
-        @message.content_type = ""
-        expect(@message.content_type).to eq("")
-      end
-
-      it "has a content type" do
-        content_type = random_string(32)
-        @message.content_type = content_type
-        expect(@message.content_type).to eq(content_type)
-      end
-
-      it "can have nil content encoding" do
-        @message.content_encoding = nil
-        expect(@message.content_encoding).to be_nil
-      end
-
-      it "has a content encoding" do
-        encoding = "#{random_string(8)}/#{random_string(8)}"
-        @message.content_encoding = encoding
-        expect(@message.content_encoding).to eq(encoding)
-      end
-
-      it "raises an error on a nil expiry time" do
-        expect {
-          @message.expires = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative expiry time" do
-        expect {
-          @message.expires = (0-(rand(65535)))
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can have a zero expiry time" do
-        @message.expires = 0
-        expect(@message.expires).to equal(0)
-      end
-
-      it "has an expiry time" do
-        time = rand(65535)
-        @message.expires = time
-        expect(@message.expires).to eq(time)
-      end
-
-      it "raises an error on a nil creation time" do
-        expect {
-          @message.creation_time = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative creation time" do
-        expect {
-          @message.creation_time = (0 - rand(65535))
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can have a zero creation time" do
-        @message.creation_time = 0
-        expect(@message.creation_time).to eq(0)
-      end
-
-      it "has a creation time" do
-        time = rand(65535)
-        @message.creation_time = time
-        expect(@message.creation_time).to eq(time)
-      end
-
-      it "can have a nil group id" do
-        @message.group_id = nil
-        expect(@message.group_id).to be_nil
-      end
-
-      it "can have an empty group id" do
-        @message.group_id = ""
-        expect(@message.group_id).to eq("")
-      end
-
-      it "has a group id" do
-        id = random_string(16)
-        @message.group_id = id
-        expect(@message.group_id).to eq(id)
-      end
-
-
-      it "raises an error on a nil group sequence" do
-        expect {
-          @message.group_sequence = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a negative group sequence" do
-        seq = (0 - rand(32767))
-        @message.group_sequence = seq
-        expect(@message.group_sequence).to eq(seq)
-      end
-
-      it "can have a zero group sequence" do
-        @message.group_sequence = 0
-        expect(@message.group_sequence).to eq(0)
-      end
-
-      it "has a group sequence" do
-        id = rand(32767)
-        @message.group_sequence = id
-        expect(@message.group_sequence).to eq(id)
-      end
-
-      it "can have a nil reply-to group id" do
-        @message.reply_to_group_id = nil
-        expect(@message.reply_to_group_id).to be_nil
-      end
-
-      it "can have an empty reply-to group id" do
-        @message.reply_to_group_id = ""
-        expect(@message.reply_to_group_id).to eq("")
-      end
-
-      it "has a reply-to group id" do
-        id = random_string(16)
-        @message.reply_to_group_id = id
-        expect(@message.reply_to_group_id).to eq(id)
-      end
-
-      it "has properties" do
-        expect(@message).to respond_to(:properties)
-        expect(@message).to respond_to(:properties=)
-        expect(@message).to respond_to(:[])
-        expect(@message).to respond_to(:[]=)
-
-        expect(@message.properties).to be_kind_of({}.class)
-      end
-
-      it "can replace the set of properties" do
-        values = random_hash(128)
-
-        @message.properties = values.clone
-        expect(@message.properties).to eq(values)
-      end
-
-      it "can set properties" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-      end
-
-      it "can update properties" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        value = random_string(128)
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-      end
-
-      it "can hold a null property" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message[name] = nil
-        expect(@message[name]).to be_nil
-      end
-
-      it "can delete a property" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message.delete_property(name)
-        expect(@message.properties.keys).to_not include(name)
-      end
-
-      it "has no properties after being cleared" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message.clear
-        expect(@message.properties).to be_empty
-      end
-
-      it "has instructions" do
-        expect(@message).to respond_to(:instructions)
-        expect(@message).to respond_to("instructions=".to_sym)
-      end
-
-      it "can set an instruction" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-      end
-
-      it "can update an instruction" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-
-        value = random_string(128)
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-      end
-
-      it "can delete the instructions" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions).to_not be_empty
-
-        @message.instructions = nil
-        expect(@message.instructions).to be_nil
-      end
-
-      it "can replace the instructions" do
-        values = random_hash(rand(128) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-
-        values = random_hash(rand(64) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-      end
-
-      it "can delete the set of instructions" do
-        values = random_hash(rand(128) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-
-        @message.instructions = nil
-        expect(@message.instructions).to be_nil
-      end
-
-      it "has no instructions after being cleared" do
-        value = random_hash(128)
-
-        @message.instructions = value.clone
-        expect(@message.instructions).to eq(value)
-
-         @message.clear
-        expect(@message.instructions).to be_empty
-      end
-
-      it "has annotations" do
-        expect(@message).to respond_to(:annotations)
-        expect(@message).to respond_to(:annotations=)
-      end
-
-      it "can set an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-      end
-
-      it "can update an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-
-        value = random_hash(128)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-      end
-
-      it "can delete an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-
-        @message.annotations[name] = nil
-        expect(@message.annotations[name]).to be_nil
-      end
-
-      it "can replace all annotations" do
-        values = random_hash(rand(128) + 1)
-
-        @message.annotations = values.clone
-        expect(@message.annotations).to eq(values)
-
-        values = random_hash(rand(64) + 1)
-
-        @message.annotations = values.clone
-        expect(@message.annotations).to eq(values)
-      end
-
-      it "can delete the set of annotations" do
-        value = random_hash(rand(128) + 1)
-
-        @message.annotations = value.clone
-        expect(@message.annotations).to eq(value)
-
-        @message.annotations = nil
-        expect(@message.annotations).to be_nil
-      end
-
-      it "has no annotations after being cleared" do
-        value = random_hash(16)
-
-        @message.annotations = value
-        expect(@message.annotations).to eq(value)
-
-        @message.clear
-        expect(@message.annotations).to be_empty
-      end
-
-      it "has a body property" do
-        expect(@message).to respond_to(:body)
-        expect(@message).to respond_to(:body=)
-      end
-
-      it "has a default body that is nil" do
-        expect(@message.body).to be_nil
-      end
-
-      it "has no body after being cleared" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.body = value
-        expect(@message.body).to eq(value)
-
-        @message.clear
-        expect(@message.body).to be_nil
-      end
-
-      it "can set the body property" do
-        (1..3).each do |which|
-          case which
-            when 0
-            value = random_string(32)
-            when 1
-            value = random_array(100)
-            when 2
-            value = random_hash(100)
-            when 3
-            value = rand(512)
-          end
-
-          @message.body = value
-          expect(@message.body).to eq(value)
-        end
-      end
-
-      it "can update the body property" do
-        (1..3).each do |which|
-          case which
-            when 0
-            value = random_string(32)
-            when 1
-            value = random_array(100)
-            when 2
-            value = random_hash(100)
-            when 3
-            value = rand(512)
-          end
-
-          @message.body = value
-          expect(@message.body).to eq(value)
-
-          @message.body = nil
-          expect(@message.body).to be_nil
-        end
-      end
-
-    end
-
-  end
-
-end
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org