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

- old
+ new

@@ -3,11 +3,11 @@ # testing ruote # # Mon Jul 27 09:17:51 JST 2009 # -require File.join(File.dirname(__FILE__), 'base') +require File.expand_path('../base', __FILE__) require 'ruote/participant' class FtForgetTest < Test::Unit::TestCase @@ -20,17 +20,17 @@ alpha :forget => true alpha end end - @engine.register_participant :alpha do - @tracer << "alpha\n" + @dashboard.register_participant :alpha do + tracer << "alpha\n" end #noisy - wfid = @engine.launch(pdef) + wfid = @dashboard.launch(pdef) wait_for(wfid) wait_for(wfid) assert_equal %w[ alpha alpha ].join("\n"), @tracer.to_s @@ -41,34 +41,30 @@ assert_equal 1, logger.log.select { |e| e['action'] == 'terminated' }.size end def test_forgotten_tree - sp = @engine.register_participant :alpha, Ruote::StorageParticipant + sp = @dashboard.register_participant :alpha, Ruote::StorageParticipant pdef = Ruote.process_definition do sequence do alpha :forget => true end end - wfid = @engine.launch(pdef) + wfid = @dashboard.launch(pdef) wait_for(wfid) - ps = @engine.process(wfid) + ps = @dashboard.process(wfid) assert_not_nil ps assert_equal 0, ps.errors.size assert_equal 1, ps.expressions.size fei = ps.expressions.first.fei assert_equal fei, ps.root_expression_for(fei).fei - - #puts "not sure..." - #p ps.original_tree - #p ps.current_tree end def test_forget_true_string pdef = Ruote.process_definition do @@ -77,20 +73,19 @@ bravo end charly end - @engine.register_participant '.+' do |wi| - @tracer << wi.participant_name + "\n" + @dashboard.register_participant '.+' do |wi| + tracer << wi.participant_name + "\n" end - wfid = @engine.launch(pdef) + wfid = @dashboard.launch(pdef) wait_for(wfid) wait_for(wfid) - #assert_equal "alpha\nbravo\ncharly", @tracer.to_s assert_equal %w[ alpha bravo charly ], @tracer.to_a.sort end def test_forget_and_cursor @@ -100,24 +95,24 @@ bravo rewind end end - @engine.register_participant 'alpha', Ruote::NullParticipant + @dashboard.register_participant 'alpha', Ruote::NullParticipant # this participant never replies - @engine.register_participant 'bravo', Ruote::NoOpParticipant + @dashboard.register_participant 'bravo', Ruote::NoOpParticipant # this one simply replies - #@engine.noisy = true + #@dashboard.noisy = true - wfid = @engine.launch(pdef) + wfid = @dashboard.launch(pdef) - @engine.wait_for(:bravo) - @engine.wait_for(:bravo) + @dashboard.wait_for(:bravo) + @dashboard.wait_for(:bravo) - assert_not_nil @engine.process(wfid) + assert_not_nil @dashboard.process(wfid) end # As reported by Nando Sola # # http://groups.google.com/group/openwferu-users/browse_thread/thread/50308e9dce8359e6 @@ -133,21 +128,21 @@ end bravo end end - @engine.register do + @dashboard.register do catchall Ruote::NoOpParticipant end #noisy - wfid = @engine.launch(pdef) + wfid = @dashboard.launch(pdef) - @engine.wait_for(wfid) + @dashboard.wait_for(wfid) assert_equal( [], - @engine.history.all.select { |e| e['action'] == 'error_intercepted' }) + @dashboard.history.all.select { |e| e['action'] == 'error_intercepted' }) end end