openwferu 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +47 -0
- data/lib/codec.rb +571 -0
- data/lib/controlclient.rb +115 -0
- data/lib/definitions.rb +112 -0
- data/lib/exception.rb +60 -0
- data/lib/flowexpressionid.rb +137 -0
- data/lib/openwferu.rb +43 -0
- data/lib/osocket.rb +138 -0
- data/lib/otime.rb +171 -0
- data/lib/restclient.rb +155 -0
- data/lib/ru/contextual.rb +63 -0
- data/lib/ru/dollar.rb +163 -0
- data/lib/ru/engine.rb +130 -0
- data/lib/ru/environment.rb +140 -0
- data/lib/ru/expressionmap.rb +120 -0
- data/lib/ru/expressionpool.rb +339 -0
- data/lib/ru/expressionstorage.rb +97 -0
- data/lib/ru/fe_base.rb +105 -0
- data/lib/ru/fe_concurrence.rb +122 -0
- data/lib/ru/fe_define.rb +101 -0
- data/lib/ru/fe_misc.rb +96 -0
- data/lib/ru/fe_participant.rb +75 -0
- data/lib/ru/fe_raw.rb +173 -0
- data/lib/ru/fe_subprocess.rb +84 -0
- data/lib/ru/fe_time.rb +135 -0
- data/lib/ru/fe_utils.rb +123 -0
- data/lib/ru/fe_value.rb +225 -0
- data/lib/ru/flowexpression.rb +250 -0
- data/lib/ru/logging.rb +85 -0
- data/lib/ru/participant.rb +67 -0
- data/lib/ru/participantmap.rb +93 -0
- data/lib/ru/participants.rb +74 -0
- data/lib/ru/rudefinitions.rb +70 -0
- data/lib/ru/ruutils.rb +68 -0
- data/lib/ru/scheduler.rb +478 -0
- data/lib/ru/schedulers.rb +63 -0
- data/lib/ru/service.rb +64 -0
- data/lib/test.rb +220 -0
- data/lib/utils.rb +94 -0
- data/lib/workitem.rb +250 -0
- data/lib/worklistclient.rb +276 -0
- data/test/dollartest.rb +79 -0
- data/test/feitest.rb +130 -0
- data/test/flowtestbase.rb +86 -0
- data/test/ft_0.rb +161 -0
- data/test/ft_1_unset.rb +152 -0
- data/test/ft_2_concurrence.rb +34 -0
- data/test/ft_3_equals.rb +84 -0
- data/test/ft_4_misc.rb +128 -0
- data/test/ft_5_time.rb +56 -0
- data/test/misctest.rb +46 -0
- data/test/runtest.rb +21 -0
- data/test/rutest_utils.rb +15 -0
- data/test/timetest.rb +111 -0
- metadata +100 -0
data/test/ft_0.rb
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest0 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_print
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="n" revision="0">
|
24
|
+
<print>ok</print>
|
25
|
+
</process-definition>''', "ok")
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_participant
|
29
|
+
dotest(\
|
30
|
+
'''<process-definition name="n" revision="0">
|
31
|
+
<participant ref="test-alpha" />
|
32
|
+
</process-definition>''', "test-alpha")
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_sequence
|
36
|
+
dotest(\
|
37
|
+
'''<process-definition name="n" revision="0">
|
38
|
+
<sequence>
|
39
|
+
<print>a</print>
|
40
|
+
<print>b</print>
|
41
|
+
</sequence>
|
42
|
+
</process-definition>''', '''a
|
43
|
+
b''')
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_dollar_notation_0
|
47
|
+
dotest(\
|
48
|
+
'''<process-definition name="n" revision="0">
|
49
|
+
<sequence>
|
50
|
+
<set variable="x" value="y" />
|
51
|
+
<print>${x} ${v:x}</print>
|
52
|
+
</sequence>
|
53
|
+
</process-definition>''', 'y y')
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_dollar_notation_1
|
57
|
+
dotest(\
|
58
|
+
'''<process-definition name="n" revision="0">
|
59
|
+
<sequence>
|
60
|
+
<set field="x" value="y" />
|
61
|
+
<print>${f:x} ${field:x}</print>
|
62
|
+
</sequence>
|
63
|
+
</process-definition>''', 'y y')
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_dollar_notation_2
|
67
|
+
dotest(\
|
68
|
+
'''<process-definition name="n" revision="0">
|
69
|
+
<sequence>
|
70
|
+
<print>${f:x}X${field:x}</print>
|
71
|
+
</sequence>
|
72
|
+
</process-definition>''', 'X')
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_subprocess_ref_0
|
76
|
+
dotest(\
|
77
|
+
'''<process-definition name="subtest0" revision="0">
|
78
|
+
|
79
|
+
<subprocess ref="sub0" />
|
80
|
+
|
81
|
+
<process-definition name="sub0">
|
82
|
+
<print>ok</print>
|
83
|
+
</process-definition>
|
84
|
+
|
85
|
+
</process-definition>''', 'ok')
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_subprocess_ref_1
|
89
|
+
dotest(\
|
90
|
+
'''<process-definition name="subtest0" revision="0">
|
91
|
+
|
92
|
+
<sequence>
|
93
|
+
<subprocess ref="sub0" />
|
94
|
+
<subprocess ref="sub0" />
|
95
|
+
</sequence>
|
96
|
+
|
97
|
+
<process-definition name="sub0">
|
98
|
+
<print>ok</print>
|
99
|
+
</process-definition>
|
100
|
+
|
101
|
+
</process-definition>''', '''ok
|
102
|
+
ok''')
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_subprocess_ref_2
|
106
|
+
dotest(\
|
107
|
+
'''<process-definition name="subtest0" revision="0">
|
108
|
+
|
109
|
+
<sequence>
|
110
|
+
<sub0 />
|
111
|
+
<print>after</print>
|
112
|
+
</sequence>
|
113
|
+
|
114
|
+
<process-definition name="sub0">
|
115
|
+
<print>ok</print>
|
116
|
+
</process-definition>
|
117
|
+
|
118
|
+
</process-definition>''', '''ok
|
119
|
+
after''')
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_subprocess_ref_3
|
123
|
+
dotest(\
|
124
|
+
'''<process-definition name="subtest0" revision="0">
|
125
|
+
|
126
|
+
<sequence>
|
127
|
+
<set variable="v" value="out" />
|
128
|
+
<sub0 />
|
129
|
+
<print>after : ${v}</print>
|
130
|
+
</sequence>
|
131
|
+
|
132
|
+
<process-definition name="sub0">
|
133
|
+
<sequence>
|
134
|
+
<set variable="v" value="in" />
|
135
|
+
<print>ok : ${v}</print>
|
136
|
+
</sequence>
|
137
|
+
</process-definition>
|
138
|
+
|
139
|
+
</process-definition>''', '''ok : in
|
140
|
+
after : out''')
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_subprocess_ref_4
|
144
|
+
dotest(\
|
145
|
+
'''<process-definition name="subtest0" revision="0">
|
146
|
+
|
147
|
+
<sequence>
|
148
|
+
<subprocess ref="sub0" a="A" b="B" c="C" />
|
149
|
+
<sub0 a="A" b="B" c="C" />
|
150
|
+
</sequence>
|
151
|
+
|
152
|
+
<process-definition name="sub0">
|
153
|
+
<print>${a}${b}${c}</print>
|
154
|
+
</process-definition>
|
155
|
+
|
156
|
+
</process-definition>''', '''ABC
|
157
|
+
ABC''')
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
161
|
+
|
data/test/ft_1_unset.rb
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest1 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_unset_0
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="n" revision="0">
|
24
|
+
<sequence>
|
25
|
+
<set variable="x" value="y" />
|
26
|
+
<print>set ${x} ${v:x}</print>
|
27
|
+
<unset variable="x" />
|
28
|
+
<print>unset ${x} ${v:x}</print>
|
29
|
+
</sequence>
|
30
|
+
</process-definition>''', 'set y y
|
31
|
+
unset')
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_unset_1
|
35
|
+
dotest(\
|
36
|
+
'''<process-definition name="n" revision="0">
|
37
|
+
<sequence>
|
38
|
+
<set field="x" value="y" />
|
39
|
+
<print>set ${f:x}</print>
|
40
|
+
<unset field="x" />
|
41
|
+
<print>unset ${field:x}</print>
|
42
|
+
</sequence>
|
43
|
+
</process-definition>''', 'set y
|
44
|
+
unset')
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_unset_2
|
48
|
+
dotest(\
|
49
|
+
'''<process-definition name="n" revision="0">
|
50
|
+
<sequence>
|
51
|
+
<set variable="//x" value="y" />
|
52
|
+
<print>set ${x}</print>
|
53
|
+
<unset variable="x" />
|
54
|
+
<print>unset ${x}</print>
|
55
|
+
</sequence>
|
56
|
+
</process-definition>''', 'set y
|
57
|
+
unset y')
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_unset_3
|
61
|
+
dotest(\
|
62
|
+
'''<process-definition name="n" revision="0">
|
63
|
+
<sequence>
|
64
|
+
<set variable="//x" value="y" />
|
65
|
+
<print>set ${x}</print>
|
66
|
+
<unset variable="//x" />
|
67
|
+
<print>unset ${x}</print>
|
68
|
+
</sequence>
|
69
|
+
</process-definition>''', 'set y
|
70
|
+
unset')
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_unset_4
|
74
|
+
dotest(\
|
75
|
+
'''<process-definition name="n" revision="0">
|
76
|
+
<sequence>
|
77
|
+
<set variable="/x" value="y" />
|
78
|
+
<print>set ${x}</print>
|
79
|
+
<unset variable="x" />
|
80
|
+
<print>unset ${x}</print>
|
81
|
+
</sequence>
|
82
|
+
</process-definition>''', 'set y
|
83
|
+
unset')
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_unset_5
|
87
|
+
dotest(\
|
88
|
+
'''<process-definition name="n" revision="0">
|
89
|
+
<sequence>
|
90
|
+
<set variable="/x" value="y" />
|
91
|
+
<print>set ${x}</print>
|
92
|
+
<print>unset ${x}</print>
|
93
|
+
</sequence>
|
94
|
+
<process-definition name="sub0">
|
95
|
+
<unset variable="x" />
|
96
|
+
</process-definition>
|
97
|
+
</process-definition>''', 'set y
|
98
|
+
unset y')
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_unset_6
|
102
|
+
dotest(\
|
103
|
+
'''<process-definition name="unset_6" revision="0">
|
104
|
+
<sequence>
|
105
|
+
<set variable="/x" value="y" />
|
106
|
+
<print>set ${x}</print>
|
107
|
+
<sub0/>
|
108
|
+
<print>unset ${x}</print>
|
109
|
+
</sequence>
|
110
|
+
<process-definition name="sub0">
|
111
|
+
<unset variable="/x" />
|
112
|
+
</process-definition>
|
113
|
+
</process-definition>''', 'set y
|
114
|
+
unset')
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_set_a0
|
118
|
+
dotest(\
|
119
|
+
'''<process-definition name="set_a0" revision="0">
|
120
|
+
<sequence>
|
121
|
+
<set variable="x">y</set>
|
122
|
+
<print>${x}</print>
|
123
|
+
</sequence>
|
124
|
+
</process-definition>''', 'y')
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_set_a1
|
128
|
+
dotest(\
|
129
|
+
'''<process-definition name="set_a1" revision="0">
|
130
|
+
<sequence>
|
131
|
+
<set variable="x">
|
132
|
+
<equals value="a" other-value="a" />
|
133
|
+
</set>
|
134
|
+
<print>${x}</print>
|
135
|
+
</sequence>
|
136
|
+
</process-definition>''', 'true')
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_set_a1f
|
140
|
+
dotest(\
|
141
|
+
'''<process-definition name="set_a1f" revision="0">
|
142
|
+
<sequence>
|
143
|
+
<set variable="x">
|
144
|
+
<equals value="a" other-value="${x}" />
|
145
|
+
</set>
|
146
|
+
<print>${x}</print>
|
147
|
+
</sequence>
|
148
|
+
</process-definition>''', 'false')
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
152
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest2 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_concurrence
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="n" revision="0">
|
24
|
+
<concurrence>
|
25
|
+
<print>a</print>
|
26
|
+
<print>b</print>
|
27
|
+
</concurrence>
|
28
|
+
</process-definition>''', [ '''a,
|
29
|
+
b''', '''b
|
30
|
+
a''' ], 0.1 )
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
data/test/ft_3_equals.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest3 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_equals_0
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="equals_0" revision="0">
|
24
|
+
<sequence>
|
25
|
+
<equals value="a" other-value="a" />
|
26
|
+
<print>${field:__result__}</print>
|
27
|
+
</sequence>
|
28
|
+
</process-definition>''', "true")
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_equals_1
|
32
|
+
dotest(\
|
33
|
+
'''<process-definition name="equals_1" revision="0">
|
34
|
+
<sequence>
|
35
|
+
<equals value="a" other-value="b" />
|
36
|
+
<print>${field:__result__}</print>
|
37
|
+
</sequence>
|
38
|
+
</process-definition>''', "false")
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_if_0
|
42
|
+
dotest(\
|
43
|
+
'''<process-definition name="if_0" revision="0">
|
44
|
+
<if>
|
45
|
+
<equals value="a" other-value="a" />
|
46
|
+
<print>ok</print>
|
47
|
+
</if>
|
48
|
+
</process-definition>''', "ok")
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_if_1
|
52
|
+
dotest(\
|
53
|
+
'''<process-definition name="if_1" revision="0">
|
54
|
+
<if>
|
55
|
+
<equals value="a" other-value="a" />
|
56
|
+
<print>ok</print>
|
57
|
+
<print>nok</print>
|
58
|
+
</if>
|
59
|
+
</process-definition>''', "ok")
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_if_2
|
63
|
+
dotest(\
|
64
|
+
'''<process-definition name="if_2" revision="0">
|
65
|
+
<if>
|
66
|
+
<equals value="a" other-value="b" />
|
67
|
+
<print>nok</print>
|
68
|
+
</if>
|
69
|
+
</process-definition>''', "")
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_if_3
|
73
|
+
dotest(\
|
74
|
+
'''<process-definition name="if_3" revision="0">
|
75
|
+
<if>
|
76
|
+
<equals value="a" other-value="b" />
|
77
|
+
<print>nok</print>
|
78
|
+
<print>ok</print>
|
79
|
+
</if>
|
80
|
+
</process-definition>''', "ok")
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
data/test/ft_4_misc.rb
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest4 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_print_0
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="print_0" revision="0">
|
24
|
+
<sequence>
|
25
|
+
<print escape="true">${f:xxx}</print>
|
26
|
+
</sequence>
|
27
|
+
</process-definition>''', "${f:xxx}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_reval_0
|
31
|
+
dotest(\
|
32
|
+
'''<process-definition name="reval_0" revision="0">
|
33
|
+
<sequence>
|
34
|
+
<reval><![CDATA[
|
35
|
+
workitem.attributes["from_ruby"] = "ok"
|
36
|
+
]]></reval>
|
37
|
+
<print>${f:from_ruby}</print>
|
38
|
+
</sequence>
|
39
|
+
</process-definition>''', "ok")
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_reval_1
|
43
|
+
dotest(\
|
44
|
+
'''<process-definition name="reval_1" revision="0">
|
45
|
+
<sequence>
|
46
|
+
<set variable="field-name" value="from_ruby" />
|
47
|
+
<reval>
|
48
|
+
workitem.attributes["${field-name}"] = "ok"
|
49
|
+
</reval>
|
50
|
+
<print>${f:${field-name}}</print>
|
51
|
+
</sequence>
|
52
|
+
</process-definition>''', "ok")
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_reval_2
|
56
|
+
dotest(\
|
57
|
+
'''<process-definition name="reval_2" revision="0">
|
58
|
+
<sequence>
|
59
|
+
<set variable="field-value" value="ok" />
|
60
|
+
<reval>
|
61
|
+
workitem.attributes["from_ruby"] = "${field-value}"
|
62
|
+
</reval>
|
63
|
+
<print>${f:from_ruby}</print>
|
64
|
+
</sequence>
|
65
|
+
</process-definition>''', "ok")
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_reval_3
|
69
|
+
dotest(\
|
70
|
+
'''<process-definition name="reval_3" revision="0">
|
71
|
+
<sequence>
|
72
|
+
<set variable="v">
|
73
|
+
<reval code="1 == 2" />
|
74
|
+
</set>
|
75
|
+
<print>${v}</print>
|
76
|
+
</sequence>
|
77
|
+
</process-definition>''', "false")
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_dru_0
|
81
|
+
dotest(\
|
82
|
+
'''<process-definition name="dru_0" revision="0">
|
83
|
+
<sequence>
|
84
|
+
<print>${r:1+2}</print>
|
85
|
+
</sequence>
|
86
|
+
</process-definition>''', "3")
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_dru_1
|
90
|
+
dotest(\
|
91
|
+
'''<process-definition name="dru_1" revision="0">
|
92
|
+
<sequence>
|
93
|
+
<print>${r:"x"*3}</print>
|
94
|
+
</sequence>
|
95
|
+
</process-definition>''', "xxx")
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_dru_2
|
99
|
+
dotest(\
|
100
|
+
'''<process-definition name="dru_2" revision="0">
|
101
|
+
<sequence>
|
102
|
+
<set
|
103
|
+
variable="v"
|
104
|
+
value="${r:5*2}"
|
105
|
+
/>
|
106
|
+
<print>${v}</print>
|
107
|
+
</sequence>
|
108
|
+
</process-definition>''', "10")
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_dru_3
|
112
|
+
dotest(\
|
113
|
+
'''<process-definition name="dru_3" revision="0">
|
114
|
+
<sequence>
|
115
|
+
<set variable="w" value="W" />
|
116
|
+
<set variable="v">
|
117
|
+
<!--
|
118
|
+
<reval>self.lookup_variable("w") * 3</reval>
|
119
|
+
-->
|
120
|
+
<reval>lookup_variable("w") * 3</reval>
|
121
|
+
</set>
|
122
|
+
<print>${v}</print>
|
123
|
+
</sequence>
|
124
|
+
</process-definition>''', "WWW")
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
data/test/ft_5_time.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
|
12
|
+
|
13
|
+
class FlowTest5 < FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
def test_sleep_0
|
22
|
+
dotest(\
|
23
|
+
'''<process-definition name="sleep_0" revision="0">
|
24
|
+
<sequence>
|
25
|
+
<sleep for="2s" />
|
26
|
+
<print>alpha</print>
|
27
|
+
</sequence>
|
28
|
+
</process-definition>''', """alpha""", 3)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_sleep_1
|
32
|
+
dotest(\
|
33
|
+
'''<process-definition name="sleep_1" revision="0">
|
34
|
+
<concurrence>
|
35
|
+
<sequence>
|
36
|
+
<sleep for="2s" />
|
37
|
+
<print>alpha</print>
|
38
|
+
</sequence>
|
39
|
+
<print>bravo</print>
|
40
|
+
</concurrence>
|
41
|
+
</process-definition>''', """bravo
|
42
|
+
alpha""", 3)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_sleep_2
|
46
|
+
dotest(\
|
47
|
+
'''<process-definition name="sleep_2" revision="0">
|
48
|
+
<sequence>
|
49
|
+
<sleep until="${ruby:Time.new() + 4}" />
|
50
|
+
<print>alpha</print>
|
51
|
+
</sequence>
|
52
|
+
</process-definition>''', """alpha""", 5)
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
data/test/misctest.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Sun Oct 29 16:18:25 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'test/unit'
|
11
|
+
require 'ru/ruutils'
|
12
|
+
require 'ru/expressionmap'
|
13
|
+
require 'ru/fe_define'
|
14
|
+
|
15
|
+
#
|
16
|
+
# testing misc things
|
17
|
+
#
|
18
|
+
|
19
|
+
class MiscTest < Test::Unit::TestCase
|
20
|
+
|
21
|
+
#def setup
|
22
|
+
#end
|
23
|
+
|
24
|
+
#def teardown
|
25
|
+
#end
|
26
|
+
|
27
|
+
def test_starts_with
|
28
|
+
assert \
|
29
|
+
OpenWFEru::starts_with("//a", "//")
|
30
|
+
assert \
|
31
|
+
(not OpenWFEru::starts_with("/a", "//"))
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_expression_map
|
35
|
+
|
36
|
+
em = OpenWFEru::ExpressionMap.new('expressionmap', {})
|
37
|
+
|
38
|
+
assert \
|
39
|
+
em.get_class('process-definition') == OpenWFEru::DefineExpression,
|
40
|
+
"class of 'process-definition' should be DefineExpression"
|
41
|
+
assert \
|
42
|
+
em.is_definition?('process-definition'),
|
43
|
+
"process-definition should be considered as a definition"
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
data/test/runtest.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#
|
2
|
+
# Testing OpenWFEru
|
3
|
+
#
|
4
|
+
# John Mettraux at openwfe.org
|
5
|
+
#
|
6
|
+
# Mon Oct 9 22:19:44 JST 2006
|
7
|
+
#
|
8
|
+
|
9
|
+
#require 'test/unit'
|
10
|
+
|
11
|
+
require 'ft_2_concurrence'
|
12
|
+
require 'feitest'
|
13
|
+
require 'dollartest'
|
14
|
+
require 'misctest'
|
15
|
+
require 'timetest'
|
16
|
+
require 'ft_0'
|
17
|
+
require 'ft_1_unset'
|
18
|
+
require 'ft_3_equals'
|
19
|
+
require 'ft_4_misc'
|
20
|
+
require 'ft_5_time'
|
21
|
+
|