test/back_0916_test.rb in ruote-0.9.18 vs test/back_0916_test.rb in ruote-0.9.19

- old
+ new

@@ -15,97 +15,95 @@ require 'openwfe/engine/file_persisted_engine' class Back0916Test < Test::Unit::TestCase - WORK = 'work_back' + WORK = 'work_back' - def setup + def setup - FileUtils.rm_rf WORK - FileUtils.mkdir WORK + FileUtils.rm_rf WORK + FileUtils.mkdir WORK - `cd work_back && tar xzvf ../test/expool_20031219_0916.tgz` + `cd work_back && tar xzvf ../test/expool_20031219_0916.tgz` - ac = { :work_directory => WORK } + ac = { :work_directory => WORK } - @engine = OpenWFE::FilePersistedEngine.new ac - end + @engine = OpenWFE::FilePersistedEngine.new ac + end - def teardown + def teardown - $OWFE_LOG.level = Logger::INFO - FileUtils.rm_rf WORK - end + $OWFE_LOG.level = Logger::INFO + FileUtils.rm_rf WORK + end - def test_0 + def test_0 - $OWFE_LOG.level = Logger::DEBUG + $OWFE_LOG.level = Logger::DEBUG - trace = [] + trace = [] - @engine.register_participant :alpha do - trace << :alpha - end + @engine.register_participant :alpha do + trace << :alpha + end - @engine.reload + @engine.reload - ps = @engine.process_status "20080212-moshijuzuke" # an XML process - #p ps.expressions.collect { |e| e.fei.to_s } - exp = ps.expressions.first - wi = exp.applied_workitem - wi.message = "back from obsolesence" + ps = @engine.process_status '20080212-moshijuzuke' # an XML process + #p ps.expressions.collect { |e| e.fei.to_s } + exp = ps.expressions.first + wi = exp.applied_workitem + wi.message = "back from obsolesence" - @engine.reply wi + @engine.reply wi - sleep 0.350 + sleep 0.350 - assert_equal [ :alpha ], trace + assert_equal [ :alpha ], trace - ps = @engine.process_status "20080212-moshijuzuke" - #puts ps.size - #puts ps.collect { |e| e.fei.to_s }.join("\n") + ps = @engine.process_status '20080212-moshijuzuke' + #puts ps.size + #puts ps.collect { |e| e.fei.to_s }.join("\n") - assert_nil ps + assert_nil ps - @engine.stop + @engine.stop - sleep 0.300 - end + sleep 0.300 + end - def test_1 + def test_1 - $OWFE_LOG.level = Logger::DEBUG + $OWFE_LOG.level = Logger::DEBUG - trace = [] + trace = [] - #@engine.register_participant :employee do - # trace << :assistant - #end - #@engine.register_participant :employee do - # trace << :employee - #end - [ :user_bob, :user_alice ].each do |p| - @engine.register_participant p do - trace << p - end - end + #@engine.register_participant :employee do + # trace << :assistant + #end + #@engine.register_participant :employee do + # trace << :employee + #end + [ :user_bob, :user_alice ].each do |p| + @engine.register_participant(p) { trace << p } + end - @engine.reload + @engine.reload - ps = @engine.process_status "20080213-depejetzube" # an ruby procdef - exp = ps.expressions.first - wi = exp.applied_workitem + ps = @engine.process_status '20080213-depejetzube' # a ruby procdef + exp = ps.expressions.first + wi = exp.applied_workitem - @engine.reply wi + @engine.reply wi - sleep 0.400 + sleep 0.400 - assert_equal [ :user_bob, :user_bob ], trace + assert_equal [ :user_bob, :user_bob ], trace - assert_nil @engine.process_status("20080213-depejetzube") + assert_nil @engine.process_status('20080213-depejetzube') - @engine.stop + @engine.stop - sleep 0.300 - end + sleep 0.300 + end end