Sha256: a90599a1853306d6d21921cab6b05a3fc3b177f5bfe8cc90a4625ed479647ab9

Contents?: true

Size: 957 Bytes

Versions: 1

Compression:

Stored size: 957 Bytes

Contents

#
# testing ruote
#
# Sun Aug 16 14:25:35 JST 2009
#

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

require 'ruote/part/hash_participant'


class FtParticipantTimeoutTest < Test::Unit::TestCase
  include FunctionalBase

  def test_participant_defined_timeout

    pdef = Ruote.process_definition do
      sequence do
        alpha
        bravo
      end
    end

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

    class << alpha
      def timeout
        '1s'
      end
    end

    #noisy

    wfid = @engine.launch(pdef)
    wait_for(13)

    assert_equal 0, alpha.size
    assert_equal 1, bravo.size

    #logger.log.each { |l| p l }
    assert_equal 2, logger.log.select { |e| e['flavour'] == 'timeout' }.size
    assert_equal 0, @engine.storage.get_many('schedules').size

    assert_not_nil bravo.first.fields['__timed_out__']
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-2.1.10 test/functional/ft_26_participant_timeout.rb