Sha256: 7f9212eb023d7d0c43dff49c702f9c04d5f217c7a883f315b03e3caa4bc753b8

Contents?: true

Size: 1007 Bytes

Versions: 52

Compression:

Stored size: 1007 Bytes

Contents

# encoding: utf-8

require "spec_helper"

# this example group ensures no message size is special
# (with respect to framing edge cases). MK.
describe "Stress test with messages with incrementing sizes" do

  #
  # Environment
  #

  include EventedSpec::AMQPSpec
  default_options AMQP_OPTS
  default_timeout 60

  amqp_before do
    @channel   = AMQP::Channel.new
    @channel.on_error do |ch, close|
      raise "Channel-level error!: #{close.inspect}"
    end

    @queue    = @channel.queue("", :auto_delete => true)
    @exchange = @channel.fanout("amqpgem.tests.integration.fanout.exchange", :auto_delete => true)

    @queue.bind(@exchange)
  end


  #
  # Examples
  #

  it "passes" do
    list     = Range.new(0, 4785).to_a
    received = Array.new

    @queue.subscribe do |metadata, payload|
      received << payload.bytesize

      done if received == list
    end

    EventMachine.add_timer(1.0) do
      list.each do |n|
        @exchange.publish("i" * n)
      end      
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
amqp-1.1.2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.3 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.0.rc1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.0.pre2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.0.pre1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.10 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.9 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.8 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.0.pre2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.7 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.6 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.0.pre1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.5 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.4 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-0.9.3 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb