Sha256: c0ed8921631f4d6a53d3f2db71c36af0154d74a91e148e9b54ab3e325714a937

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

require File.expand_path('../integration_test', __FILE__)

module Propono
  class UdpProxyTest < IntegrationTest
    def test_the_message_gets_there
      topic = "test-topic"
      message = "This is my message"
      Propono.config.udp_port = 20001

      Propono.subscribe_by_queue(topic)

      sqs_thread = Thread.new do
        Propono.listen_to_queue(topic) do |sqs_message|
          assert_equal message, sqs_message
          sqs_thread.terminate
        end
      end

      udp_thread = Thread.new do
        Propono.proxy_udp
      end

      sleep(2) # Make sure the proxy has started

      Propono.publish(topic, message, protocol: :udp)
      flunk("Test timeout") unless wait_for_thread(sqs_thread)
    ensure
      udp_thread.terminate
      sqs_thread.terminate
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
propono-0.8.2 test/integration/udp_proxy_test.rb
propono-0.8.0 test/integration/udp_proxy_test.rb
propono-0.7.0 test/integration/udp_proxy_test.rb