test/ft_5_time.rb in openwferu-0.9.15 vs test/ft_5_time.rb in openwferu-0.9.16
- old
+ new
@@ -18,11 +18,10 @@
#def teardown
#end
def test_sleep_0
- #def xxxx_sleep_0
dotest(
'''<process-definition name="sleep_0" revision="0">
<sequence>
<sleep for="2s" />
<print>alpha</print>
@@ -31,11 +30,10 @@
"alpha",
true)
end
def test_sleep_1
- #def xxxx_sleep_1
dotest(
'''<process-definition name="sleep_1" revision="0">
<concurrence>
<sequence>
<sleep for="2s" />
@@ -48,11 +46,10 @@
alpha""",
true)
end
def test_sleep_2
- #def xxxx_sleep_2
dotest(
'''<process-definition name="sleep_2" revision="0">
<sequence>
<sleep until="${ruby:Time.new() + 4}" />
<print>alpha</print>
@@ -61,17 +58,61 @@
"alpha",
true)
end
def test_sleep_3
- #def xxxx_sleep_3
dotest(
'''<process-definition name="sleep_3" revision="0">
<sequence>
<sleep for="900" />
<print>alpha</print>
</sequence>
</process-definition>''', "alpha", true)
+ end
+
+ #
+ # Test 4
+ #
+
+ class Test4 < OpenWFE::ProcessDefinition
+ _sleep "10s"
+ end
+
+ def test_sleep_4
+
+ fei = @engine.launch Test4
+
+ sleep 0.250
+
+ jobs = @engine.get_scheduler.find_jobs SleepExpression.name
+
+ assert_equal 1, jobs.size
+
+ @engine.cancel_process fei
+
+ sleep 0.300
+ end
+
+ #
+ # Test 5
+ #
+
+ class Test5 < OpenWFE::ProcessDefinition
+ _sleep "10s", :scheduler_tags => "a, b"
+ end
+
+ def test_sleep_5
+
+ fei = @engine.launch Test5
+
+ sleep 0.250
+
+ assert_equal 1, @engine.get_scheduler.find_jobs("a").size
+ assert_equal 1, @engine.get_scheduler.find_jobs("b").size
+
+ @engine.cancel_process fei
+
+ sleep 0.300
end
end