ruote 2.1.7 → 2.1.8
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/CHANGELOG.txt +13 -0
- data/CREDITS.txt +2 -1
- data/Rakefile +4 -3
- data/TODO.txt +11 -1
- data/lib/ruote/exp/fe_concurrence.rb +26 -2
- data/lib/ruote/exp/fe_participant.rb +1 -1
- data/lib/ruote/exp/merge.rb +16 -9
- data/lib/ruote/fei.rb +1 -1
- data/lib/ruote/parser.rb +2 -1
- data/lib/ruote/part/smtp_participant.rb +22 -41
- data/lib/ruote/part/storage_participant.rb +20 -1
- data/lib/ruote/part/template.rb +34 -18
- data/lib/ruote/storage/base.rb +2 -20
- data/lib/ruote/storage/composite_storage.rb +134 -0
- data/lib/ruote/storage/fs_storage.rb +15 -1
- data/lib/ruote/util/dollar.rb +1 -0
- data/lib/ruote/util/misc.rb +5 -1
- data/lib/ruote/util/time.rb +13 -3
- data/lib/ruote/version.rb +1 -1
- data/lib/ruote/worker.rb +2 -2
- data/ruote.gemspec +18 -12
- data/test/bm/seq_thousand.rb +1 -1
- data/test/functional/base.rb +6 -8
- data/test/functional/crunner.rb +2 -0
- data/test/functional/eft_0_process_definition.rb +2 -2
- data/test/functional/eft_10_cancel_process.rb +2 -2
- data/test/functional/eft_11_wait.rb +3 -3
- data/test/functional/eft_12_listen.rb +1 -1
- data/test/functional/eft_13_iterator.rb +14 -14
- data/test/functional/eft_14_cursor.rb +12 -12
- data/test/functional/eft_15_loop.rb +2 -2
- data/test/functional/eft_16_if.rb +11 -15
- data/test/functional/eft_17_equals.rb +2 -2
- data/test/functional/eft_18_concurrent_iterator.rb +35 -8
- data/test/functional/eft_1_echo.rb +1 -1
- data/test/functional/eft_21_restore.rb +3 -3
- data/test/functional/eft_22_noop.rb +1 -1
- data/test/functional/eft_23_apply.rb +9 -9
- data/test/functional/eft_25_command.rb +1 -1
- data/test/functional/eft_27_inc.rb +12 -12
- data/test/functional/eft_28_when.rb +4 -4
- data/test/functional/eft_2_sequence.rb +3 -3
- data/test/functional/eft_3_participant.rb +5 -5
- data/test/functional/eft_4_set.rb +12 -12
- data/test/functional/eft_5_subprocess.rb +8 -8
- data/test/functional/eft_6_concurrence.rb +17 -4
- data/test/functional/eft_7_forget.rb +1 -1
- data/test/functional/eft_8_undo.rb +3 -3
- data/test/functional/ft_0_worker.rb +17 -1
- data/test/functional/ft_10_dollar.rb +9 -9
- data/test/functional/ft_11_recursion.rb +2 -2
- data/test/functional/ft_13_variables.rb +4 -4
- data/test/functional/ft_17_conditional.rb +5 -5
- data/test/functional/ft_19_alias.rb +1 -1
- data/test/functional/ft_1_process_status.rb +1 -1
- data/test/functional/ft_20_storage_participant.rb +2 -0
- data/test/functional/ft_22_process_definitions.rb +11 -4
- data/test/functional/ft_24_block_participants.rb +13 -4
- data/test/functional/ft_27_var_indirection.rb +5 -5
- data/test/functional/ft_28_null_noop_participants.rb +1 -1
- data/test/functional/ft_29_part_template.rb +4 -23
- data/test/functional/ft_30_smtp_participant.rb +50 -4
- data/test/functional/ft_32_fs_history.rb +4 -8
- data/test/functional/ft_33_participant_subprocess_priority.rb +1 -1
- data/test/functional/ft_36_storage_history.rb +2 -2
- data/test/functional/ft_5_on_error.rb +5 -5
- data/test/functional/ft_8_participant_consumption.rb +2 -2
- data/test/path_helper.rb +1 -1
- data/test/test_helper.rb +17 -0
- data/test/unit/storage.rb +2 -17
- data/test/unit/ut_19_part_template.rb +76 -0
- data/test/unit/ut_1_fei.rb +13 -0
- data/test/unit/ut_20_composite_storage.rb +34 -0
- metadata +111 -55
@@ -23,7 +23,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
23
23
|
|
24
24
|
#noisy
|
25
25
|
|
26
|
-
assert_trace(
|
26
|
+
assert_trace('done.', pdef)
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_iterator
|
@@ -40,7 +40,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
40
40
|
|
41
41
|
#noisy
|
42
42
|
|
43
|
-
assert_trace(
|
43
|
+
assert_trace(%w[ alice/0_0_0 bob/0_0_0 charly/0_0_0 ], pdef)
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_to_f
|
@@ -57,7 +57,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
57
57
|
|
58
58
|
#noisy
|
59
59
|
|
60
|
-
assert_trace(
|
60
|
+
assert_trace(%w[ alice/0_0_0 bob/0_0_0 charly/0_0_0 ], pdef)
|
61
61
|
end
|
62
62
|
|
63
63
|
PDEF0 = Ruote.process_definition :name => 'test' do
|
@@ -81,7 +81,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
81
81
|
|
82
82
|
#noisy
|
83
83
|
|
84
|
-
assert_trace(
|
84
|
+
assert_trace(%w[ alice bob done. ], PDEF0)
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_rewind
|
@@ -100,7 +100,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
100
100
|
|
101
101
|
#noisy
|
102
102
|
|
103
|
-
assert_trace(
|
103
|
+
assert_trace(%w[ alice bob alice bob charly done. ], PDEF0)
|
104
104
|
end
|
105
105
|
|
106
106
|
def test_skip
|
@@ -115,7 +115,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
115
115
|
|
116
116
|
#noisy
|
117
117
|
|
118
|
-
assert_trace(
|
118
|
+
assert_trace(%w[ alice charly done.], PDEF0)
|
119
119
|
end
|
120
120
|
|
121
121
|
def test_jump
|
@@ -130,7 +130,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
130
130
|
|
131
131
|
#noisy
|
132
132
|
|
133
|
-
assert_trace(
|
133
|
+
assert_trace(%w[ alice charly done.], PDEF0)
|
134
134
|
end
|
135
135
|
|
136
136
|
def test_skip_command
|
@@ -150,7 +150,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
150
150
|
|
151
151
|
#noisy
|
152
152
|
|
153
|
-
assert_trace(
|
153
|
+
assert_trace(%w[ alice/0_0_0_0 charly/0_0_0_0 ], pdef)
|
154
154
|
end
|
155
155
|
|
156
156
|
def test_break_if
|
@@ -167,7 +167,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
167
167
|
|
168
168
|
#noisy
|
169
169
|
|
170
|
-
assert_trace(
|
170
|
+
assert_trace(%w[ a/0_0_0 b/0_0_0 ], pdef)
|
171
171
|
end
|
172
172
|
|
173
173
|
def test_break_unless
|
@@ -185,7 +185,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
185
185
|
|
186
186
|
#noisy
|
187
187
|
|
188
|
-
assert_trace(
|
188
|
+
assert_trace(%w[ a/0_1_0 b/0_1_0 ], pdef)
|
189
189
|
end
|
190
190
|
|
191
191
|
def test_iterator_with_hash_as_input
|
@@ -203,7 +203,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
203
203
|
|
204
204
|
#noisy
|
205
205
|
|
206
|
-
assert_trace
|
206
|
+
assert_trace %w[ a:A b:B ], pdef
|
207
207
|
end
|
208
208
|
|
209
209
|
def test_implicit_i_variable
|
@@ -220,7 +220,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
220
220
|
|
221
221
|
#noisy
|
222
222
|
|
223
|
-
assert_trace(
|
223
|
+
assert_trace(%w[ alice:0/0_0_0 bob:1/0_0_0 charly:2/0_0_0 ], pdef)
|
224
224
|
end
|
225
225
|
|
226
226
|
def test_nested_break
|
@@ -241,7 +241,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
241
241
|
|
242
242
|
#noisy
|
243
243
|
|
244
|
-
assert_trace
|
244
|
+
assert_trace %w[ 0_a 1_a ], pdef
|
245
245
|
end
|
246
246
|
|
247
247
|
def test_external_break
|
@@ -261,7 +261,7 @@ class EftIteratorTest < Test::Unit::TestCase
|
|
261
261
|
|
262
262
|
#noisy
|
263
263
|
|
264
|
-
assert_trace
|
264
|
+
assert_trace %w[ 1 2 ], pdef
|
265
265
|
end
|
266
266
|
end
|
267
267
|
|
@@ -22,7 +22,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
22
22
|
|
23
23
|
#noisy
|
24
24
|
|
25
|
-
assert_trace(
|
25
|
+
assert_trace('', pdef)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_cursor
|
@@ -36,7 +36,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
36
36
|
|
37
37
|
#noisy
|
38
38
|
|
39
|
-
assert_trace(
|
39
|
+
assert_trace(%w[ a b ], pdef)
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_skip
|
@@ -52,7 +52,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
52
52
|
|
53
53
|
#noisy
|
54
54
|
|
55
|
-
assert_trace(
|
55
|
+
assert_trace(%w[ a c ], pdef)
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_break
|
@@ -67,7 +67,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
67
67
|
|
68
68
|
#noisy
|
69
69
|
|
70
|
-
assert_trace(
|
70
|
+
assert_trace('a', pdef)
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_stop
|
@@ -82,7 +82,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
82
82
|
|
83
83
|
#noisy
|
84
84
|
|
85
|
-
assert_trace(
|
85
|
+
assert_trace('a', pdef)
|
86
86
|
end
|
87
87
|
|
88
88
|
def test_jump_to_tag
|
@@ -98,7 +98,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
98
98
|
|
99
99
|
#noisy
|
100
100
|
|
101
|
-
assert_trace(
|
101
|
+
assert_trace(%w[ a c ], pdef)
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_jump_to_variable_tag
|
@@ -117,7 +117,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
117
117
|
|
118
118
|
#noisy
|
119
119
|
|
120
|
-
assert_trace(
|
120
|
+
assert_trace(%w[ a b d ], pdef)
|
121
121
|
end
|
122
122
|
|
123
123
|
def test_rewind_if
|
@@ -140,7 +140,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
140
140
|
|
141
141
|
#noisy
|
142
142
|
|
143
|
-
assert_trace(
|
143
|
+
assert_trace(%w[ a ] * 5, pdef)
|
144
144
|
end
|
145
145
|
|
146
146
|
def test_jump_to
|
@@ -171,7 +171,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
171
171
|
|
172
172
|
#noisy
|
173
173
|
|
174
|
-
assert_trace
|
174
|
+
assert_trace %w[ a r a r a r p ], pdef
|
175
175
|
# ARP nostalgy....
|
176
176
|
end
|
177
177
|
|
@@ -244,7 +244,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
244
244
|
|
245
245
|
#noisy
|
246
246
|
|
247
|
-
assert_trace
|
247
|
+
assert_trace %w[ a b ], pdef
|
248
248
|
end
|
249
249
|
|
250
250
|
def test_break_if
|
@@ -258,7 +258,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
258
258
|
|
259
259
|
#noisy
|
260
260
|
|
261
|
-
assert_trace
|
261
|
+
assert_trace 'done.', pdef
|
262
262
|
end
|
263
263
|
|
264
264
|
def test_over_unless
|
@@ -272,7 +272,7 @@ class EftCursorTest < Test::Unit::TestCase
|
|
272
272
|
|
273
273
|
#noisy
|
274
274
|
|
275
|
-
assert_trace
|
275
|
+
assert_trace 'done.', pdef
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
@@ -38,7 +38,7 @@ class EftLoopTest < Test::Unit::TestCase
|
|
38
38
|
if workitem.fields['count'] > 5
|
39
39
|
end
|
40
40
|
|
41
|
-
assert_trace(
|
41
|
+
assert_trace(%w[ a b a b a b ], pdef)
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_repeat
|
@@ -61,7 +61,7 @@ class EftLoopTest < Test::Unit::TestCase
|
|
61
61
|
if workitem.fields['count'] > 5
|
62
62
|
end
|
63
63
|
|
64
|
-
assert_trace(
|
64
|
+
assert_trace(%w[ a a a a a a ], pdef)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -22,7 +22,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
22
22
|
|
23
23
|
#noisy
|
24
24
|
|
25
|
-
assert_trace(
|
25
|
+
assert_trace('then', pdef)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_else
|
@@ -36,7 +36,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
36
36
|
|
37
37
|
#noisy
|
38
38
|
|
39
|
-
assert_trace(
|
39
|
+
assert_trace('else', pdef)
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_missing_then
|
@@ -51,7 +51,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
51
51
|
|
52
52
|
#noisy
|
53
53
|
|
54
|
-
assert_trace(
|
54
|
+
assert_trace('done.', pdef)
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_missing_else
|
@@ -67,7 +67,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
67
67
|
|
68
68
|
#noisy
|
69
69
|
|
70
|
-
assert_trace(
|
70
|
+
assert_trace('done.', pdef)
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_equals_true
|
@@ -82,7 +82,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
82
82
|
|
83
83
|
#noisy
|
84
84
|
|
85
|
-
assert_trace(
|
85
|
+
assert_trace('then', pdef)
|
86
86
|
end
|
87
87
|
|
88
88
|
def test_equals_false
|
@@ -97,7 +97,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
97
97
|
|
98
98
|
#noisy
|
99
99
|
|
100
|
-
assert_trace(
|
100
|
+
assert_trace('else', pdef)
|
101
101
|
end
|
102
102
|
|
103
103
|
def test_equals_true_no_then
|
@@ -113,7 +113,7 @@ class EftIfTest < Test::Unit::TestCase
|
|
113
113
|
|
114
114
|
#noisy
|
115
115
|
|
116
|
-
assert_trace(
|
116
|
+
assert_trace('done.', pdef)
|
117
117
|
end
|
118
118
|
|
119
119
|
def test_attribute_text
|
@@ -141,16 +141,12 @@ class EftIfTest < Test::Unit::TestCase
|
|
141
141
|
|
142
142
|
#noisy
|
143
143
|
|
144
|
-
assert_trace(
|
144
|
+
assert_trace(%w[ then else else else ], pdef)
|
145
145
|
end
|
146
146
|
|
147
147
|
def test_xml_equals
|
148
148
|
|
149
|
-
|
150
|
-
require 'yajl'
|
151
|
-
rescue LoadError
|
152
|
-
require 'json'
|
153
|
-
end
|
149
|
+
require_json
|
154
150
|
Rufus::Json.detect_backend
|
155
151
|
# making sure JSON dup is available in case of HashStorage
|
156
152
|
|
@@ -165,11 +161,11 @@ class EftIfTest < Test::Unit::TestCase
|
|
165
161
|
</process-definition>
|
166
162
|
}
|
167
163
|
|
168
|
-
assert_trace(
|
164
|
+
assert_trace('alpha', { 'state' => 'A' }, pdef)
|
169
165
|
|
170
166
|
@tracer.clear
|
171
167
|
|
172
|
-
assert_trace(
|
168
|
+
assert_trace('alpha', { :state => 'A' }, pdef)
|
173
169
|
end
|
174
170
|
end
|
175
171
|
|
@@ -30,7 +30,7 @@ class EftEqualsTest < Test::Unit::TestCase
|
|
30
30
|
|
31
31
|
#noisy
|
32
32
|
|
33
|
-
assert_trace(
|
33
|
+
assert_trace(%w[ false ] * 4, pdef)
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_true
|
@@ -49,7 +49,7 @@ class EftEqualsTest < Test::Unit::TestCase
|
|
49
49
|
|
50
50
|
#noisy
|
51
51
|
|
52
|
-
assert_trace(
|
52
|
+
assert_trace(%w[ true ] * 2, pdef)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -26,7 +26,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
26
26
|
|
27
27
|
#noisy
|
28
28
|
|
29
|
-
assert_trace(
|
29
|
+
assert_trace('done.', pdef)
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_empty_list
|
@@ -42,7 +42,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
42
42
|
|
43
43
|
#noisy
|
44
44
|
|
45
|
-
assert_trace(
|
45
|
+
assert_trace('done.', pdef)
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_iterator
|
@@ -192,7 +192,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
192
192
|
|
193
193
|
#noisy
|
194
194
|
|
195
|
-
assert_trace
|
195
|
+
assert_trace %w[ p1:a:A out ], pdef
|
196
196
|
end
|
197
197
|
|
198
198
|
def test_without_to
|
@@ -205,7 +205,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
205
205
|
|
206
206
|
#noisy
|
207
207
|
|
208
|
-
assert_trace
|
208
|
+
assert_trace %w[ a a ], pdef
|
209
209
|
end
|
210
210
|
|
211
211
|
def test_branches_att
|
@@ -218,7 +218,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
218
218
|
|
219
219
|
#noisy
|
220
220
|
|
221
|
-
assert_trace
|
221
|
+
assert_trace %w[ a a ], pdef
|
222
222
|
end
|
223
223
|
|
224
224
|
def test_implicit_i_variable
|
@@ -252,7 +252,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
252
252
|
|
253
253
|
#noisy
|
254
254
|
|
255
|
-
assert_trace
|
255
|
+
assert_trace *%w[ a b c ].permutation.to_a, pdef
|
256
256
|
end
|
257
257
|
|
258
258
|
def test_merge_type_isolate
|
@@ -273,13 +273,40 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
273
273
|
|
274
274
|
#noisy
|
275
275
|
|
276
|
-
assert_trace(
|
277
|
-
pdef, %w{ . . . })
|
276
|
+
assert_trace(%w[ . . . ], pdef)
|
278
277
|
|
279
278
|
mf = ('0'..'2').to_a.map { |k| mf[k]['f'] }.sort
|
280
279
|
assert_equal %w[ a b c ], mf
|
281
280
|
end
|
282
281
|
|
282
|
+
def test_merge_type_stack
|
283
|
+
|
284
|
+
pdef = Ruote.process_definition do
|
285
|
+
concurrent_iterator :on => 'a, b', :to_f => 'f', :merge_type => 'stack' do
|
286
|
+
echo '.'
|
287
|
+
end
|
288
|
+
bravo
|
289
|
+
end
|
290
|
+
|
291
|
+
mf = nil
|
292
|
+
|
293
|
+
@engine.register_participant :bravo do |workitem|
|
294
|
+
mf = workitem.fields
|
295
|
+
nil
|
296
|
+
end
|
297
|
+
|
298
|
+
#noisy
|
299
|
+
|
300
|
+
assert_trace(%w[ . . ], pdef)
|
301
|
+
|
302
|
+
assert_equal(
|
303
|
+
[["a"], ["b"]],
|
304
|
+
mf['stack'].collect { |f| f.values }.sort)
|
305
|
+
assert_equal(
|
306
|
+
{"on"=>"a, b", "to_f"=>"f", "merge_type"=>"stack"},
|
307
|
+
mf['stack_attributes'])
|
308
|
+
end
|
309
|
+
|
283
310
|
def test_cancel
|
284
311
|
|
285
312
|
n = 77
|