openwferu 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/bigflow.rb +19 -0
- data/examples/csv_weather.rb +23 -0
- data/examples/engine_template.rb +7 -0
- data/lib/openwfe/contextual.rb +0 -2
- data/lib/openwfe/engine/engine.rb +137 -34
- data/lib/openwfe/engine/file_persisted_engine.rb +0 -5
- data/lib/openwfe/exceptions.rb +0 -2
- data/lib/openwfe/expool/errorjournal.rb +83 -7
- data/lib/openwfe/expool/expressionpool.rb +279 -60
- data/lib/openwfe/expool/expstorage.rb +7 -6
- data/lib/openwfe/expool/yamlexpstorage.rb +17 -14
- data/lib/openwfe/expressions/condition.rb +10 -7
- data/lib/openwfe/expressions/environment.rb +11 -1
- data/lib/openwfe/expressions/fe_command.rb +14 -1
- data/lib/openwfe/expressions/fe_cron.rb +29 -14
- data/lib/openwfe/expressions/fe_define.rb +26 -1
- data/lib/openwfe/expressions/fe_iterator.rb +2 -0
- data/lib/openwfe/expressions/fe_losfor.rb +20 -15
- data/lib/openwfe/expressions/fe_misc.rb +0 -2
- data/lib/openwfe/expressions/fe_participant.rb +78 -24
- data/lib/openwfe/expressions/fe_reserve.rb +0 -2
- data/lib/openwfe/expressions/fe_sleep.rb +0 -4
- data/lib/openwfe/expressions/fe_subprocess.rb +34 -0
- data/lib/openwfe/expressions/fe_value.rb +46 -4
- data/lib/openwfe/expressions/fe_wait.rb +0 -2
- data/lib/openwfe/expressions/flowexpression.rb +39 -9
- data/lib/openwfe/expressions/raw.rb +73 -48
- data/lib/openwfe/expressions/raw_prog.rb +45 -15
- data/lib/openwfe/expressions/simplerep.rb +54 -7
- data/lib/openwfe/expressions/time.rb +5 -2
- data/lib/openwfe/expressions/timeout.rb +0 -2
- data/lib/openwfe/flowexpressionid.rb +26 -2
- data/lib/openwfe/participants/enoparticipants.rb +6 -1
- data/lib/openwfe/participants/participant.rb +0 -2
- data/lib/openwfe/participants/participantmap.rb +21 -7
- data/lib/openwfe/participants/participants.rb +29 -0
- data/lib/openwfe/rest/exception.rb +0 -2
- data/lib/openwfe/storage/yamlfilestorage.rb +4 -1
- data/lib/openwfe/util/dollar.rb +0 -2
- data/lib/openwfe/util/lru.rb +0 -2
- data/lib/openwfe/util/observable.rb +1 -1
- data/lib/openwfe/util/scheduler.rb +4 -4
- data/lib/openwfe/util/schedulers.rb +0 -2
- data/lib/openwfe/util/workqueue.rb +34 -91
- data/lib/openwfe/utils.rb +35 -28
- data/lib/openwfe/version.rb +1 -1
- data/lib/openwfe/workitem.rb +1 -1
- data/test/clone_test.rb +51 -0
- data/test/concurrence_test.rb +78 -0
- data/test/cron_test_2.rb +50 -0
- data/test/flowtestbase.rb +40 -12
- data/test/ft_21_cron.rb +32 -6
- data/test/ft_26_load.rb +8 -2
- data/test/ft_26c_load.rb +19 -0
- data/test/ft_27_getflowpos.rb +4 -4
- data/test/ft_2_concurrence.rb +14 -9
- data/test/ft_32_journal.rb +1 -1
- data/test/ft_32c_journal.rb +3 -2
- data/test/ft_32d_journal.rb +2 -1
- data/test/ft_34_cancelwfid.rb +7 -3
- data/test/ft_35_localdefs.rb +13 -0
- data/test/ft_38_tag.rb +8 -6
- data/test/ft_49_condition.rb +7 -1
- data/test/ft_55_ptimeout.rb +13 -14
- data/test/ft_57_a.rb +17 -0
- data/test/ft_58_ejournal.rb +3 -3
- data/test/ft_59_ps.rb +6 -6
- data/test/ft_60_ecancel.rb +3 -5
- data/test/ft_61_elsub.rb +2 -4
- data/test/ft_63_pause.rb +122 -0
- data/test/ft_64_alias.rb +102 -0
- data/test/ft_64_clone.rb +69 -0
- data/test/ft_65_stringlaunch.rb +61 -0
- data/test/ft_66_subforget.rb +70 -0
- data/test/ft_67_schedlaunch.rb +102 -0
- data/test/ft_68_ifparticipant.rb +70 -0
- data/test/ft_69_cancelmissing.rb +49 -0
- data/test/ft_6_lambda.rb +23 -3
- data/test/ft_70_lookupvar.rb +55 -0
- data/test/ft_7_lose.rb +1 -1
- data/test/ft_tests.rb +10 -1
- data/test/hparticipant_test.rb +6 -6
- data/test/param_test.rb +1 -1
- data/test/{rake_test.rb → rake_ltest.rb} +9 -2
- data/test/rake_qtest.rb +3 -1
- data/test/raw_prog_test.rb +11 -3
- data/test/restart_sleep_test.rb +44 -6
- data/test/ruby_procdef_test.rb +129 -0
- data/test/rutest_utils.rb +1 -0
- data/test/sec_test.rb +3 -3
- metadata +19 -4
data/test/flowtestbase.rb
CHANGED
@@ -42,6 +42,9 @@ module FlowTestBase
|
|
42
42
|
attr_reader \
|
43
43
|
:engine, :tracer
|
44
44
|
|
45
|
+
#
|
46
|
+
# SETUP
|
47
|
+
#
|
45
48
|
def setup
|
46
49
|
|
47
50
|
@engine = $WORKFLOW_ENGINE_CLASS.new
|
@@ -80,13 +83,22 @@ module FlowTestBase
|
|
80
83
|
end
|
81
84
|
end
|
82
85
|
|
86
|
+
#
|
87
|
+
# TEARDOWN
|
88
|
+
#
|
83
89
|
def teardown
|
84
|
-
|
85
|
-
|
90
|
+
if @engine
|
91
|
+
$OWFE_LOG.level = Logger::INFO
|
92
|
+
@engine.stop
|
93
|
+
end
|
86
94
|
end
|
87
95
|
|
88
96
|
protected
|
89
97
|
|
98
|
+
def log_level_to_debug
|
99
|
+
$OWFE_LOG.level = Logger::DEBUG
|
100
|
+
end
|
101
|
+
|
90
102
|
def print_exp_list (l)
|
91
103
|
puts
|
92
104
|
l.each do |fexp|
|
@@ -100,13 +112,14 @@ module FlowTestBase
|
|
100
112
|
i = s.index('`')
|
101
113
|
#s = s[i+1..s.length-2]
|
102
114
|
s = s[i+6..s.length-2]
|
103
|
-
|
115
|
+
s
|
104
116
|
end
|
105
117
|
|
106
118
|
#
|
107
119
|
# dotest()
|
108
120
|
#
|
109
|
-
def dotest (
|
121
|
+
def dotest (
|
122
|
+
flowDef, expectedTrace, join=false, allowRemainingExpressions=false)
|
110
123
|
|
111
124
|
@tracer.clear
|
112
125
|
|
@@ -118,6 +131,8 @@ module FlowTestBase
|
|
118
131
|
|
119
132
|
fei = @engine.launch(li)
|
120
133
|
|
134
|
+
$OWFE_LOG.info { "dotest() launched #{fei.to_s}" }
|
135
|
+
|
121
136
|
if join.is_a?(Numeric)
|
122
137
|
sleep join
|
123
138
|
else
|
@@ -161,28 +176,41 @@ module FlowTestBase
|
|
161
176
|
end
|
162
177
|
|
163
178
|
if allowRemainingExpressions
|
164
|
-
|
165
|
-
|
166
|
-
|
179
|
+
|
180
|
+
purge_engine
|
181
|
+
|
167
182
|
return fei
|
168
183
|
end
|
169
184
|
|
170
185
|
exp_storage = engine.get_expression_storage
|
186
|
+
size = exp_storage.size
|
171
187
|
|
172
|
-
if
|
188
|
+
if size != 1
|
173
189
|
puts
|
174
190
|
puts " remaining expressions : #{exp_storage.length}"
|
175
191
|
puts
|
176
192
|
puts exp_storage.to_s
|
177
193
|
puts
|
194
|
+
puts OpenWFE::caller_to_s(0, 2)
|
195
|
+
puts
|
196
|
+
|
197
|
+
purge_engine
|
178
198
|
end
|
179
199
|
|
180
|
-
|
181
|
-
|
200
|
+
assert_equal(
|
201
|
+
size,
|
202
|
+
1,
|
182
203
|
"there are expressions remaining in the expression pool " +
|
183
|
-
"(#{exp_storage.length})"
|
204
|
+
"(#{exp_storage.length})")
|
184
205
|
|
185
|
-
|
206
|
+
fei
|
207
|
+
end
|
208
|
+
|
209
|
+
def purge_engine
|
210
|
+
|
211
|
+
@engine.get_expression_storages.each do |storage|
|
212
|
+
storage.purge
|
213
|
+
end
|
186
214
|
end
|
187
215
|
|
188
216
|
end
|
data/test/ft_21_cron.rb
CHANGED
@@ -26,17 +26,19 @@ class FlowTest21 < Test::Unit::TestCase
|
|
26
26
|
#
|
27
27
|
|
28
28
|
class TestDefinition0 < ProcessDefinition
|
29
|
-
|
30
|
-
|
31
|
-
cron :tab => "* * * * *", :name => "cron" do
|
32
|
-
participant :cron_event
|
33
|
-
end
|
34
|
-
end
|
29
|
+
cron :tab => "* * * * *", :name => "cron" do
|
30
|
+
participant :cron_event
|
35
31
|
end
|
36
32
|
end
|
37
33
|
|
34
|
+
#
|
35
|
+
# this one tests whether a cron event is removed when his process
|
36
|
+
# terminates, as should be.
|
37
|
+
#
|
38
38
|
def test_0
|
39
39
|
|
40
|
+
#log_level_to_debug
|
41
|
+
|
40
42
|
@engine.register_participant(:cron_event) do
|
41
43
|
@tracer << "cron_event"
|
42
44
|
end
|
@@ -44,5 +46,29 @@ class FlowTest21 < Test::Unit::TestCase
|
|
44
46
|
dotest(TestDefinition0, "", 62)
|
45
47
|
end
|
46
48
|
|
49
|
+
#
|
50
|
+
# Test 1
|
51
|
+
#
|
52
|
+
|
53
|
+
class TestDefinition1 < ProcessDefinition
|
54
|
+
sequence do
|
55
|
+
cron :every => "2s", :name => "cron" do
|
56
|
+
participant :cron_event
|
57
|
+
end
|
58
|
+
_sleep "10s"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_1
|
63
|
+
|
64
|
+
#log_level_to_debug
|
65
|
+
|
66
|
+
@engine.register_participant(:cron_event) do
|
67
|
+
@tracer << "."
|
68
|
+
end
|
69
|
+
|
70
|
+
dotest(TestDefinition1, [ "....", "....." ])
|
71
|
+
end
|
72
|
+
|
47
73
|
end
|
48
74
|
|
data/test/ft_26_load.rb
CHANGED
@@ -13,7 +13,7 @@ require 'openwfe/expressions/raw_prog'
|
|
13
13
|
include OpenWFE
|
14
14
|
|
15
15
|
|
16
|
-
class
|
16
|
+
class FlowTest26c < Test::Unit::TestCase
|
17
17
|
include FlowTestBase
|
18
18
|
|
19
19
|
#def setup
|
@@ -102,6 +102,12 @@ class FlowTest26 < Test::Unit::TestCase
|
|
102
102
|
# L2 Cache (per processor): 4 MB
|
103
103
|
# Memory: 2 GB
|
104
104
|
# Bus Speed: 667 MHz
|
105
|
+
|
106
|
+
# Thu Sep 13 15:38:46 JST 2007
|
107
|
+
#
|
108
|
+
# 100 in 3s (in memory engine)
|
109
|
+
# 1'000 in 85s (in memory engine)
|
110
|
+
# 10'000 in s (in memory engine)
|
105
111
|
end
|
106
112
|
|
107
113
|
|
@@ -125,7 +131,7 @@ class FlowTest26 < Test::Unit::TestCase
|
|
125
131
|
#puts "(#{workitem.flow_id} => #{map[workitem.flow_id]})"
|
126
132
|
end
|
127
133
|
|
128
|
-
n =
|
134
|
+
n = 10000
|
129
135
|
|
130
136
|
n.times do |i|
|
131
137
|
|
data/test/ft_26c_load.rb
CHANGED
@@ -61,5 +61,24 @@ class FlowTest26c < Test::Unit::TestCase
|
|
61
61
|
assert_equal $count, N
|
62
62
|
end
|
63
63
|
|
64
|
+
#
|
65
|
+
# Thu Sep 13 15:41:20 JST 2007
|
66
|
+
#
|
67
|
+
# ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3]
|
68
|
+
#
|
69
|
+
# 10_000 in 27.69s
|
70
|
+
#
|
71
|
+
# before optimization : 10k in 138.341
|
72
|
+
#
|
73
|
+
#
|
74
|
+
# ruby 1.8.5 (2007-09-13 rev 3876) [i386-jruby1.1]
|
75
|
+
#
|
76
|
+
# 10_000 in 53.96s
|
77
|
+
#
|
78
|
+
# ruby 1.8.5 (2007-09-13 rev 3876) [i386-jruby1.1]
|
79
|
+
# -O -J-server
|
80
|
+
#
|
81
|
+
# 10_000 in 42.616s
|
82
|
+
|
64
83
|
end
|
65
84
|
|
data/test/ft_27_getflowpos.rb
CHANGED
@@ -43,7 +43,7 @@ class FlowTest27 < Test::Unit::TestCase
|
|
43
43
|
|
44
44
|
fei = @engine.launch(TestDefinition0)
|
45
45
|
|
46
|
-
sleep 0.
|
46
|
+
sleep 0.100
|
47
47
|
|
48
48
|
l = @engine.get_process_stack(fei.wfid)
|
49
49
|
|
@@ -52,7 +52,7 @@ class FlowTest27 < Test::Unit::TestCase
|
|
52
52
|
assert_equal \
|
53
53
|
l.size, 3, "get_process_stack() returned #{l.size} elements"
|
54
54
|
|
55
|
-
ps = @engine.
|
55
|
+
ps = @engine.list_process_status
|
56
56
|
#puts
|
57
57
|
#puts ps[fei.parent_wfid].to_s
|
58
58
|
#puts
|
@@ -61,7 +61,7 @@ class FlowTest27 < Test::Unit::TestCase
|
|
61
61
|
assert_equal ps[fei.parent_wfid].expressions.size, 1
|
62
62
|
assert_kind_of ParticipantExpression, ps[fei.parent_wfid].expressions[0]
|
63
63
|
|
64
|
-
ps = @engine.
|
64
|
+
ps = @engine.list_process_status fei.wfid[0, 4]
|
65
65
|
|
66
66
|
assert_equal ps[fei.parent_wfid].errors.size, 0
|
67
67
|
assert_equal ps[fei.parent_wfid].expressions.size, 1
|
@@ -97,7 +97,7 @@ class FlowTest27 < Test::Unit::TestCase
|
|
97
97
|
#fei = @engine.launch TestDefinition0
|
98
98
|
fei = @engine.launch Gfp27b
|
99
99
|
|
100
|
-
sleep 0.
|
100
|
+
sleep 0.100
|
101
101
|
|
102
102
|
#l = @engine.get_process_stack(fei.wfid)
|
103
103
|
l = @engine.get_process_stack(fei)
|
data/test/ft_2_concurrence.rb
CHANGED
@@ -24,8 +24,9 @@ class FlowTest2 < Test::Unit::TestCase
|
|
24
24
|
|
25
25
|
#def xxxx_con_1
|
26
26
|
def test_con_1
|
27
|
+
|
27
28
|
dotest(
|
28
|
-
'''<process-definition name="
|
29
|
+
'''<process-definition name="ft_2_concurrence" revision="1">
|
29
30
|
<concurrence
|
30
31
|
count="1"
|
31
32
|
>
|
@@ -37,14 +38,16 @@ class FlowTest2 < Test::Unit::TestCase
|
|
37
38
|
</concurrence>
|
38
39
|
</process-definition>''',
|
39
40
|
"a",
|
40
|
-
true
|
41
|
-
false)
|
41
|
+
true)
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
def test_con_2
|
44
|
+
def xxxx_con_2
|
45
|
+
#def test_con_2
|
46
|
+
|
47
|
+
#$OWFE_LOG.level = Logger::INFO
|
48
|
+
|
46
49
|
dotest(
|
47
|
-
'''<process-definition name="
|
50
|
+
'''<process-definition name="ft_2_concurrence" revision="2">
|
48
51
|
<concurrence over-if="true">
|
49
52
|
<sequence>
|
50
53
|
<sleep for="1s"/>
|
@@ -55,12 +58,14 @@ class FlowTest2 < Test::Unit::TestCase
|
|
55
58
|
</process-definition>''',
|
56
59
|
"b",
|
57
60
|
true)
|
61
|
+
|
62
|
+
#$OWFE_LOG.level = Logger::INFO
|
58
63
|
end
|
59
64
|
|
60
65
|
#def xxxx_con_3
|
61
66
|
def test_con_3
|
62
67
|
dotest(
|
63
|
-
'''<process-definition name="
|
68
|
+
'''<process-definition name="ft_2_concurrence" revision="3">
|
64
69
|
<concurrence over-if="${over}">
|
65
70
|
<print>a</print>
|
66
71
|
<set variable="over" value="true" />
|
@@ -73,7 +78,7 @@ class FlowTest2 < Test::Unit::TestCase
|
|
73
78
|
#def xxxx_con_4
|
74
79
|
def test_con_4
|
75
80
|
dotest(
|
76
|
-
'''<process-definition name="
|
81
|
+
'''<process-definition name="ft_2_concurrence" revision="4">
|
77
82
|
<concurrence over-if="${nada}">
|
78
83
|
<sequence>
|
79
84
|
<sleep for="1s"/>
|
@@ -90,7 +95,7 @@ a""",
|
|
90
95
|
#def xxxx_con_5
|
91
96
|
def test_con_5
|
92
97
|
dotest(
|
93
|
-
'''<process-definition name="
|
98
|
+
'''<process-definition name="ft_2_concurrence" revision="5">
|
94
99
|
<concurrence over-if="false">
|
95
100
|
<sequence>
|
96
101
|
<sleep for="1s"/>
|
data/test/ft_32_journal.rb
CHANGED
data/test/ft_32c_journal.rb
CHANGED
@@ -55,7 +55,8 @@ class FlowTest32c < Test::Unit::TestCase
|
|
55
55
|
#fei = dotest(Test0, "alpha", 0.500, true)
|
56
56
|
li = LaunchItem.new Test0
|
57
57
|
fei = @engine.launch li
|
58
|
-
|
58
|
+
|
59
|
+
sleep 0.250
|
59
60
|
|
60
61
|
get_journal.flush_buckets
|
61
62
|
|
@@ -74,7 +75,7 @@ class FlowTest32c < Test::Unit::TestCase
|
|
74
75
|
|
75
76
|
get_journal.replay_at_error error_event
|
76
77
|
|
77
|
-
sleep
|
78
|
+
sleep 0.500
|
78
79
|
|
79
80
|
assert_equal get_error_count(fei.wfid), 2
|
80
81
|
|
data/test/ft_32d_journal.rb
CHANGED
data/test/ft_34_cancelwfid.rb
CHANGED
@@ -39,10 +39,12 @@ class FlowTest34 < Test::Unit::TestCase
|
|
39
39
|
|
40
40
|
fei = @engine.launch(TestCancelWfid0)
|
41
41
|
|
42
|
-
sleep 0.
|
42
|
+
sleep 0.100
|
43
43
|
|
44
44
|
@engine.cancel_process(fei.wfid)
|
45
45
|
|
46
|
+
sleep 0.300
|
47
|
+
|
46
48
|
l = @engine.list_processes()
|
47
49
|
|
48
50
|
assert_equal l.size, 0
|
@@ -53,16 +55,18 @@ class FlowTest34 < Test::Unit::TestCase
|
|
53
55
|
|
54
56
|
def test_cancelwfid_1
|
55
57
|
|
58
|
+
log_level_to_debug
|
59
|
+
|
56
60
|
sp = @engine.register_participant(
|
57
61
|
"store_participant", OpenWFE::YamlParticipant)
|
58
62
|
|
59
63
|
fei = @engine.launch(TestCancelWfid0)
|
60
64
|
|
61
|
-
sleep 0.
|
65
|
+
sleep 0.100
|
62
66
|
|
63
67
|
@engine.cancel_process(fei.wfid)
|
64
68
|
|
65
|
-
sleep 0.
|
69
|
+
sleep 0.100
|
66
70
|
|
67
71
|
assert_equal @engine.get_process_stack(fei.wfid).size, 0
|
68
72
|
|
data/test/ft_35_localdefs.rb
CHANGED
@@ -32,6 +32,8 @@ class FlowTest35 < Test::Unit::TestCase
|
|
32
32
|
#def xxxx_local_0
|
33
33
|
def test_local_0
|
34
34
|
|
35
|
+
#log_level_to_debug
|
36
|
+
|
35
37
|
li = OpenWFE::LaunchItem.new
|
36
38
|
li.wfdurl = "file:doc/res/defs/testdef.rb"
|
37
39
|
|
@@ -59,5 +61,16 @@ b
|
|
59
61
|
c""")
|
60
62
|
end
|
61
63
|
|
64
|
+
|
65
|
+
#
|
66
|
+
# TEST 2
|
67
|
+
|
68
|
+
def test_local_2
|
69
|
+
|
70
|
+
@engine.launch("file:doc/res/defs/testdef.rb")
|
71
|
+
sleep 0.300
|
72
|
+
assert_equal @tracer.to_s, "a\nb\nc"
|
73
|
+
end
|
74
|
+
|
62
75
|
end
|
63
76
|
|
data/test/ft_38_tag.rb
CHANGED
@@ -38,6 +38,8 @@ class FlowTest38 < Test::Unit::TestCase
|
|
38
38
|
|
39
39
|
def test_tag_0
|
40
40
|
|
41
|
+
log_level_to_debug
|
42
|
+
|
41
43
|
dotest(TestTag0, "blah")
|
42
44
|
end
|
43
45
|
|
@@ -58,8 +60,8 @@ class FlowTest38 < Test::Unit::TestCase
|
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
|
62
|
-
def test_tag_1
|
63
|
+
def xxxx_tag_1
|
64
|
+
#def test_tag_1
|
63
65
|
|
64
66
|
count = 0
|
65
67
|
|
@@ -88,8 +90,8 @@ class FlowTest38 < Test::Unit::TestCase
|
|
88
90
|
end
|
89
91
|
end
|
90
92
|
|
91
|
-
|
92
|
-
def test_tag_2
|
93
|
+
def xxxx_tag_2
|
94
|
+
#def test_tag_2
|
93
95
|
|
94
96
|
count = 0
|
95
97
|
|
@@ -118,8 +120,8 @@ class FlowTest38 < Test::Unit::TestCase
|
|
118
120
|
end
|
119
121
|
end
|
120
122
|
|
121
|
-
|
122
|
-
def test_tag_3
|
123
|
+
def xxxx_tag_3
|
124
|
+
#def test_tag_3
|
123
125
|
|
124
126
|
dotest TestTag3, "1\n3"
|
125
127
|
end
|
data/test/ft_49_condition.rb
CHANGED
@@ -104,6 +104,10 @@ class FlowTest49 < Test::Unit::TestCase
|
|
104
104
|
_print "2 ${f:__result__}"
|
105
105
|
_if :rnot => "1 > -1"
|
106
106
|
_print "3 ${f:__result__}"
|
107
|
+
_if :rtest => "workitem.attributes.size % 2 == 0"
|
108
|
+
_print "4 ${f:__result__}"
|
109
|
+
_if :rtest => "wi.attributes.size % 2 == 1"
|
110
|
+
_print "5 ${f:__result__}"
|
107
111
|
end
|
108
112
|
end
|
109
113
|
|
@@ -116,7 +120,9 @@ class FlowTest49 < Test::Unit::TestCase
|
|
116
120
|
0 true
|
117
121
|
1 true
|
118
122
|
2 true
|
119
|
-
3
|
123
|
+
3
|
124
|
+
4
|
125
|
+
5 true
|
120
126
|
""".strip)
|
121
127
|
end
|
122
128
|
|
data/test/ft_55_ptimeout.rb
CHANGED
@@ -29,34 +29,33 @@ class FlowTest55 < Test::Unit::TestCase
|
|
29
29
|
#
|
30
30
|
|
31
31
|
class Test0 < ProcessDefinition
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
_print "cancelled?"
|
37
|
-
end
|
38
|
-
_print "concurrence done"
|
32
|
+
concurrence :count => 1 do
|
33
|
+
sequence do
|
34
|
+
participant :ref => "channel_z", :timeout => "1s"
|
35
|
+
_print "cancelled?"
|
39
36
|
end
|
37
|
+
_print "concurrence done"
|
40
38
|
end
|
41
39
|
end
|
42
40
|
|
43
41
|
#def xxxx_0
|
44
42
|
def test_0
|
45
43
|
|
46
|
-
@engine.
|
47
|
-
|
48
|
-
#class << @engine.get_scheduler
|
44
|
+
#scheduler = @engine.get_scheduler
|
45
|
+
#class << scheduler
|
49
46
|
# attr_reader :pending_jobs
|
50
47
|
#end
|
51
|
-
#
|
52
|
-
# having a look into the scheduler
|
53
48
|
|
54
|
-
|
49
|
+
log_level_to_debug
|
50
|
+
|
51
|
+
@engine.register_participant :channel_z, NullParticipant
|
52
|
+
|
53
|
+
#require 'pp'; pp(scheduler.pending_jobs)
|
55
54
|
assert_no_jobs_left
|
56
55
|
|
57
56
|
dotest(Test0, "concurrence done")
|
58
57
|
|
59
|
-
#require 'pp'; pp
|
58
|
+
#require 'pp'; pp(scheduler.pending_jobs)
|
60
59
|
assert_no_jobs_left
|
61
60
|
end
|
62
61
|
|
data/test/ft_57_a.rb
CHANGED
@@ -105,5 +105,22 @@ a|b|3
|
|
105
105
|
""".strip,
|
106
106
|
"a|2|c")
|
107
107
|
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Test 3
|
111
|
+
#
|
112
|
+
|
113
|
+
class Test3 < ProcessDefinition
|
114
|
+
sequence do
|
115
|
+
_set :field => "other" do
|
116
|
+
reval { "77" }
|
117
|
+
end
|
118
|
+
_print "${f:other}"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_3
|
123
|
+
dotest(Test3, "77")
|
124
|
+
end
|
108
125
|
end
|
109
126
|
|
data/test/ft_58_ejournal.rb
CHANGED
@@ -50,7 +50,7 @@ class FlowTest58 < Test::Unit::TestCase
|
|
50
50
|
li = LaunchItem.new Test0
|
51
51
|
fei = @engine.launch li
|
52
52
|
|
53
|
-
sleep 0.
|
53
|
+
sleep 0.200
|
54
54
|
|
55
55
|
assert File.exist?("work/ejournal/#{fei.parent_wfid}.ejournal") \
|
56
56
|
if @engine.is_a?(FilePersistedEngine)
|
@@ -70,7 +70,7 @@ class FlowTest58 < Test::Unit::TestCase
|
|
70
70
|
|
71
71
|
ejournal.replay_at_last_error fei.wfid
|
72
72
|
|
73
|
-
sleep 0.
|
73
|
+
sleep 0.200
|
74
74
|
|
75
75
|
errors = ejournal.get_error_log fei
|
76
76
|
|
@@ -104,7 +104,7 @@ class FlowTest58 < Test::Unit::TestCase
|
|
104
104
|
|
105
105
|
ejournal.replay_at_error second_error
|
106
106
|
|
107
|
-
sleep 0.
|
107
|
+
sleep 0.200
|
108
108
|
|
109
109
|
assert_equal @tracer.to_s, "alpha\nnada\nbravo"
|
110
110
|
|
data/test/ft_59_ps.rb
CHANGED
@@ -40,9 +40,9 @@ class FlowTest59 < Test::Unit::TestCase
|
|
40
40
|
|
41
41
|
fei = @engine.launch Def59
|
42
42
|
|
43
|
-
sleep 0.
|
43
|
+
sleep 0.250
|
44
44
|
|
45
|
-
ps = @engine.
|
45
|
+
ps = @engine.list_process_status
|
46
46
|
#puts ps
|
47
47
|
|
48
48
|
assert_equal ps[fei.wfid].expressions.size, 2
|
@@ -69,9 +69,9 @@ class FlowTest59 < Test::Unit::TestCase
|
|
69
69
|
|
70
70
|
fei = @engine.launch Def59b
|
71
71
|
|
72
|
-
sleep 0.
|
72
|
+
sleep 0.100
|
73
73
|
|
74
|
-
ps = @engine.
|
74
|
+
ps = @engine.list_process_status
|
75
75
|
#puts ps
|
76
76
|
|
77
77
|
assert_equal ps[fei.wfid].expressions.size, 1
|
@@ -99,9 +99,9 @@ class FlowTest59 < Test::Unit::TestCase
|
|
99
99
|
|
100
100
|
fei = @engine.launch Def59_1
|
101
101
|
|
102
|
-
sleep 0.
|
102
|
+
sleep 0.200
|
103
103
|
|
104
|
-
ps = @engine.
|
104
|
+
ps = @engine.list_process_status
|
105
105
|
#puts ps
|
106
106
|
#puts ps[fei.wfid].errors
|
107
107
|
|
data/test/ft_60_ecancel.rb
CHANGED
@@ -40,9 +40,8 @@ class FlowTest60 < Test::Unit::TestCase
|
|
40
40
|
#$OWFE_LOG.level = Logger::DEBUG
|
41
41
|
|
42
42
|
fei = @engine.launch TestDefinition0
|
43
|
-
fei = fei.dup
|
44
43
|
|
45
|
-
sleep 0.
|
44
|
+
sleep 0.200
|
46
45
|
|
47
46
|
#puts
|
48
47
|
#puts @engine.get_process_stack fei.wfid
|
@@ -52,7 +51,7 @@ class FlowTest60 < Test::Unit::TestCase
|
|
52
51
|
fei.expression_name = "sequence"
|
53
52
|
@engine.cancel_expression fei
|
54
53
|
|
55
|
-
sleep 0.
|
54
|
+
sleep 0.200
|
56
55
|
|
57
56
|
assert_equal @tracer.to_s, "a\nb.0\nc"
|
58
57
|
|
@@ -66,9 +65,8 @@ class FlowTest60 < Test::Unit::TestCase
|
|
66
65
|
#$OWFE_LOG.level = Logger::DEBUG
|
67
66
|
|
68
67
|
fei = @engine.launch TestDefinition0
|
69
|
-
fei = fei.dup
|
70
68
|
|
71
|
-
sleep 0.
|
69
|
+
sleep 0.200
|
72
70
|
|
73
71
|
fei.expression_id = "0.0.1.2"
|
74
72
|
fei.expression_name = "print"
|
data/test/ft_61_elsub.rb
CHANGED
@@ -38,13 +38,11 @@ class FlowTest61 < Test::Unit::TestCase
|
|
38
38
|
|
39
39
|
def test_0
|
40
40
|
|
41
|
-
|
41
|
+
log_level_to_debug
|
42
42
|
|
43
43
|
engine.launch EngineLevelProcessDefinition
|
44
44
|
sleep 0.700
|
45
|
-
dotest TestDefinition0, "nada"
|
46
|
-
|
47
|
-
$OWFE_LOG.level = Logger::INFO
|
45
|
+
dotest TestDefinition0, "nada", false, true
|
48
46
|
end
|
49
47
|
|
50
48
|
end
|