openwferu 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/mano_tracker.rb +13 -6
- data/examples/quotereporter.rb +3 -2
- data/lib/openwfe/engine/engine.rb +31 -4
- data/lib/openwfe/engine/file_persisted_engine.rb +35 -9
- data/lib/openwfe/expool/expressionpool.rb +116 -67
- data/lib/openwfe/expool/expstorage.rb +142 -101
- data/lib/openwfe/expool/history.rb +7 -2
- data/lib/openwfe/expool/yamlexpstorage.rb +150 -6
- data/lib/openwfe/expressions/{fe_condition.rb → condition.rb} +4 -6
- data/lib/openwfe/expressions/expressionmap.rb +8 -0
- data/lib/openwfe/expressions/fe_cancel.rb +109 -0
- data/lib/openwfe/expressions/fe_concurrence.rb +252 -16
- data/lib/openwfe/expressions/fe_cursor.rb +8 -3
- data/lib/openwfe/{util/stoppable.rb → expressions/fe_do.rb} +42 -11
- data/lib/openwfe/expressions/fe_iterator.rb +4 -3
- data/lib/openwfe/expressions/fe_misc.rb +3 -2
- data/lib/openwfe/expressions/fe_participant.rb +5 -0
- data/lib/openwfe/expressions/fe_raw.rb +10 -2
- data/lib/openwfe/expressions/fe_subprocess.rb +1 -1
- data/lib/openwfe/expressions/fe_time.rb +43 -23
- data/lib/openwfe/expressions/fe_value.rb +1 -1
- data/lib/openwfe/expressions/flowexpression.rb +22 -22
- data/lib/openwfe/expressions/raw_prog.rb +20 -39
- data/lib/openwfe/expressions/raw_xml.rb +6 -6
- data/lib/openwfe/expressions/timeout.rb +8 -3
- data/lib/openwfe/expressions/wtemplate.rb +67 -0
- data/lib/openwfe/flowexpressionid.rb +4 -1
- data/lib/openwfe/participants/atomparticipants.rb +13 -1
- data/lib/openwfe/participants/enoparticipant.rb +66 -5
- data/lib/openwfe/participants/participantmap.rb +12 -0
- data/lib/openwfe/rudefinitions.rb +15 -3
- data/lib/openwfe/service.rb +4 -5
- data/lib/openwfe/storage/yamlfilestorage.rb +72 -45
- data/lib/openwfe/util/dollar.rb +17 -4
- data/lib/openwfe/util/lru.rb +154 -0
- data/lib/openwfe/util/otime.rb +26 -5
- data/lib/openwfe/util/scheduler.rb +44 -36
- data/lib/openwfe/util/schedulers.rb +4 -2
- data/lib/openwfe/utils.rb +62 -0
- data/lib/openwfe/version.rb +1 -1
- data/lib/openwfe/worklist/storeparticipant.rb +34 -5
- data/test/eno_test.rb +69 -0
- data/test/file_persistence_test.rb +13 -11
- data/test/flowtestbase.rb +29 -15
- data/test/ft_0.rb +2 -1
- data/test/ft_0b_sequence.rb +2 -1
- data/test/ft_0c_testname.rb +6 -5
- data/test/ft_0d_participant.rb +2 -1
- data/test/ft_10_loop.rb +11 -6
- data/test/ft_10b_loop2.rb +63 -0
- data/test/ft_11_ppd.rb +39 -13
- data/test/ft_12_blockparticipant.rb +2 -1
- data/test/ft_13_eno.rb +3 -2
- data/test/ft_14_subprocess.rb +2 -1
- data/test/ft_14b_subprocess.rb +2 -1
- data/test/ft_15_iterator.rb +2 -1
- data/test/ft_16_fqv.rb +2 -1
- data/test/ft_17_condition.rb +2 -1
- data/test/ft_18_pname.rb +2 -1
- data/test/ft_19_csv.rb +2 -1
- data/test/ft_1_unset.rb +14 -18
- data/test/ft_1b_unset.rb +39 -0
- data/test/ft_20_cron.rb +2 -1
- data/test/ft_21_cron.rb +2 -1
- data/test/ft_22_history.rb +7 -5
- data/test/ft_23_when.rb +2 -1
- data/test/ft_23b_when.rb +2 -1
- data/test/ft_24_def.rb +2 -1
- data/test/ft_25_cancel.rb +79 -0
- data/test/ft_26_load.rb +197 -0
- data/test/ft_2_concurrence.rb +89 -15
- data/test/ft_2b_concurrence.rb +152 -0
- data/test/ft_2c_concurrence.rb +39 -0
- data/test/ft_3_equals.rb +4 -3
- data/test/ft_4_misc.rb +4 -3
- data/test/ft_5_time.rb +2 -1
- data/test/ft_6_lambda.rb +2 -1
- data/test/ft_7_lose.rb +53 -17
- data/test/ft_8_forget.rb +7 -6
- data/test/ft_9_cursor.rb +8 -7
- data/test/hparticipant_test.rb +37 -14
- data/test/lru_test.rb +79 -0
- data/test/misc_test.rb +16 -0
- data/test/rake_qtest.rb +7 -0
- data/test/raw_prog_test.rb +0 -13
- data/test/rutest_utils.rb +15 -2
- data/test/scheduler_test.rb +31 -4
- data/test/timeout_test.rb +6 -2
- data/test/wfid_test.rb +68 -0
- metadata +169 -158
- data/lib/openwfe/expool/journalexpstorage.rb +0 -312
- data/lib/openwfe/util/lru_cache.rb +0 -149
data/test/ft_19_csv.rb
CHANGED
data/test/ft_1_unset.rb
CHANGED
@@ -10,7 +10,8 @@
|
|
10
10
|
require 'flowtestbase'
|
11
11
|
|
12
12
|
|
13
|
-
class FlowTest1 <
|
13
|
+
class FlowTest1 < Test::Unit::TestCase
|
14
|
+
include FlowTestBase
|
14
15
|
|
15
16
|
#def setup
|
16
17
|
#end
|
@@ -18,6 +19,7 @@ class FlowTest1 < FlowTestBase
|
|
18
19
|
#def teardown
|
19
20
|
#end
|
20
21
|
|
22
|
+
#def xxxx_unset_0
|
21
23
|
def test_unset_0
|
22
24
|
dotest(\
|
23
25
|
'''<process-definition name="n" revision="0">
|
@@ -31,7 +33,8 @@ class FlowTest1 < FlowTestBase
|
|
31
33
|
unset')
|
32
34
|
end
|
33
35
|
|
34
|
-
def
|
36
|
+
#def xxxx_unset_1
|
37
|
+
def test_unset_2
|
35
38
|
dotest(\
|
36
39
|
'''<process-definition name="n" revision="0">
|
37
40
|
<sequence>
|
@@ -44,6 +47,7 @@ unset')
|
|
44
47
|
unset')
|
45
48
|
end
|
46
49
|
|
50
|
+
#def xxxx_unset_2
|
47
51
|
def test_unset_2
|
48
52
|
dotest(\
|
49
53
|
'''<process-definition name="n" revision="0">
|
@@ -57,6 +61,7 @@ unset')
|
|
57
61
|
unset y')
|
58
62
|
end
|
59
63
|
|
64
|
+
#def xxxx_unset_3
|
60
65
|
def test_unset_3
|
61
66
|
dotest(\
|
62
67
|
'''<process-definition name="n" revision="0">
|
@@ -70,6 +75,7 @@ unset y')
|
|
70
75
|
unset')
|
71
76
|
end
|
72
77
|
|
78
|
+
#def xxxx_unset_4
|
73
79
|
def test_unset_4
|
74
80
|
dotest(\
|
75
81
|
'''<process-definition name="n" revision="0">
|
@@ -83,6 +89,7 @@ unset')
|
|
83
89
|
unset')
|
84
90
|
end
|
85
91
|
|
92
|
+
#def xxxx_unset_5
|
86
93
|
def test_unset_5
|
87
94
|
dotest(\
|
88
95
|
'''<process-definition name="n" revision="0">
|
@@ -98,22 +105,7 @@ unset')
|
|
98
105
|
unset y')
|
99
106
|
end
|
100
107
|
|
101
|
-
def
|
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
|
-
|
108
|
+
#def xxxx_set_a0
|
117
109
|
def test_set_a0
|
118
110
|
dotest(\
|
119
111
|
'''<process-definition name="set_a0" revision="0">
|
@@ -124,6 +116,7 @@ unset')
|
|
124
116
|
</process-definition>''', 'y')
|
125
117
|
end
|
126
118
|
|
119
|
+
#def xxxx_set_a1
|
127
120
|
def test_set_a1
|
128
121
|
dotest(\
|
129
122
|
'''<process-definition name="set_a1" revision="0">
|
@@ -136,6 +129,7 @@ unset')
|
|
136
129
|
</process-definition>''', 'true')
|
137
130
|
end
|
138
131
|
|
132
|
+
#def xxxx_set_a1f
|
139
133
|
def test_set_a1f
|
140
134
|
dotest(\
|
141
135
|
'''<process-definition name="set_a1f" revision="0">
|
@@ -148,6 +142,7 @@ unset')
|
|
148
142
|
</process-definition>''', 'false')
|
149
143
|
end
|
150
144
|
|
145
|
+
#def xxxx_set_with_nested_string_0
|
151
146
|
def test_set_with_nested_string_0
|
152
147
|
dotest(\
|
153
148
|
'''<process-definition name="set_a1f" revision="0">
|
@@ -160,6 +155,7 @@ unset')
|
|
160
155
|
</process-definition>''', '4321')
|
161
156
|
end
|
162
157
|
|
158
|
+
#def xxxx_set_with_nested_string_1
|
163
159
|
def test_set_with_nested_string_1
|
164
160
|
dotest(\
|
165
161
|
'''<process-definition name="set_a1f" revision="0">
|
data/test/ft_1b_unset.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
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 FlowTest1b < Test::Unit::TestCase
|
14
|
+
include FlowTestBase
|
15
|
+
|
16
|
+
#def setup
|
17
|
+
#end
|
18
|
+
|
19
|
+
#def teardown
|
20
|
+
#end
|
21
|
+
|
22
|
+
def test_unset_6
|
23
|
+
dotest(\
|
24
|
+
'''<process-definition name="unset_6" revision="0">
|
25
|
+
<sequence>
|
26
|
+
<set variable="/x" value="y" />
|
27
|
+
<print>set ${x}</print>
|
28
|
+
<sub0/>
|
29
|
+
<print>unset ${x}</print>
|
30
|
+
</sequence>
|
31
|
+
<process-definition name="sub0">
|
32
|
+
<unset variable="/x" />
|
33
|
+
</process-definition>
|
34
|
+
</process-definition>''', 'set y
|
35
|
+
unset')
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
data/test/ft_20_cron.rb
CHANGED
data/test/ft_21_cron.rb
CHANGED
data/test/ft_22_history.rb
CHANGED
@@ -14,7 +14,8 @@ require 'openwfe/expressions/raw_prog'
|
|
14
14
|
include OpenWFE
|
15
15
|
|
16
16
|
|
17
|
-
class FlowTest22 <
|
17
|
+
class FlowTest22 < Test::Unit::TestCase
|
18
|
+
include FlowTestBase
|
18
19
|
|
19
20
|
#def setup
|
20
21
|
#end
|
@@ -57,11 +58,12 @@ c""")
|
|
57
58
|
#f.write(history.to_s)
|
58
59
|
#f.close()
|
59
60
|
|
61
|
+
#assert \
|
62
|
+
# (history.entries.size == 36),
|
63
|
+
# "invalid history count : #{history.entries.size}"
|
60
64
|
assert \
|
61
|
-
(history.entries.size
|
62
|
-
"
|
63
|
-
|
64
|
-
# 37 in case of persisted engine (it's slower, so rescheduling kicks in)
|
65
|
+
(history.entries.size > 33 and history.entries.size < 39),
|
66
|
+
"invalid history count : #{history.entries.size}"
|
65
67
|
end
|
66
68
|
|
67
69
|
end
|
data/test/ft_23_when.rb
CHANGED
data/test/ft_23b_when.rb
CHANGED
data/test/ft_24_def.rb
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Oct 9 22:19:44 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'openwfe/def'
|
11
|
+
require 'flowtestbase'
|
12
|
+
|
13
|
+
|
14
|
+
class FlowTest25 < Test::Unit::TestCase
|
15
|
+
include FlowTestBase
|
16
|
+
|
17
|
+
#def teardown
|
18
|
+
#end
|
19
|
+
|
20
|
+
#def setup
|
21
|
+
#end
|
22
|
+
|
23
|
+
#
|
24
|
+
# TEST 0
|
25
|
+
|
26
|
+
def test_cancel_0
|
27
|
+
dotest(\
|
28
|
+
'''<process-definition name="25_cancel" revision="0">
|
29
|
+
<sequence>
|
30
|
+
<print>before</print>
|
31
|
+
<cancel-process/>
|
32
|
+
<print>after</print>
|
33
|
+
</sequence>
|
34
|
+
</process-definition>''',
|
35
|
+
"before")
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
#
|
40
|
+
# TEST 1
|
41
|
+
|
42
|
+
class TestDefinition1 < ProcessDefinition
|
43
|
+
def make
|
44
|
+
_process_definition :name => "25_cancel", :revision => "1" do
|
45
|
+
_sequence do
|
46
|
+
_print "before"
|
47
|
+
_cancel_process
|
48
|
+
_print "after"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_cancel_1
|
55
|
+
dotest(TestDefinition1, "before")
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
#
|
60
|
+
# TEST 2
|
61
|
+
|
62
|
+
class TestDefinition2 < ProcessDefinition
|
63
|
+
def make
|
64
|
+
_process_definition :name => "25_cancel", :revision => "2" do
|
65
|
+
_sequence do
|
66
|
+
_print "before"
|
67
|
+
_cancel_process :if => "false"
|
68
|
+
_print "after"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_cancel_2
|
75
|
+
dotest(TestDefinition2, "before\nafter")
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
data/test/ft_26_load.rb
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Tue Jan 2 13:14:37 JST 2007
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
require 'openwfe/expressions/raw_prog'
|
12
|
+
|
13
|
+
include OpenWFE
|
14
|
+
|
15
|
+
|
16
|
+
class FlowTest26 < Test::Unit::TestCase
|
17
|
+
include FlowTestBase
|
18
|
+
|
19
|
+
#def setup
|
20
|
+
#end
|
21
|
+
|
22
|
+
#def teardown
|
23
|
+
#end
|
24
|
+
|
25
|
+
#
|
26
|
+
# Test 0
|
27
|
+
#
|
28
|
+
|
29
|
+
class TestDefinition0 < ProcessDefinition
|
30
|
+
def make
|
31
|
+
process_definition :name => "test0", :revision => "0" do
|
32
|
+
sequence do
|
33
|
+
count
|
34
|
+
count
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
#def xxxx_load_0
|
41
|
+
def test_load_0
|
42
|
+
|
43
|
+
map = {}
|
44
|
+
|
45
|
+
@engine.register_participant("count") do |workitem|
|
46
|
+
count = map[workitem.flow_id]
|
47
|
+
count = unless count
|
48
|
+
1
|
49
|
+
else
|
50
|
+
count + 1
|
51
|
+
end
|
52
|
+
map[workitem.flow_id] = count
|
53
|
+
end
|
54
|
+
|
55
|
+
n = 100
|
56
|
+
|
57
|
+
n.times do |i|
|
58
|
+
li = LaunchItem.new(TestDefinition0)
|
59
|
+
li.flow_id = i
|
60
|
+
@engine.launch(li)
|
61
|
+
end
|
62
|
+
|
63
|
+
good = true
|
64
|
+
|
65
|
+
n.times do |i|
|
66
|
+
c = map[i]
|
67
|
+
if c == 2
|
68
|
+
print "."
|
69
|
+
else
|
70
|
+
print c
|
71
|
+
good = false
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
#puts "\n__good ? #{good}"
|
76
|
+
assert good, "missing count"
|
77
|
+
|
78
|
+
# 100 in 1s (in memory engine)
|
79
|
+
# 1'000 in 14s (in memory engine)
|
80
|
+
# 10'000 in 143s (in memory engine)
|
81
|
+
# 1'000 in 31s (cache engine)
|
82
|
+
# 10'000 in 321s (cache engine)
|
83
|
+
# 1'000 in 113s (persistence only engine)
|
84
|
+
# 10'000 in 1173s (persistence only engine)
|
85
|
+
#
|
86
|
+
#
|
87
|
+
# ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3]
|
88
|
+
#
|
89
|
+
# Machine Name: Mac
|
90
|
+
# Machine Model: MacBook2,1
|
91
|
+
# Processor Name: Intel Core 2 Duo
|
92
|
+
# Processor Speed: 2 GHz
|
93
|
+
# Number Of Processors: 1
|
94
|
+
# Total Number Of Cores: 2
|
95
|
+
# L2 Cache (per processor): 4 MB
|
96
|
+
# Memory: 2 GB
|
97
|
+
# Bus Speed: 667 MHz
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
#
|
102
|
+
# TEST 1
|
103
|
+
#
|
104
|
+
|
105
|
+
def xxxx_load_1
|
106
|
+
#def test_load_1
|
107
|
+
|
108
|
+
map = {}
|
109
|
+
|
110
|
+
@engine.register_participant("count") do |workitem|
|
111
|
+
count = map[workitem.flow_id]
|
112
|
+
count = unless count
|
113
|
+
1
|
114
|
+
else
|
115
|
+
count + 1
|
116
|
+
end
|
117
|
+
map[workitem.flow_id] = count
|
118
|
+
#puts "(#{workitem.flow_id} => #{map[workitem.flow_id]})"
|
119
|
+
end
|
120
|
+
|
121
|
+
n = 100
|
122
|
+
|
123
|
+
n.times do |i|
|
124
|
+
|
125
|
+
#t = Thread.new do
|
126
|
+
# begin
|
127
|
+
# li = LaunchItem.new(TestDefinition0)
|
128
|
+
# li.flow_id = i
|
129
|
+
# @engine.launch(li)
|
130
|
+
# #print "."
|
131
|
+
# rescue Exception => e
|
132
|
+
# print "e"
|
133
|
+
# @engine.lwarn do
|
134
|
+
# "ft_26_test_1 exception...\n" +
|
135
|
+
# OpenWFE::exception_to_s(e)
|
136
|
+
# end
|
137
|
+
# end
|
138
|
+
#end
|
139
|
+
|
140
|
+
li = LaunchItem.new(TestDefinition0)
|
141
|
+
li.flow_id = i
|
142
|
+
|
143
|
+
fei, t = @engine.launch(li, true)
|
144
|
+
#
|
145
|
+
# async : true
|
146
|
+
|
147
|
+
t.join if i == n-1
|
148
|
+
end
|
149
|
+
|
150
|
+
sleep(1)
|
151
|
+
puts
|
152
|
+
|
153
|
+
good = true
|
154
|
+
|
155
|
+
n.times do |i|
|
156
|
+
|
157
|
+
c = map[i]
|
158
|
+
|
159
|
+
if c == 2
|
160
|
+
print "."
|
161
|
+
elsif c == nil
|
162
|
+
print "x"
|
163
|
+
good = false
|
164
|
+
else
|
165
|
+
print c
|
166
|
+
good = false
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
#puts "\n__good ? #{good}"
|
171
|
+
|
172
|
+
assert good, "missing count"
|
173
|
+
|
174
|
+
# 100 in 3s (in memory engine)
|
175
|
+
# 1'000 in 85s (in memory engine)
|
176
|
+
# 10'000 in s (in memory engine)
|
177
|
+
# 1'000 in 551s (cache engine)
|
178
|
+
# 10'000 in s (cache engine)
|
179
|
+
# 1'000 in s (persistence only engine)
|
180
|
+
# 10'000 in s (persistence only engine)
|
181
|
+
#
|
182
|
+
#
|
183
|
+
# ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3]
|
184
|
+
#
|
185
|
+
# Machine Name: Mac
|
186
|
+
# Machine Model: MacBook2,1
|
187
|
+
# Processor Name: Intel Core 2 Duo
|
188
|
+
# Processor Speed: 2 GHz
|
189
|
+
# Number Of Processors: 1
|
190
|
+
# Total Number Of Cores: 2
|
191
|
+
# L2 Cache (per processor): 4 MB
|
192
|
+
# Memory: 2 GB
|
193
|
+
# Bus Speed: 667 MHz
|
194
|
+
end
|
195
|
+
|
196
|
+
end
|
197
|
+
|
data/test/ft_2_concurrence.rb
CHANGED
@@ -7,10 +7,12 @@
|
|
7
7
|
# Mon Oct 9 22:19:44 JST 2006
|
8
8
|
#
|
9
9
|
|
10
|
+
require 'openwfe/def'
|
10
11
|
require 'flowtestbase'
|
11
12
|
|
12
13
|
|
13
|
-
class FlowTest2 <
|
14
|
+
class FlowTest2 < Test::Unit::TestCase
|
15
|
+
include FlowTestBase
|
14
16
|
|
15
17
|
#def setup
|
16
18
|
#end
|
@@ -18,22 +20,11 @@ class FlowTest2 < FlowTestBase
|
|
18
20
|
#def teardown
|
19
21
|
#end
|
20
22
|
|
21
|
-
#
|
22
|
-
def test_con_0
|
23
|
-
dotest(\
|
24
|
-
'''<process-definition name="con" revision="0">
|
25
|
-
<concurrence>
|
26
|
-
<print>a</print>
|
27
|
-
<print>b</print>
|
28
|
-
</concurrence>
|
29
|
-
</process-definition>''', [ '''a
|
30
|
-
b''', '''b
|
31
|
-
a''' ])
|
32
|
-
end
|
23
|
+
# test_con_0 got moved to ft_2c_concurrence.rb
|
33
24
|
|
34
25
|
#def xxxx_con_1
|
35
26
|
def test_con_1
|
36
|
-
dotest(
|
27
|
+
dotest(
|
37
28
|
'''<process-definition name="con" revision="1">
|
38
29
|
<concurrence
|
39
30
|
count="1"
|
@@ -44,7 +35,90 @@ a''' ])
|
|
44
35
|
<print>b</print>
|
45
36
|
</sequence>
|
46
37
|
</concurrence>
|
47
|
-
</process-definition>''',
|
38
|
+
</process-definition>''',
|
39
|
+
"a",
|
40
|
+
0.03,
|
41
|
+
false)
|
42
|
+
end
|
43
|
+
|
44
|
+
#def xxxx_con_2
|
45
|
+
def test_con_2
|
46
|
+
dotest(
|
47
|
+
'''<process-definition name="con" revision="2">
|
48
|
+
<concurrence over-if="true">
|
49
|
+
<sequence>
|
50
|
+
<sleep for="1s"/>
|
51
|
+
<print>a</print>
|
52
|
+
</sequence>
|
53
|
+
<print>b</print>
|
54
|
+
</concurrence>
|
55
|
+
</process-definition>''',
|
56
|
+
"b")
|
57
|
+
end
|
58
|
+
|
59
|
+
#def xxxx_con_3
|
60
|
+
def test_con_3
|
61
|
+
dotest(
|
62
|
+
'''<process-definition name="con" revision="3">
|
63
|
+
<concurrence over-if="${over}">
|
64
|
+
<print>a</print>
|
65
|
+
<set variable="over" value="true" />
|
66
|
+
</concurrence>
|
67
|
+
</process-definition>''',
|
68
|
+
"a")
|
69
|
+
end
|
70
|
+
|
71
|
+
#def xxxx_con_4
|
72
|
+
def test_con_4
|
73
|
+
dotest(
|
74
|
+
'''<process-definition name="con" revision="4">
|
75
|
+
<concurrence over-if="${nada}">
|
76
|
+
<sequence>
|
77
|
+
<sleep for="1s"/>
|
78
|
+
<print>a</print>
|
79
|
+
</sequence>
|
80
|
+
<print>b</print>
|
81
|
+
</concurrence>
|
82
|
+
</process-definition>''',
|
83
|
+
"""b
|
84
|
+
a""",
|
85
|
+
2)
|
86
|
+
end
|
87
|
+
|
88
|
+
#def xxxx_con_5
|
89
|
+
def test_con_5
|
90
|
+
dotest(
|
91
|
+
'''<process-definition name="con" revision="5">
|
92
|
+
<concurrence over-if="false">
|
93
|
+
<sequence>
|
94
|
+
<sleep for="1s"/>
|
95
|
+
<print>a</print>
|
96
|
+
</sequence>
|
97
|
+
<print>b</print>
|
98
|
+
</concurrence>
|
99
|
+
</process-definition>''',
|
100
|
+
"""b
|
101
|
+
a""",
|
102
|
+
2)
|
103
|
+
end
|
104
|
+
|
105
|
+
class TestDefinition6 < ProcessDefinition
|
106
|
+
def make
|
107
|
+
process_definition :name => "con", :revision => "6" do
|
108
|
+
concurrence :over_if => "1 == 1" do
|
109
|
+
sequence do
|
110
|
+
_sleep :for => "350"
|
111
|
+
_print "a"
|
112
|
+
end
|
113
|
+
_print "b"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
#def xxxx_con_6
|
120
|
+
def test_con_6
|
121
|
+
dotest(TestDefinition6, "b")
|
48
122
|
end
|
49
123
|
|
50
124
|
end
|