Sha256: 37e0970241332cc552fcbbbc536c007492ef4bbca9ac9e967673a5c7c5046c7d

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

#
# testing the sqs with yaml messages
#

require 'test/unit'

require 'yaml'
require 'base64'

require 'openwfe/def'
require 'openwfe/engine/engine'

require 'openwfe/extras/listeners/sqslisteners'
require 'openwfe/extras/participants/sqsparticipants'


class SqsTest < Test::Unit::TestCase

  #def setup
  #end

  #def teardown
  #end

  class SqsDefinition0 < OpenWFE::ProcessDefinition
    def make
      participant :sqs
    end
  end

  def test_0

    engine = OpenWFE::Engine.new

    sqsp = OpenWFE::Extras::SqsParticipant.new("wiqueue")
    #class << sqsp
    #  def encode_workitem (wi)
    #    "hello from #{@queue.name}  #{wi.fei.workflow_instance_id}"
    #  end
    #end

    engine.register_participant(:sqs, sqsp)

    engine.add_workitem_listener(
      OpenWFE::Extras::SqsListener.new(
        :wiqueue, engine.application_context),
      "2s")

    engine.launch(SqsDefinition0)

    sleep(5)

    qs = sqsp.queue_service
    qs.delete_queue("wiqueue")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.19 test/extras/sqs_test.rb