test/functional/eft_11_wait.rb in ruote-2.2.0 vs test/functional/eft_11_wait.rb in ruote-2.3.0
- old
+ new
@@ -3,11 +3,11 @@
# testing ruote
#
# Thu Jun 18 11:03:45 JST 2009
#
-require File.join(File.dirname(__FILE__), 'base')
+require File.expand_path('../base', __FILE__)
class EftWaitTest < Test::Unit::TestCase
include FunctionalBase
@@ -22,22 +22,22 @@
end
end
#noisy
- @engine.context.stash[:ts] = []
+ @dashboard.context.stash[:ts] = []
- @engine.register_participant(:alpha) { stash[:ts] << Time.now }
+ @dashboard.register_participant(:alpha) { stash[:ts] << Time.now }
assert_trace 'done.', pdef
d = (
- @engine.context.stash[:ts][1].sec - @engine.context.stash[:ts][0].sec
+ @dashboard.context.stash[:ts][1].sec - @dashboard.context.stash[:ts][0].sec
) % 60
- deltas = [ 2, 3 ]
- deltas << 4 if @engine.storage.class.name.match(/^Ruote::Couch::/)
+ deltas = [ 2, 3, 4 ]
+ #deltas << 4 if @dashboard.storage.class.name.match(/^Ruote::Couch::/)
assert(
deltas.include?(d),
"delta is #{d}, which isn't in #{deltas.inspect}")
end
@@ -52,27 +52,27 @@
end
end
#noisy
- wfid = @engine.launch(pdef)
+ wfid = @dashboard.launch(pdef)
wait_for(4)
- @engine.cancel_process(wfid)
+ @dashboard.cancel_process(wfid)
wait_for(wfid)
assert_equal 'a', @tracer.to_s
- assert_equal 0, @engine.storage.get_many('schedules').size
+ assert_equal 0, @dashboard.storage.get_many('schedules').size
end
def test_wait_until
- @engine.context.stash[:ts] = []
+ @dashboard.context.stash[:ts] = []
- @engine.register_participant(:alpha) { stash[:ts] << Time.now }
+ @dashboard.register_participant(:alpha) { stash[:ts] << Time.now }
pdef = Ruote.process_definition do
sequence do
alpha
wait :until => (Time.now + 2.0).to_s
@@ -83,11 +83,11 @@
#noisy
assert_trace 'done.', pdef
- ts0 = @engine.context.stash[:ts][0]
- ts1 = @engine.context.stash[:ts][1]
+ ts0 = @dashboard.context.stash[:ts][0]
+ ts1 = @dashboard.context.stash[:ts][1]
assert(ts1 - ts0 > 1.0, "#{ts1 - ts0} should be > 1.0")
end
def test_wait_until_now