Sha256: 5ddc7dbab2cf5d30a190bfc6a3fb381a09adcc25359e4b9f5a2d7b0b94fe4ce8

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8
require 'spec_helper'
require 'integration/eventmachine/spec_helper'

describe AMQ::Client::EventMachineClient, "Tx.Rollback" do
  include EventedSpec::SpecHelper
  default_timeout 2
  let(:message) { "Hello, world!" }
  it "should cancel all the changes done during transaction" do
    pending("Need to figure out details with AMQP protocol on that matter")
    received_messages = []
    em_amqp_connect do |client|
      channel = AMQ::Client::Channel.new(client, 1)
      channel.open do
        exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
        queue = AMQ::Client::Queue.new(client, channel)

        queue.declare(false, false, false, true) do
          queue.bind(exchange)
        end

        channel.tx_select do
          done(0.1)
          queue.consume(true) do |header, payload, delivery_tag, redelivered, exchange, routing_key, message_count|
            received_messages << message
          end

          exchange.publish(message)
          channel.tx_rollback
        end
      end
    end
    received_messages.should == []
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha35 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha34 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha33 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha32 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha31 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha30 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha29 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha28 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha27 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha26 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha25 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha24 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha23 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha22 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha21 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha20 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha19 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha18 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha17 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.7.0.alpha16 spec/integration/eventmachine/tx_rollback_spec.rb