test/functional/ft_15_timeout.rb in ruote-2.1.11 vs test/functional/ft_15_timeout.rb in ruote-2.2.0

- old
+ new

@@ -5,13 +5,11 @@ # Sun Jun 28 16:45:57 JST 2009 # require File.join(File.dirname(__FILE__), 'base') -require 'ruote/part/hash_participant' - class FtTimeoutTest < Test::Unit::TestCase include FunctionalBase def test_timeout @@ -20,24 +18,25 @@ alpha :timeout => '1.1' bravo end end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new - bravo = @engine.register_participant :bravo, Ruote::HashParticipant.new + @engine.register_participant :alpha, Ruote::StorageParticipant + sto = @engine.register_participant :bravo, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef) wait_for(:bravo) - assert_equal 0, alpha.size - assert_equal 1, bravo.size + assert_equal 1, sto.size + assert_equal 'bravo', sto.first.participant_name + 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__'] + assert_not_nil sto.first.fields['__timed_out__'] end def test_cancel_timeout pdef = Ruote.process_definition do @@ -45,26 +44,27 @@ alpha :timeout => '1.1' bravo end end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new - bravo = @engine.register_participant :bravo, Ruote::HashParticipant.new + @engine.register_participant :alpha, Ruote::StorageParticipant + sto = @engine.register_participant :bravo, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef) wait_for(6) - assert_equal 1, alpha.size + assert_equal 1, sto.size + assert_equal 'alpha', sto.first.participant_name - @engine.cancel_expression(alpha.first.fei) + @engine.cancel_expression(sto.first.fei) wait_for(:bravo) - assert_equal 0, alpha.size - assert_equal 1, bravo.size + assert_equal 1, sto.size + assert_equal 'bravo', sto.first.participant_name assert_equal 0, @engine.storage.get_many('schedules').size end def test_on_timeout_redo @@ -80,11 +80,11 @@ pdef = Ruote.process_definition do alpha :timeout => '1.1', :on_timeout => 'redo' end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new + alpha = @engine.register_participant :alpha, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef) wait_for(8) @@ -111,11 +111,11 @@ define 'timedout' do echo 'timed out' end end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new + alpha = @engine.register_participant :alpha, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef) wait_for(wfid) @@ -130,11 +130,11 @@ pdef = Ruote.process_definition do alpha :timeout => '1.1', :on_timeout => 'error' end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new + alpha = @engine.register_participant :alpha, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef) wait_for(wfid) @@ -159,11 +159,11 @@ sequence :timeout => '1.1', :on_timeout => 'error' do alpha end end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new + alpha = @engine.register_participant :alpha, Ruote::StorageParticipant wfid = @engine.launch(pdef) wait_for(wfid) ps = @engine.process(wfid) @@ -201,10 +201,10 @@ sequence :timeout => t do alpha end end - alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new + alpha = @engine.register_participant :alpha, Ruote::StorageParticipant #noisy wfid = @engine.launch(pdef)