ruote 2.3.0.1 → 2.3.0.2
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 +23 -0
- data/CREDITS.txt +4 -0
- data/LICENSE.txt +1 -1
- data/lib/ruote.rb +2 -0
- data/lib/ruote/context.rb +2 -1
- data/lib/ruote/dashboard.rb +169 -13
- data/lib/ruote/dboard/mutation.rb +282 -0
- data/lib/ruote/dboard/process_error.rb +1 -1
- data/lib/ruote/dboard/process_status.rb +61 -48
- data/lib/ruote/engine.rb +1 -1
- data/lib/ruote/exp/command.rb +1 -1
- data/lib/ruote/exp/commanded.rb +1 -1
- data/lib/ruote/exp/condition.rb +2 -1
- data/lib/ruote/exp/fe_add_branches.rb +1 -1
- data/lib/ruote/exp/fe_apply.rb +1 -1
- data/lib/ruote/exp/fe_await.rb +97 -48
- data/lib/ruote/exp/fe_cancel_process.rb +1 -1
- data/lib/ruote/exp/fe_command.rb +2 -3
- data/lib/ruote/exp/fe_concurrence.rb +162 -66
- data/lib/ruote/exp/fe_concurrent_iterator.rb +25 -7
- data/lib/ruote/exp/fe_cron.rb +1 -1
- data/lib/ruote/exp/fe_cursor.rb +10 -11
- data/lib/ruote/exp/fe_define.rb +1 -1
- data/lib/ruote/exp/fe_echo.rb +1 -1
- data/lib/ruote/exp/fe_equals.rb +1 -1
- data/lib/ruote/exp/fe_error.rb +1 -1
- data/lib/ruote/exp/fe_filter.rb +1 -1
- data/lib/ruote/exp/fe_forget.rb +1 -1
- data/lib/ruote/exp/fe_given.rb +1 -1
- data/lib/ruote/exp/fe_if.rb +87 -7
- data/lib/ruote/exp/fe_inc.rb +1 -1
- data/lib/ruote/exp/fe_iterator.rb +1 -1
- data/lib/ruote/exp/fe_listen.rb +1 -1
- data/lib/ruote/exp/fe_lose.rb +1 -1
- data/lib/ruote/exp/fe_noop.rb +1 -1
- data/lib/ruote/exp/fe_on_error.rb +1 -1
- data/lib/ruote/exp/fe_once.rb +1 -1
- data/lib/ruote/exp/fe_participant.rb +49 -16
- data/lib/ruote/exp/fe_read.rb +1 -1
- data/lib/ruote/exp/fe_redo.rb +1 -1
- data/lib/ruote/exp/fe_ref.rb +1 -1
- data/lib/ruote/exp/fe_registerp.rb +1 -1
- data/lib/ruote/exp/fe_reserve.rb +1 -1
- data/lib/ruote/exp/fe_restore.rb +1 -7
- data/lib/ruote/exp/fe_save.rb +1 -1
- data/lib/ruote/exp/fe_sequence.rb +1 -1
- data/lib/ruote/exp/fe_set.rb +1 -1
- data/lib/ruote/exp/fe_stall.rb +1 -1
- data/lib/ruote/exp/fe_subprocess.rb +1 -1
- data/lib/ruote/exp/fe_that.rb +1 -1
- data/lib/ruote/exp/fe_undo.rb +1 -1
- data/lib/ruote/exp/fe_unregisterp.rb +1 -1
- data/lib/ruote/exp/fe_wait.rb +1 -1
- data/lib/ruote/exp/flow_expression.rb +117 -8
- data/lib/ruote/exp/iterator.rb +1 -1
- data/lib/ruote/exp/ro_attributes.rb +1 -1
- data/lib/ruote/exp/ro_filters.rb +1 -1
- data/lib/ruote/exp/ro_on_x.rb +4 -2
- data/lib/ruote/exp/ro_persist.rb +1 -1
- data/lib/ruote/exp/ro_timers.rb +1 -1
- data/lib/ruote/exp/ro_variables.rb +1 -1
- data/lib/ruote/extract.rb +125 -0
- data/lib/ruote/fei.rb +10 -73
- data/lib/ruote/id/mnemo_wfid_generator.rb +1 -1
- data/lib/ruote/id/wfid_generator.rb +1 -1
- data/lib/ruote/log/default_history.rb +17 -3
- data/lib/ruote/log/fancy_printing.rb +12 -32
- data/lib/ruote/log/storage_history.rb +1 -1
- data/lib/ruote/log/wait_logger.rb +15 -7
- data/lib/ruote/merge.rb +123 -0
- data/lib/ruote/observer.rb +1 -1
- data/lib/ruote/part/block_participant.rb +1 -1
- data/lib/ruote/part/code_participant.rb +1 -1
- data/lib/ruote/part/engine_participant.rb +1 -1
- data/lib/ruote/part/local_participant.rb +9 -1
- data/lib/ruote/part/no_op_participant.rb +1 -1
- data/lib/ruote/part/null_participant.rb +1 -1
- data/lib/ruote/part/participant.rb +1 -1
- data/lib/ruote/part/rev_participant.rb +1 -1
- data/lib/ruote/part/smtp_participant.rb +1 -1
- data/lib/ruote/part/storage_participant.rb +18 -1
- data/lib/ruote/part/template.rb +1 -1
- data/lib/ruote/reader.rb +1 -1
- data/lib/ruote/reader/json.rb +1 -1
- data/lib/ruote/reader/radial.rb +4 -4
- data/lib/ruote/reader/ruby_dsl.rb +1 -1
- data/lib/ruote/reader/xml.rb +1 -1
- data/lib/ruote/receiver/base.rb +13 -1
- data/lib/ruote/storage/base.rb +8 -14
- data/lib/ruote/storage/composite_storage.rb +1 -1
- data/lib/ruote/storage/fs_storage.rb +1 -1
- data/lib/ruote/storage/hash_storage.rb +2 -1
- data/lib/ruote/svc/dispatch_pool.rb +29 -18
- data/lib/ruote/svc/dollar_sub.rb +5 -8
- data/lib/ruote/svc/error_handler.rb +1 -1
- data/lib/ruote/svc/expression_map.rb +1 -1
- data/lib/ruote/svc/participant_list.rb +8 -5
- data/lib/ruote/svc/tracker.rb +154 -56
- data/lib/ruote/svc/treechecker.rb +1 -1
- data/lib/ruote/tree_dot.rb +1 -1
- data/lib/ruote/util/deep.rb +4 -2
- data/lib/ruote/util/filter.rb +1 -1
- data/lib/ruote/util/hashdot.rb +1 -1
- data/lib/ruote/util/look.rb +1 -1
- data/lib/ruote/util/lookup.rb +1 -1
- data/lib/ruote/util/misc.rb +51 -1
- data/lib/ruote/util/mpatch.rb +1 -1
- data/lib/ruote/util/ometa.rb +1 -1
- data/lib/ruote/util/subprocess.rb +1 -1
- data/lib/ruote/util/time.rb +3 -3
- data/lib/ruote/util/tree.rb +43 -4
- data/lib/ruote/version.rb +2 -2
- data/lib/ruote/worker.rb +30 -18
- data/lib/ruote/workitem.rb +1 -1
- data/ruote.gemspec +6 -2
- data/test/functional/base.rb +0 -1
- data/test/functional/concurrent_base.rb +1 -1
- data/test/functional/eft_14_cursor.rb +42 -52
- data/test/functional/eft_16_if.rb +24 -16
- data/test/functional/eft_18_concurrent_iterator.rb +31 -1
- data/test/functional/eft_6_concurrence.rb +149 -34
- data/test/functional/ft_10_dollar.rb +14 -30
- data/test/functional/ft_12_launchitem.rb +15 -0
- data/test/functional/ft_1_process_status.rb +62 -13
- data/test/functional/ft_20_storage_participant.rb +25 -0
- data/test/functional/ft_38_participant_more.rb +1 -1
- data/test/functional/ft_42_storage_copy.rb +1 -3
- data/test/functional/ft_43_participant_on_reply.rb +63 -5
- data/test/functional/ft_66_flank.rb +41 -0
- data/test/functional/ft_6_on_cancel.rb +9 -18
- data/test/functional/ft_71_retries.rb +25 -12
- data/test/functional/ft_79_attach.rb +138 -0
- data/test/functional/ft_7_tags.rb +27 -0
- data/test/functional/ft_80_pause_on_apply.rb +64 -0
- data/test/functional/ft_81_mutation.rb +417 -0
- data/test/functional/ft_82_await_attribute.rb +84 -0
- data/test/functional/ft_83_trackers.rb +79 -0
- data/test/functional/storage.rb +3 -4
- data/test/unit/ut_12_wait_logger.rb +41 -3
- data/test/unit/ut_15_util.rb +30 -0
- data/test/unit/ut_17_merge.rb +54 -53
- data/test/unit/ut_1_fei.rb +2 -2
- data/test/unit/ut_24_radial_reader.rb +7 -0
- data/test/unit/ut_26_deep.rb +14 -0
- data/test/unit/ut_5_tree.rb +38 -28
- metadata +206 -169
- data/couch_url.txt +0 -1
- data/lib/ruote/exp/merge.rb +0 -134
@@ -20,8 +20,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
#noisy
|
24
|
-
|
25
23
|
assert_trace('then', pdef)
|
26
24
|
end
|
27
25
|
|
@@ -34,8 +32,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
34
32
|
end
|
35
33
|
end
|
36
34
|
|
37
|
-
#noisy
|
38
|
-
|
39
35
|
assert_trace('else', pdef)
|
40
36
|
end
|
41
37
|
|
@@ -49,8 +45,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
52
|
-
#noisy
|
53
|
-
|
54
48
|
assert_trace('done.', pdef)
|
55
49
|
end
|
56
50
|
|
@@ -65,8 +59,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
65
59
|
end
|
66
60
|
end
|
67
61
|
|
68
|
-
#noisy
|
69
|
-
|
70
62
|
assert_trace('done.', pdef)
|
71
63
|
end
|
72
64
|
|
@@ -80,8 +72,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
80
72
|
end
|
81
73
|
end
|
82
74
|
|
83
|
-
#noisy
|
84
|
-
|
85
75
|
assert_trace('then', pdef)
|
86
76
|
end
|
87
77
|
|
@@ -95,8 +85,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
95
85
|
end
|
96
86
|
end
|
97
87
|
|
98
|
-
#noisy
|
99
|
-
|
100
88
|
assert_trace('else', pdef)
|
101
89
|
end
|
102
90
|
|
@@ -111,8 +99,6 @@ class EftIfTest < Test::Unit::TestCase
|
|
111
99
|
end
|
112
100
|
end
|
113
101
|
|
114
|
-
#noisy
|
115
|
-
|
116
102
|
assert_trace('done.', pdef)
|
117
103
|
end
|
118
104
|
|
@@ -139,11 +125,33 @@ class EftIfTest < Test::Unit::TestCase
|
|
139
125
|
end
|
140
126
|
end
|
141
127
|
|
142
|
-
#noisy
|
143
|
-
|
144
128
|
assert_trace(%w[ then else else else ], pdef)
|
145
129
|
end
|
146
130
|
|
131
|
+
# For ruote-mon and its dot/dollar escaping scheme.
|
132
|
+
#
|
133
|
+
# (Fukuoka Ruby Kaigi 01 2012/12/01)
|
134
|
+
#
|
135
|
+
def test_attribute_text_and_dots
|
136
|
+
|
137
|
+
@dashboard.context['ruby_eval_allowed'] = true
|
138
|
+
|
139
|
+
pdef = Ruote.define do
|
140
|
+
_if '${r:"".length == 0}' do
|
141
|
+
#_if :test => '${r:"".length == 0}' do
|
142
|
+
echo 'a'
|
143
|
+
echo 'b'
|
144
|
+
end
|
145
|
+
_if '${r:"".length == 1}' do
|
146
|
+
#_if :test => '${r:"".length == 1}' do
|
147
|
+
echo 'a'
|
148
|
+
echo 'b'
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
assert_trace(%w[ a b ], pdef)
|
153
|
+
end
|
154
|
+
|
147
155
|
def test_xml_equals
|
148
156
|
|
149
157
|
require_json
|
@@ -256,7 +256,7 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
256
256
|
def test_merge_type_isolate
|
257
257
|
|
258
258
|
pdef = Ruote.process_definition do
|
259
|
-
concurrent_iterator :on => 'a, b, c', :to_f => 'f', :
|
259
|
+
concurrent_iterator :on => 'a, b, c', :to_f => 'f', :mt => 'isolate' do
|
260
260
|
echo '.'
|
261
261
|
end
|
262
262
|
bravo
|
@@ -458,6 +458,36 @@ class EftConcurrentIteratorTest < Test::Unit::TestCase
|
|
458
458
|
assert_equal nil, r['workitem']['fields']['d']
|
459
459
|
end
|
460
460
|
|
461
|
+
# #class MeasureParticipant < Ruote::Participant
|
462
|
+
# # def on_workitem
|
463
|
+
# # sleep(10 * rand)
|
464
|
+
# # ps = @context.dashboard.ps(workitem.wfid)
|
465
|
+
# # ci = ps.expressions.find { |e| e.name == 'citerator' }
|
466
|
+
# # $volume = [ $volume, ci.h.inspect.length ].max
|
467
|
+
# # reply
|
468
|
+
# # end
|
469
|
+
# #end
|
470
|
+
#
|
471
|
+
# def test_merge_volume_xxx
|
472
|
+
#
|
473
|
+
# #@dashboard.register 'measure', MeasureParticipant
|
474
|
+
# @dashboard.register 'measure', Ruote::NoOpParticipant
|
475
|
+
#
|
476
|
+
# n = 500
|
477
|
+
#
|
478
|
+
# pdef = Ruote.define do
|
479
|
+
# citerator :on => (1..n).to_a do
|
480
|
+
# #iterator :on => (1..n).to_a do
|
481
|
+
# measure
|
482
|
+
# end
|
483
|
+
# end
|
484
|
+
#
|
485
|
+
# wfid = @dashboard.launch(pdef)
|
486
|
+
# r = @dashboard.wait_for(wfid)
|
487
|
+
#
|
488
|
+
# assert_equal 'terminated', r['action']
|
489
|
+
# end
|
490
|
+
|
461
491
|
protected
|
462
492
|
|
463
493
|
def register_catchall_participant
|
@@ -196,30 +196,32 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
196
196
|
|
197
197
|
# helper
|
198
198
|
#
|
199
|
-
def run_concurrence(concurrence_attributes
|
199
|
+
def run_concurrence(concurrence_attributes)
|
200
200
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
201
|
+
reverse_reply_order = concurrence_attributes.delete(:_reverse_reply_order)
|
202
|
+
|
203
|
+
pdef = Ruote.define do
|
204
|
+
concurrence(concurrence_attributes) do
|
205
|
+
alpha
|
206
|
+
alpha
|
207
|
+
alpha
|
207
208
|
end
|
208
209
|
alpha
|
209
210
|
end
|
210
211
|
|
211
212
|
alpha = @dashboard.register_participant :alpha, Ruote::StorageParticipant
|
212
213
|
|
213
|
-
noisy if noise
|
214
|
-
|
215
214
|
wfid = @dashboard.launch(pdef)
|
216
215
|
|
217
|
-
wait_for(
|
218
|
-
wait_for(:alpha)
|
216
|
+
3.times { wait_for('dispatched') }
|
219
217
|
|
220
|
-
|
221
|
-
|
218
|
+
wis = @dashboard.storage_participant.to_a
|
219
|
+
wis.reverse! if reverse_reply_order
|
220
|
+
wis.each do |wi|
|
222
221
|
wi.fields['seen'] = wi.fei.expid
|
222
|
+
wi.fields[wi.fei.expid] = 'alpha'
|
223
|
+
wi.fields['a'] = [ wi.fei.expid, 'x' ]
|
224
|
+
wi.fields['h'] = { wi.fei.expid => 9 }
|
223
225
|
alpha.proceed(wi)
|
224
226
|
end
|
225
227
|
|
@@ -233,51 +235,165 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
233
235
|
wi
|
234
236
|
end
|
235
237
|
|
236
|
-
|
238
|
+
#
|
239
|
+
# merge tests
|
240
|
+
|
241
|
+
def test_default_merge # first
|
237
242
|
|
238
|
-
wi = run_concurrence({}
|
243
|
+
wi = run_concurrence({})
|
239
244
|
|
240
|
-
assert_equal '
|
241
|
-
|
245
|
+
assert_equal '0_0_0', wi.fields['seen']
|
246
|
+
end
|
247
|
+
|
248
|
+
def test_default_merge__reverse # first
|
249
|
+
|
250
|
+
wi = run_concurrence(:_reverse_reply_order => true)
|
251
|
+
|
252
|
+
assert_equal '0_0_2', wi.fields['seen']
|
242
253
|
end
|
243
254
|
|
244
255
|
def test_merge_last
|
245
256
|
|
246
|
-
wi = run_concurrence(
|
257
|
+
wi = run_concurrence(:merge => :last)
|
258
|
+
|
259
|
+
assert_equal '0_0_2', wi.fields['seen']
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_merge_last__reverse
|
263
|
+
|
264
|
+
wi = run_concurrence(:merge => :last, :_reverse_reply_order => true)
|
265
|
+
|
266
|
+
assert_equal '0_0_0', wi.fields['seen']
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_merge_highest
|
270
|
+
|
271
|
+
wi = run_concurrence(:merge => :highest)
|
272
|
+
|
273
|
+
assert_equal '0_0_0', wi.fields['seen']
|
274
|
+
end
|
275
|
+
|
276
|
+
def test_merge_highest__reverse
|
277
|
+
|
278
|
+
wi = run_concurrence(:merge => :highest, :_reverse_reply_order => true)
|
279
|
+
|
280
|
+
assert_equal '0_0_0', wi.fields['seen']
|
281
|
+
end
|
282
|
+
|
283
|
+
def test_merge_lowest
|
284
|
+
|
285
|
+
wi = run_concurrence(:merge => :lowest)
|
286
|
+
|
287
|
+
assert_equal '0_0_2', wi.fields['seen']
|
288
|
+
end
|
289
|
+
|
290
|
+
def test_merge_lowest__reverse
|
291
|
+
|
292
|
+
wi = run_concurrence(:merge => :lowest, :_reverse_reply_order => true)
|
293
|
+
|
294
|
+
assert_equal '0_0_2', wi.fields['seen']
|
295
|
+
end
|
296
|
+
|
297
|
+
#
|
298
|
+
# merge_type tests
|
299
|
+
|
300
|
+
#def test_merge_type_override # already tested above
|
301
|
+
#end
|
302
|
+
|
303
|
+
def test_merge_type_mix
|
304
|
+
|
305
|
+
wi = run_concurrence(:merge_type => :mix)
|
247
306
|
|
248
|
-
assert_equal
|
249
|
-
|
307
|
+
assert_equal(
|
308
|
+
%w[ 0_0_0 0_0_1 0_0_2 a dispatched_at h params seen ],
|
309
|
+
wi.fields.keys.collect { |k| k.to_s }.sort)
|
310
|
+
|
311
|
+
assert_equal('0_0_0', wi.fields['seen'])
|
250
312
|
end
|
251
313
|
|
252
|
-
def
|
314
|
+
def test_merge_type_isolate
|
253
315
|
|
254
|
-
wi = run_concurrence(
|
316
|
+
wi = run_concurrence(:merge_type => :isolate)
|
255
317
|
|
256
318
|
assert_equal(
|
257
|
-
%w[ 0 1 dispatched_at params ],
|
319
|
+
%w[ 0 1 2 dispatched_at params ],
|
258
320
|
wi.fields.keys.collect { |k| k.to_s }.sort)
|
259
321
|
|
260
322
|
assert_equal({ 'ref' => 'alpha' }, wi.fields['params'])
|
261
|
-
assert_equal(%w[ seen ], wi.fields['0'].keys)
|
262
|
-
assert_equal(%w[ seen ], wi.fields['1'].keys)
|
323
|
+
assert_equal(%w[ 0_0_0 a h seen ], wi.fields['0'].keys.sort)
|
324
|
+
assert_equal(%w[ 0_0_1 a h seen ], wi.fields['1'].keys.sort)
|
325
|
+
assert_equal(%w[ 0_0_2 a h seen ], wi.fields['2'].keys.sort)
|
263
326
|
end
|
264
327
|
|
265
|
-
def
|
328
|
+
def test_merge_type_stack
|
266
329
|
|
267
|
-
wi = run_concurrence(
|
330
|
+
wi = run_concurrence(:merge_type => :stack)
|
268
331
|
|
269
332
|
assert_equal(
|
270
333
|
%w[ dispatched_at params stack stack_attributes ],
|
271
334
|
wi.fields.keys.collect { |k| k.to_s }.sort)
|
272
335
|
|
273
336
|
assert_equal({ 'ref' => 'alpha' }, wi.fields['params'])
|
274
|
-
assert_equal(%w[ seen ], wi.fields['stack'][0].keys)
|
275
|
-
assert_equal(%w[ seen ], wi.fields['stack'][1].keys)
|
337
|
+
assert_equal(%w[ 0_0_0 a h seen ], wi.fields['stack'][0].keys.sort)
|
338
|
+
assert_equal(%w[ 0_0_1 a h seen ], wi.fields['stack'][1].keys.sort)
|
339
|
+
assert_equal(%w[ 0_0_2 a h seen ], wi.fields['stack'][2].keys.sort)
|
340
|
+
end
|
341
|
+
|
342
|
+
def test_merge_type_union
|
343
|
+
|
344
|
+
wi = run_concurrence(:merge_type => :union)
|
345
|
+
|
346
|
+
assert_equal(
|
347
|
+
%w[ 0_0_0 0_0_1 0_0_2 a dispatched_at h params seen ],
|
348
|
+
wi.fields.keys.collect { |k| k.to_s }.sort)
|
349
|
+
|
350
|
+
assert_equal('0_0_2', wi.fields['seen'])
|
351
|
+
assert_equal(%w[ 0_0_0 x 0_0_1 0_0_2 ], wi.fields['a'])
|
352
|
+
assert_equal(%w[ 0_0_0 0_0_1 0_0_2 ], wi.fields['h'].keys.sort)
|
353
|
+
end
|
354
|
+
|
355
|
+
def test_merge_type_concat
|
356
|
+
|
357
|
+
wi = run_concurrence(:merge_type => :concat)
|
358
|
+
|
359
|
+
assert_equal(
|
360
|
+
%w[ 0_0_0 0_0_1 0_0_2 a dispatched_at h params seen ],
|
361
|
+
wi.fields.keys.collect { |k| k.to_s }.sort)
|
362
|
+
|
363
|
+
assert_equal('0_0_2', wi.fields['seen'])
|
364
|
+
assert_equal(%w[ 0_0_0 x 0_0_1 x 0_0_2 x], wi.fields['a'])
|
365
|
+
assert_equal(%w[ 0_0_0 0_0_1 0_0_2 ], wi.fields['h'].keys.sort)
|
276
366
|
end
|
277
367
|
|
368
|
+
# not deep enough though
|
369
|
+
#
|
370
|
+
def test_merge_type_deep
|
371
|
+
|
372
|
+
wi = run_concurrence(:merge_type => :deep)
|
373
|
+
|
374
|
+
assert_equal(
|
375
|
+
%w[ 0_0_0 0_0_1 0_0_2 a dispatched_at h params seen ],
|
376
|
+
wi.fields.keys.collect { |k| k.to_s }.sort)
|
377
|
+
|
378
|
+
assert_equal('0_0_2', wi.fields['seen'])
|
379
|
+
assert_equal(%w[ 0_0_0 x 0_0_1 x 0_0_2 x ], wi.fields['a'])
|
380
|
+
assert_equal(%w[ 0_0_0 0_0_1 0_0_2 ], wi.fields['h'].keys.sort)
|
381
|
+
end
|
382
|
+
|
383
|
+
def test_merge_type_ignore
|
384
|
+
|
385
|
+
wi = run_concurrence(:merge_type => :ignore)
|
386
|
+
|
387
|
+
assert_equal(
|
388
|
+
%w[ dispatched_at params ], wi.fields.keys.collect { |k| k.to_s }.sort)
|
389
|
+
end
|
390
|
+
|
391
|
+
#
|
392
|
+
# count tests
|
393
|
+
|
278
394
|
# helper
|
279
395
|
#
|
280
|
-
def run_test_count(remaining
|
396
|
+
def run_test_count(remaining)
|
281
397
|
|
282
398
|
pdef = Ruote.process_definition do
|
283
399
|
concurrence :count => 1, :remaining => remaining do
|
@@ -288,8 +404,6 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
288
404
|
|
289
405
|
@dashboard.register_participant '.+', Ruote::StorageParticipant
|
290
406
|
|
291
|
-
noisy if noise
|
292
|
-
|
293
407
|
wfid = @dashboard.launch(pdef)
|
294
408
|
|
295
409
|
wait_for(:alpha)
|
@@ -303,7 +417,7 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
303
417
|
|
304
418
|
def test_count
|
305
419
|
|
306
|
-
wfid = run_test_count('cancel'
|
420
|
+
wfid = run_test_count('cancel')
|
307
421
|
|
308
422
|
#puts
|
309
423
|
#logger.log.each { |e| p e }
|
@@ -317,7 +431,7 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
317
431
|
|
318
432
|
def test_count_remaining_forget
|
319
433
|
|
320
|
-
wfid = run_test_count('forget'
|
434
|
+
wfid = run_test_count('forget')
|
321
435
|
|
322
436
|
#assert_equal 1, logger.log.select { |e| e['action'] == 'forget' }.size
|
323
437
|
|
@@ -326,6 +440,7 @@ class EftConcurrenceTest < Test::Unit::TestCase
|
|
326
440
|
|
327
441
|
#@dashboard.context.storage.get_many('expressions').each { |e| p e['fei'] }
|
328
442
|
#puts @dashboard.context.storage.dump('expressions')
|
443
|
+
#p @dashboard.ps(wfid)
|
329
444
|
assert_equal 2, @dashboard.context.storage.get_many('expressions').size
|
330
445
|
assert_not_nil @dashboard.process(wfid)
|
331
446
|
|
@@ -21,8 +21,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
#noisy
|
25
|
-
|
26
24
|
assert_trace 'field', pdef
|
27
25
|
end
|
28
26
|
|
@@ -38,8 +36,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
38
36
|
end
|
39
37
|
end
|
40
38
|
|
41
|
-
#noisy
|
42
|
-
|
43
39
|
assert_trace(%w[ a b0 c0 d0 ], pdef)
|
44
40
|
end
|
45
41
|
|
@@ -57,8 +53,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
57
53
|
end
|
58
54
|
end
|
59
55
|
|
60
|
-
#noisy
|
61
|
-
|
62
56
|
assert_trace(%w[ a:toto b:atlantic_city ], pdef)
|
63
57
|
end
|
64
58
|
|
@@ -73,8 +67,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
73
67
|
end
|
74
68
|
end
|
75
69
|
|
76
|
-
#noisy
|
77
|
-
|
78
70
|
assert_trace(%w[ a btoto cAsia ], pdef)
|
79
71
|
end
|
80
72
|
|
@@ -86,8 +78,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
86
78
|
end
|
87
79
|
end
|
88
80
|
|
89
|
-
#noisy
|
90
|
-
|
91
81
|
wfid = @dashboard.launch(pdef)
|
92
82
|
|
93
83
|
@dashboard.wait_for(wfid)
|
@@ -106,8 +96,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
106
96
|
end
|
107
97
|
end
|
108
98
|
|
109
|
-
#noisy
|
110
|
-
|
111
99
|
@dashboard.context['ruby_eval_allowed'] = true
|
112
100
|
|
113
101
|
assert_trace('>3<', pdef)
|
@@ -124,8 +112,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
124
112
|
end
|
125
113
|
end
|
126
114
|
|
127
|
-
#noisy
|
128
|
-
|
129
115
|
@dashboard.context['ruby_eval_allowed'] = true
|
130
116
|
|
131
117
|
assert_trace [ 'person' ] * 3, pdef
|
@@ -140,8 +126,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
140
126
|
end
|
141
127
|
end
|
142
128
|
|
143
|
-
#noisy
|
144
|
-
|
145
129
|
@dashboard.context['ruby_eval_allowed'] = true
|
146
130
|
|
147
131
|
assert_trace 'person', pdef
|
@@ -157,8 +141,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
157
141
|
end
|
158
142
|
end
|
159
143
|
|
160
|
-
#noisy
|
161
|
-
|
162
144
|
assert_trace 'AA', pdef
|
163
145
|
end
|
164
146
|
|
@@ -189,8 +171,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
189
171
|
|
190
172
|
@dashboard.context['ruby_eval_allowed'] = true
|
191
173
|
|
192
|
-
#noisy
|
193
|
-
|
194
174
|
assert_trace 'alpha/bravo/charly', pdef
|
195
175
|
end
|
196
176
|
|
@@ -221,11 +201,14 @@ class FtDollarTest < Test::Unit::TestCase
|
|
221
201
|
set 'f:F' => '$a'
|
222
202
|
set 'f:G' => '$nada'
|
223
203
|
set 'f:H' => '$a '
|
204
|
+
set 'f:I' => '$v:a '
|
205
|
+
set 'f:J' => ' $a'
|
206
|
+
set 'f:K' => ' $v:a'
|
207
|
+
set 'f:L' => '$$'
|
208
|
+
set 'f:M' => '$$a'
|
224
209
|
filter :f => /^[a-c]$/, :del => true
|
225
210
|
end
|
226
211
|
|
227
|
-
#noisy
|
228
|
-
|
229
212
|
wfid = @dashboard.launch(pdef)
|
230
213
|
|
231
214
|
r = @dashboard.wait_for(wfid)
|
@@ -235,11 +218,16 @@ class FtDollarTest < Test::Unit::TestCase
|
|
235
218
|
'A' => %w[ A B C ],
|
236
219
|
'B' => %w[ A B C ],
|
237
220
|
'C' => %w[ venture capitalist ],
|
238
|
-
'D' =>
|
239
|
-
'E' =>
|
221
|
+
'D' => nil,
|
222
|
+
'E' => nil,
|
240
223
|
'F' => %w[ A B C ],
|
241
|
-
'G' =>
|
242
|
-
'H' => '$a '
|
224
|
+
'G' => nil,
|
225
|
+
'H' => '$a ',
|
226
|
+
'I' => '$v:a ',
|
227
|
+
'J' => ' $a',
|
228
|
+
'K' => ' $v:a',
|
229
|
+
'L' => '$$',
|
230
|
+
'M' => '$$a'
|
243
231
|
},
|
244
232
|
r['workitem']['fields'])
|
245
233
|
end
|
@@ -255,8 +243,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
255
243
|
wi.fields['parameters'] = wi.fields['params']
|
256
244
|
end
|
257
245
|
|
258
|
-
#noisy
|
259
|
-
|
260
246
|
wfid = @dashboard.launch(pdef)
|
261
247
|
|
262
248
|
r = @dashboard.wait_for(wfid)
|
@@ -304,8 +290,6 @@ class FtDollarTest < Test::Unit::TestCase
|
|
304
290
|
|
305
291
|
def test_participant_params
|
306
292
|
|
307
|
-
#@dashboard.noisy = true
|
308
|
-
|
309
293
|
@dashboard.register :toto do |workitem, fexp|
|
310
294
|
workitem['a'] = fexp.compile_atts
|
311
295
|
workitem['p'] = workitem.params
|