test/functional/eft_7_forget.rb in ruote-2.2.0 vs test/functional/eft_7_forget.rb in ruote-2.3.0
- old
+ new
@@ -3,11 +3,11 @@
# testing ruote
#
# Sun Jun 14 13:33:17 JST 2009
#
-require File.join(File.dirname(__FILE__), 'base')
+require File.expand_path('../base', __FILE__)
class EftForgetTest < Test::Unit::TestCase
include FunctionalBase
@@ -20,42 +20,44 @@
end
alpha
end
end
- @engine.register_participant :alpha do
- @tracer << "alpha\n"
+ @dashboard.register_participant :alpha do
+ tracer << "alpha\n"
end
- #noisy
+ wfid = @dashboard.launch(pdef)
- wfid = @engine.launch(pdef)
-
wait_for(:alpha)
wait_for(:alpha)
wait_for(wfid)
wait_for(wfid)
assert_equal "alpha\nalpha", @tracer.to_s
- #logger.log.each { |e| puts e['action'] }
assert_equal 1, logger.log.select { |e| e['action'] == 'ceased' }.size
assert_equal 1, logger.log.select { |e| e['action'] == 'terminated' }.size
end
- #def test_variables
- # pdef = Ruote.process_definition do
- # set :var => 'a', :value => 0
- # concurrence do
- # set :var => 'a', :value => 1
- # forget do
- # echo '0_${v:a}'
- # end
- # echo '1_${v:a}'
- # end
- # echo '2_${v:a}'
- # end
- # noisy
- # assert_trace %w[ 1_1 0_0 2_1 ], pdef
- #end
+ def test_multi
+
+ pdef = Ruote.define do
+ forget do
+ alpha
+ bravo
+ end
+ charly
+ end
+
+ @dashboard.register_participant '.+' do |wi|
+ context.tracer << wi.participant_name + "\n"
+ end
+
+ wfid = @dashboard.launch(pdef)
+
+ 3.times { @dashboard.wait_for('dispatched') }
+
+ assert_equal %w[ alpha bravo charly ], @tracer.to_a.sort
+ end
end