test/ft_21_cron.rb in ruote-0.9.18 vs test/ft_21_cron.rb in ruote-0.9.19
- old
+ new
@@ -8,80 +8,80 @@
require 'flowtestbase'
require 'openwfe/def'
class FlowTest21 < Test::Unit::TestCase
- include FlowTestBase
+ include FlowTestBase
- #def setup
- #end
+ #def setup
+ #end
- #def teardown
- #end
+ #def teardown
+ #end
- #
- # Test 0
- #
+ #
+ # Test 0
+ #
- class TestDefinition0 < OpenWFE::ProcessDefinition
- cron :tab => "* * * * *", :name => "cron" do
- participant :cron_event
- end
+ class TestDefinition0 < OpenWFE::ProcessDefinition
+ cron :tab => "* * * * *", :name => "cron" do
+ participant :cron_event
end
+ end
- #
- # this one tests whether a cron event is removed when his process
- # terminates, as should be.
- #
- def test_0
+ #
+ # this one tests whether a cron event is removed when his process
+ # terminates, as should be.
+ #
+ def test_0
- #log_level_to_debug
+ #log_level_to_debug
- @engine.register_participant(:cron_event) do
- puts " :( cron_event at #{Time.now.to_s}"
- @tracer << "cron_event"
- end
+ @engine.register_participant(:cron_event) do
+ puts " :( cron_event at #{Time.now.to_s}"
+ @tracer << "cron_event"
+ end
- #puts "start at #{Time.now.to_s}"
- #dotest TestDefinition0, "", 62
+ #puts "start at #{Time.now.to_s}"
+ #dotest TestDefinition0, "", 62
- fei = launch TestDefinition0
+ fei = launch TestDefinition0
- sleep 0.350
+ sleep 0.350
- assert_equal "", @tracer.to_s
- assert_not_nil @engine.process_status(fei)
+ assert_equal "", @tracer.to_s
+ assert_not_nil @engine.process_status(fei)
- @engine.cancel_process fei
+ @engine.cancel_process fei
- sleep 0.350
+ sleep 0.350
- assert_nil @engine.process_status(fei)
- assert_equal 1, @engine.get_expression_storage.size
- end
+ assert_nil @engine.process_status(fei)
+ assert_equal 1, @engine.get_expression_storage.size
+ end
- #
- # Test 1
- #
+ #
+ # Test 1
+ #
- class TestDefinition1 < OpenWFE::ProcessDefinition
- concurrence :count => 1 do
- cron :every => "1s500" do
- participant :cron_event
- end
- _sleep "7s"
- end
+ class TestDefinition1 < OpenWFE::ProcessDefinition
+ concurrence :count => 1 do
+ cron :every => "1s500" do
+ participant :cron_event
+ end
+ _sleep "7s"
end
+ end
- def test_1
+ def test_1
- #log_level_to_debug
+ #log_level_to_debug
- @engine.register_participant(:cron_event) do
- @tracer << "x"
- end
-
- dotest TestDefinition1, [ "xxxx", "xxxxx" ]
+ @engine.register_participant(:cron_event) do
+ @tracer << "x"
end
+
+ dotest TestDefinition1, [ "xxxx", "xxxxx" ]
+ end
end