Sha256: 21e4a031782817dabee93bf936d3a5c9d606bb589d636441db1a7a3607b1ef63

Contents?: true

Size: 895 Bytes

Versions: 11

Compression:

Stored size: 895 Bytes

Contents

#
# testing ruote
#
# Thu Jul  2 12:51:54 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')
require File.join(File.dirname(__FILE__), 'restart_base')


require 'ruote/part/hash_participant'


class RtListenTest < Test::Unit::TestCase
  include FunctionalBase
  include RestartBase

  def test_listen_and_restart

    start_new_engine

    pdef = Ruote.process_definition do
      concurrence do
        sequence do
          listen :to => '^al.*', :upon => 'reply'
          echo 'done.'
        end
        alpha
      end
    end

    #puts; noisy

    alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new

    wfid = @engine.launch(pdef)

    wait_for(:alpha)

    assert_equal '', @tracer.to_s

    @engine.shutdown

    start_new_engine

    #puts; noisy

    @engine.reply(alpha.first)

    wait_for(wfid)

    assert_equal 'done.', @tracer.to_s
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruote-2.1.11 test/functional/rt_1_listen.rb
ruote-2.1.10 test/functional/rt_1_listen.rb
ruote-2.1.9 test/functional/rt_1_listen.rb
ruote-2.1.8 test/functional/rt_1_listen.rb
ruote-2.1.7 test/functional/rt_1_listen.rb
ruote-2.1.6 test/functional/rt_1_listen.rb
ruote-2.1.5 test/functional/rt_1_listen.rb
ruote-2.1.4 test/functional/rt_1_listen.rb
ruote-2.1.3 test/functional/rt_1_listen.rb
ruote-2.1.2 test/functional/rt_1_listen.rb
ruote-2.1.1 test/functional/rt_1_listen.rb