test/functional/ct_0_concurrence.rb in ruote-2.2.0 vs test/functional/ct_0_concurrence.rb in ruote-2.3.0
- old
+ new
@@ -3,15 +3,13 @@
# testing ruote
#
# Wed Jul 8 15:30:55 JST 2009
#
-require File.join(File.dirname(__FILE__), 'concurrent_base')
+require File.expand_path('../concurrent_base', __FILE__)
-#require 'ruote/part/hash_participant'
-
class CtConcurrenceTest < Test::Unit::TestCase
include ConcurrentBase
# A collision between two workers replying to the same concurrence expression.
#
@@ -24,36 +22,34 @@
echo 'a'
echo 'b'
end
end
- noisy if ARGV.include?('-N')
+ wfid = @dashboard0.launch(pdef)
- wfid = @engine0.launch(pdef)
-
replies = []
while replies.size < 2
- msg = @engine0.next_msg
+ msg = @dashboard0.next_msg
if msg['action'] == 'reply'
replies << msg
else
- @engine0.do_process(msg)
+ @dashboard0.do_process(msg)
end
end
replies.sort! { |a, b| a['put_at'] <=> b['put_at'] }
#replies.each { |r| p r }
- t0 = Thread.new { @engine1.do_process(replies[0]) }
- t1 = Thread.new { @engine0.do_process(replies[1]) }
+ t0 = Thread.new { @dashboard1.do_process(replies[0]) }
+ t1 = Thread.new { @dashboard0.do_process(replies[1]) }
t0.join
t1.join
- msgs = @engine0.gather_msgs
+ msgs = @dashboard0.gather_msgs
assert_equal 1, msgs.size, 'exactly 1 message was expected'
msg = msgs.first