test/functional/ft_9_subprocesses.rb in ruote-2.1.11 vs test/functional/ft_9_subprocesses.rb in ruote-2.2.0
- old
+ new
@@ -5,11 +5,11 @@
# Wed Jun 10 17:41:23 JST 2009
#
require File.join(File.dirname(__FILE__), 'base')
-require 'ruote/part/hash_participant'
+require 'ruote/participant'
class FtSubprocessesTest < Test::Unit::TestCase
include FunctionalBase
@@ -24,11 +24,11 @@
bravo
sub0
end
end
- bravo = @engine.register_participant :bravo, Ruote::HashParticipant.new
+ bravo = @engine.register_participant :bravo, Ruote::StorageParticipant
#noisy
wfid = @engine.launch(pdef)
wait_for(:bravo)
@@ -53,11 +53,11 @@
#logger.log.each { |e| puts e['action'] }
assert_equal 2, logger.log.select { |e| e['action'] == 'launch' }.size
end
- def test_next_sub_wfid
+ def test_subid
pdef = Ruote.process_definition do
sequence do
sub0 :forget => true
sub0 :forget => true
@@ -68,26 +68,26 @@
define 'sub1' do
alpha
end
end
- wfids = []
+ @engine.context.stash[:wfids] = []
@engine.register_participant :alpha do |workitem|
- wfids << workitem.fei.sub_wfid
+ stash[:wfids] << workitem.fei.subid
end
#noisy
wfid = @engine.launch(pdef)
wait_for(:alpha)
wait_for(:alpha)
- wait_for(3)
+ wait_for(6)
- assert_equal 2, wfids.size
- assert_equal 2, wfids.sort.uniq.size
+ assert_equal 2, @engine.context.stash[:wfids].size
+ assert_equal 2, @engine.context.stash[:wfids].sort.uniq.size
end
def test_cancel_and_subprocess
pdef = Ruote.process_definition do
@@ -97,11 +97,11 @@
define 'sub0' 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(:alpha)
@@ -124,10 +124,10 @@
@engine.variables['sub0'] = Ruote.process_definition do
alpha
end
- alpha = @engine.register_participant :alpha, Ruote::HashParticipant.new
+ alpha = @engine.register_participant :alpha, Ruote::StorageParticipant
#noisy
wfid = @engine.launch(pdef)