test/functional/ft_48_lose.rb in ruote-2.2.0 vs test/functional/ft_48_lose.rb in ruote-2.3.0

- old
+ new

@@ -3,11 +3,11 @@ # testing ruote # # Thu Nov 25 11:20:04 JST 2010 # -require File.join(File.dirname(__FILE__), 'base') +require File.expand_path('../base', __FILE__) #require 'ruote/part/storage_participant' class FtLoseTest < Test::Unit::TestCase @@ -20,25 +20,23 @@ alpha :lose => true alpha end end - @engine.register_participant '.+' do |wi| - @tracer << wi.participant_name + "\n" + @dashboard.register_participant '.+' do |wi| + tracer << wi.participant_name + "\n" end - #@engine.noisy = true + wfid = @dashboard.launch(pdef) - wfid = @engine.launch(pdef) + @dashboard.wait_for(6) - @engine.wait_for(6) - #sleep 0.500 assert_equal 'alpha', @tracer.to_s - ps = @engine.process(wfid) + ps = @dashboard.process(wfid) assert_equal 3, ps.expressions.size assert_equal 0, ps.errors.size # the sequence is stuck, the lost alpha is not replying end @@ -52,24 +50,22 @@ bravo end end end - @engine.register_participant '.+' do |wi| - @tracer << wi.participant_name + "\n" + @dashboard.register_participant '.+' do |wi| + tracer << wi.participant_name + "\n" end - #@engine.noisy = true + wfid = @dashboard.launch(pdef) - wfid = @engine.launch(pdef) + 2.times { @dashboard.wait_for('dispatched') } - @engine.wait_for(12) - assert_match /alpha/, @tracer.to_s assert_match /bravo/, @tracer.to_s - ps = @engine.process(wfid) + ps = @dashboard.process(wfid) assert_equal 3, ps.expressions.size assert_equal 0, ps.errors.size # the concurrence is stuck, the lost sequence won't reply end @@ -82,31 +78,29 @@ bravo :lose => true charly end end - @engine.register_participant '.+' do |wi| - @tracer << wi.participant_name + "\n" + @dashboard.register_participant '.+' do |wi| + tracer << wi.participant_name + "\n" end - #@engine.noisy = true + wfid = @dashboard.launch(pdef) - wfid = @engine.launch(pdef) - - @engine.wait_for(12) + @dashboard.wait_for(12) # until bravo is reached #sleep 0.500 assert_equal "alpha\nbravo", @tracer.to_s - bravo = @engine.process(wfid).expressions.last + bravo = @dashboard.process(wfid).expressions.last - @engine.cancel_expression(bravo.fei) + @dashboard.cancel_expression(bravo.fei) - @engine.wait_for(wfid) + @dashboard.wait_for(wfid) assert_equal "alpha\nbravo\ncharly", @tracer.to_s - assert_nil @engine.process(wfid) + assert_nil @dashboard.process(wfid) end end