test/ft_2_concurrence.rb in openwferu-0.9.4 vs test/ft_2_concurrence.rb in openwferu-0.9.5
- old
+ new
@@ -5,47 +5,121 @@
# John Mettraux at openwfe.org
#
# Mon Oct 9 22:19:44 JST 2006
#
+require 'openwfe/def'
require 'flowtestbase'
-class FlowTest2 < FlowTestBase
+class FlowTest2 < Test::Unit::TestCase
+ include FlowTestBase
#def setup
#end
#def teardown
#end
- #def xxxx_con_0
- def test_con_0
- dotest(\
-'''<process-definition name="con" revision="0">
- <concurrence>
- <print>a</print>
- <print>b</print>
- </concurrence>
-</process-definition>''', [ '''a
-b''', '''b
-a''' ])
- end
+ # test_con_0 got moved to ft_2c_concurrence.rb
#def xxxx_con_1
def test_con_1
- dotest(\
+ dotest(
'''<process-definition name="con" revision="1">
<concurrence
count="1"
>
<print>a</print>
<sequence>
<sleep for="10s" />
<print>b</print>
</sequence>
</concurrence>
-</process-definition>''', "a", 0.1, false )
+</process-definition>''',
+ "a",
+ 0.03,
+ false)
+ end
+
+ #def xxxx_con_2
+ def test_con_2
+ dotest(
+'''<process-definition name="con" revision="2">
+ <concurrence over-if="true">
+ <sequence>
+ <sleep for="1s"/>
+ <print>a</print>
+ </sequence>
+ <print>b</print>
+ </concurrence>
+</process-definition>''',
+ "b")
+ end
+
+ #def xxxx_con_3
+ def test_con_3
+ dotest(
+'''<process-definition name="con" revision="3">
+ <concurrence over-if="${over}">
+ <print>a</print>
+ <set variable="over" value="true" />
+ </concurrence>
+</process-definition>''',
+ "a")
+ end
+
+ #def xxxx_con_4
+ def test_con_4
+ dotest(
+'''<process-definition name="con" revision="4">
+ <concurrence over-if="${nada}">
+ <sequence>
+ <sleep for="1s"/>
+ <print>a</print>
+ </sequence>
+ <print>b</print>
+ </concurrence>
+</process-definition>''',
+ """b
+a""",
+ 2)
+ end
+
+ #def xxxx_con_5
+ def test_con_5
+ dotest(
+'''<process-definition name="con" revision="5">
+ <concurrence over-if="false">
+ <sequence>
+ <sleep for="1s"/>
+ <print>a</print>
+ </sequence>
+ <print>b</print>
+ </concurrence>
+</process-definition>''',
+ """b
+a""",
+ 2)
+ end
+
+ class TestDefinition6 < ProcessDefinition
+ def make
+ process_definition :name => "con", :revision => "6" do
+ concurrence :over_if => "1 == 1" do
+ sequence do
+ _sleep :for => "350"
+ _print "a"
+ end
+ _print "b"
+ end
+ end
+ end
+ end
+
+ #def xxxx_con_6
+ def test_con_6
+ dotest(TestDefinition6, "b")
end
end