test/ft_21_cron.rb in openwferu-0.9.13 vs test/ft_21_cron.rb in openwferu-0.9.14
- old
+ new
@@ -24,25 +24,51 @@
#
# Test 0
#
class TestDefinition0 < ProcessDefinition
- def make
- process_definition :name => "rs0", :revision => "0" do
- cron :tab => "* * * * *", :name => "cron" do
- participant :cron_event
- end
- end
+ 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
+ #log_level_to_debug
+
@engine.register_participant(:cron_event) do
@tracer << "cron_event"
end
dotest(TestDefinition0, "", 62)
+ end
+
+ #
+ # Test 1
+ #
+
+ class TestDefinition1 < ProcessDefinition
+ sequence do
+ cron :every => "2s", :name => "cron" do
+ participant :cron_event
+ end
+ _sleep "10s"
+ end
+ end
+
+ def test_1
+
+ #log_level_to_debug
+
+ @engine.register_participant(:cron_event) do
+ @tracer << "."
+ end
+
+ dotest(TestDefinition1, [ "....", "....." ])
end
end