openwferu 0.9.15 → 0.9.16
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +4 -2
- data/lib/openwfe/engine/engine.rb +143 -25
- data/lib/openwfe/engine/file_persisted_engine.rb +3 -3
- data/lib/openwfe/expool/errorjournal.rb +48 -25
- data/lib/openwfe/expool/expressionpool.rb +77 -106
- data/lib/openwfe/expool/expstorage.rb +6 -5
- data/lib/openwfe/expool/threadedexpstorage.rb +190 -0
- data/lib/openwfe/expool/yamlexpstorage.rb +5 -150
- data/lib/openwfe/expressions/condition.rb +6 -6
- data/lib/openwfe/expressions/environment.rb +7 -2
- data/lib/openwfe/expressions/expressionmap.rb +14 -0
- data/lib/openwfe/expressions/fe_command.rb +2 -1
- data/lib/openwfe/expressions/fe_concurrence.rb +40 -18
- data/lib/openwfe/expressions/fe_cron.rb +14 -11
- data/lib/openwfe/expressions/fe_cursor.rb +2 -3
- data/lib/openwfe/expressions/fe_define.rb +34 -31
- data/lib/openwfe/expressions/fe_equals.rb +11 -21
- data/lib/openwfe/expressions/fe_filter_definition.rb +0 -2
- data/lib/openwfe/expressions/fe_fqv.rb +1 -3
- data/lib/openwfe/expressions/fe_if.rb +37 -12
- data/lib/openwfe/expressions/fe_iterator.rb +1 -1
- data/lib/openwfe/expressions/fe_listen.rb +147 -28
- data/lib/openwfe/expressions/fe_losfor.rb +13 -1
- data/lib/openwfe/expressions/fe_misc.rb +70 -11
- data/lib/openwfe/expressions/fe_participant.rb +3 -3
- data/lib/openwfe/expressions/fe_reserve.rb +1 -1
- data/lib/openwfe/expressions/fe_save.rb +11 -12
- data/lib/openwfe/expressions/fe_sequence.rb +22 -29
- data/lib/openwfe/expressions/fe_sleep.rb +11 -7
- data/lib/openwfe/expressions/fe_subprocess.rb +24 -10
- data/lib/openwfe/expressions/fe_value.rb +35 -15
- data/lib/openwfe/expressions/fe_when.rb +2 -4
- data/lib/openwfe/expressions/flowexpression.rb +73 -37
- data/lib/openwfe/expressions/merge.rb +2 -4
- data/lib/openwfe/expressions/raw.rb +40 -31
- data/lib/openwfe/expressions/raw_prog.rb +18 -9
- data/lib/openwfe/expressions/raw_xml.rb +1 -8
- data/lib/openwfe/expressions/simplerep.rb +27 -5
- data/lib/openwfe/expressions/time.rb +45 -15
- data/lib/openwfe/expressions/timeout.rb +2 -1
- data/lib/openwfe/expressions/wtemplate.rb +2 -2
- data/lib/openwfe/flowexpressionid.rb +62 -16
- data/lib/openwfe/listeners/listener.rb +28 -37
- data/lib/openwfe/listeners/listeners.rb +1 -1
- data/lib/openwfe/listeners/socketlisteners.rb +7 -15
- data/lib/openwfe/logging.rb +5 -4
- data/lib/openwfe/{rest → orest}/controlclient.rb +3 -5
- data/lib/openwfe/{rest → orest}/definitions.rb +0 -2
- data/lib/openwfe/{rest → orest}/exception.rb +0 -0
- data/lib/openwfe/{rest → orest}/oldrestservlet.rb +1 -1
- data/lib/openwfe/{rest → orest}/osocket.rb +1 -1
- data/lib/openwfe/{rest → orest}/restclient.rb +0 -2
- data/lib/openwfe/orest/workitem.rb +206 -0
- data/lib/openwfe/{rest → orest}/worklistclient.rb +15 -5
- data/lib/openwfe/{rest → orest}/xmlcodec.rb +4 -1
- data/lib/openwfe/participants/enoparticipants.rb +4 -14
- data/lib/openwfe/participants/participantmap.rb +16 -12
- data/lib/openwfe/participants/participants.rb +46 -1
- data/lib/openwfe/participants/socketparticipants.rb +1 -6
- data/lib/openwfe/service.rb +15 -6
- data/lib/openwfe/storage/yamlcustom.rb +3 -0
- data/lib/openwfe/storage/yamlfilestorage.rb +3 -1
- data/lib/openwfe/util/dollar.rb +21 -14
- data/lib/openwfe/util/lru.rb +29 -10
- data/lib/openwfe/util/observable.rb +4 -1
- data/lib/openwfe/util/otime.rb +3 -0
- data/lib/openwfe/util/scheduler.rb +346 -114
- data/lib/openwfe/utils.rb +67 -13
- data/lib/openwfe/version.rb +1 -1
- data/lib/openwfe/workitem.rb +22 -165
- data/lib/openwfe/worklist/oldrest.rb +2 -2
- data/test/bm/bm_1_xml_vs_prog.rb +56 -0
- data/test/{ft_26_load.rb → bm/ft_26_load.rb} +0 -0
- data/test/{ft_26b_load.rb → bm/ft_26b_load.rb} +0 -0
- data/test/{ft_26c_load.rb → bm/ft_26c_load.rb} +16 -4
- data/test/clone_test.rb +62 -0
- data/test/cron_test.rb +56 -1
- data/test/cronline_test.rb +17 -8
- data/test/description_test.rb +57 -0
- data/test/dollar_test.rb +17 -6
- data/test/eno_test.rb +22 -9
- data/test/fe_lookup_att_test.rb +50 -0
- data/test/fei_test.rb +18 -9
- data/test/flowtestbase.rb +24 -2
- data/test/ft_0.rb +10 -12
- data/test/ft_0e_multibody.rb +34 -0
- data/test/ft_10_loop.rb +4 -6
- data/test/ft_11_ppd.rb +5 -20
- data/test/ft_14b_subprocess.rb +2 -2
- data/test/ft_15_iterator.rb +56 -4
- data/test/ft_15b_iterator.rb +48 -0
- data/test/ft_16_fqv.rb +18 -3
- data/test/ft_23c_wait.rb +7 -5
- data/test/ft_25_cancel.rb +5 -3
- data/test/ft_27_getflowpos.rb +14 -11
- data/test/ft_28_fileparticipant.rb +3 -4
- data/test/ft_2_concurrence.rb +8 -12
- data/test/ft_2b_concurrence.rb +3 -2
- data/test/ft_30_socketlistener.rb +5 -6
- data/test/ft_32c_journal.rb +2 -2
- data/test/ft_32d_journal.rb +5 -6
- data/test/ft_33_description.rb +8 -3
- data/test/ft_34_cancelwfid.rb +3 -3
- data/test/ft_38_tag.rb +7 -10
- data/test/ft_39_reserve.rb +4 -2
- data/test/ft_3_equals.rb +18 -13
- data/test/ft_44b_restore.rb +2 -6
- data/test/ft_49_condition.rb +16 -12
- data/test/ft_4_misc.rb +51 -12
- data/test/ft_50_xml_attribute.rb +1 -1
- data/test/ft_54_listen.rb +96 -10
- data/test/ft_54b_listen.rb +68 -0
- data/test/ft_55_ptimeout.rb +1 -2
- data/test/ft_58_ejournal.rb +8 -33
- data/test/ft_59_ps.rb +2 -3
- data/test/ft_59b_ps_for_pat.rb +59 -0
- data/test/ft_5_time.rb +45 -4
- data/test/ft_60_ecancel.rb +7 -7
- data/test/ft_61_elsub.rb +1 -1
- data/test/ft_64_alias.rb +1 -1
- data/test/ft_67_schedlaunch.rb +29 -16
- data/test/ft_69_cancelmissing.rb +1 -1
- data/test/ft_6_lambda.rb +8 -6
- data/test/ft_70_lookupvar.rb +2 -2
- data/test/ft_71_log.rb +60 -0
- data/test/ft_72_lookup_processes.rb +79 -0
- data/test/ft_73_cancel_sub.rb +144 -0
- data/test/ft_74_block_and_workitem_dup.rb +63 -0
- data/test/ft_75_ruby_attributes.rb +87 -0
- data/test/ft_76_merge_isolate.rb +90 -0
- data/test/ft_7_lose.rb +2 -1
- data/test/ft_tests.rb +9 -0
- data/test/lookup_att_test.rb +90 -0
- data/test/misc_test.rb +33 -50
- data/test/orest_test.rb +1 -1
- data/test/participant_test.rb +32 -8
- data/test/pending.rb +6 -7
- data/test/rake_ltest.rb +3 -0
- data/test/rake_qtest.rb +4 -1
- data/test/raw_prog_test.rb +1 -1
- data/test/restart_cron_test.rb +6 -6
- data/test/restart_sleep_test.rb +8 -8
- data/test/ruby_procdef_test.rb +2 -2
- data/test/rutest_utils.rb +9 -3
- data/test/scheduler_1_test.rb +88 -0
- data/test/scheduler_test.rb +49 -4
- data/test/sec_test.rb +18 -11
- metadata +51 -34
- data/test/cron_test_2.rb +0 -50
data/test/ft_16_fqv.rb
CHANGED
@@ -20,7 +20,7 @@ class FlowTest16 < Test::Unit::TestCase
|
|
20
20
|
#end
|
21
21
|
|
22
22
|
def test_fqv_0
|
23
|
-
dotest(
|
23
|
+
dotest(
|
24
24
|
'''<process-definition name="n" revision="0">
|
25
25
|
<sequence>
|
26
26
|
<set variable="x"><q>y</q></set>
|
@@ -31,7 +31,7 @@ class FlowTest16 < Test::Unit::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_fqv_1
|
34
|
-
dotest(
|
34
|
+
dotest(
|
35
35
|
'''<process-definition name="n" revision="0">
|
36
36
|
<sequence>
|
37
37
|
<set variable="x0"><q>y0</q></set>
|
@@ -43,7 +43,7 @@ class FlowTest16 < Test::Unit::TestCase
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_fqv_2
|
46
|
-
dotest(
|
46
|
+
dotest(
|
47
47
|
'''<process-definition name="n" revision="0">
|
48
48
|
<sequence>
|
49
49
|
<set field="x0"><q>y0</q></set>
|
@@ -54,5 +54,20 @@ class FlowTest16 < Test::Unit::TestCase
|
|
54
54
|
'x1 is "y0"')
|
55
55
|
end
|
56
56
|
|
57
|
+
class Fqv3 < OpenWFE::ProcessDefinition
|
58
|
+
sequence do
|
59
|
+
_set :f => "x0" do
|
60
|
+
_q "y0"
|
61
|
+
end
|
62
|
+
_set :v => "x1" do
|
63
|
+
_f "x0"
|
64
|
+
end
|
65
|
+
_print "x1 is \"${x1}\""
|
66
|
+
end
|
67
|
+
end
|
68
|
+
def test_fqv_3
|
69
|
+
dotest(Fqv3, 'x1 is "y0"')
|
70
|
+
end
|
71
|
+
|
57
72
|
end
|
58
73
|
|
data/test/ft_23c_wait.rb
CHANGED
@@ -43,14 +43,15 @@ class FlowTest23c < Test::Unit::TestCase
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_0
|
46
|
+
|
46
47
|
dotest(
|
47
48
|
Wait0c,
|
48
49
|
"""
|
49
50
|
before done
|
50
51
|
after wait
|
51
52
|
over
|
52
|
-
""".strip
|
53
|
-
3)
|
53
|
+
""".strip)
|
54
|
+
#3)
|
54
55
|
end
|
55
56
|
|
56
57
|
#
|
@@ -77,15 +78,16 @@ over
|
|
77
78
|
end
|
78
79
|
|
79
80
|
def test_1
|
81
|
+
|
80
82
|
dotest(
|
81
83
|
Wait1c,
|
82
84
|
"""
|
83
85
|
before done
|
84
86
|
after when
|
85
87
|
over
|
86
|
-
""".strip
|
87
|
-
4)
|
88
|
+
""".strip)
|
89
|
+
#4)
|
88
90
|
end
|
89
|
-
|
91
|
+
|
90
92
|
end
|
91
93
|
|
data/test/ft_25_cancel.rb
CHANGED
@@ -24,6 +24,7 @@ class FlowTest25 < Test::Unit::TestCase
|
|
24
24
|
# TEST 0
|
25
25
|
|
26
26
|
def test_cancel_0
|
27
|
+
|
27
28
|
dotest(
|
28
29
|
'''
|
29
30
|
<process-definition name="25_cancel" revision="0">
|
@@ -35,7 +36,7 @@ class FlowTest25 < Test::Unit::TestCase
|
|
35
36
|
</process-definition>
|
36
37
|
'''.strip,
|
37
38
|
"before",
|
38
|
-
0.
|
39
|
+
0.700)
|
39
40
|
end
|
40
41
|
|
41
42
|
|
@@ -55,10 +56,11 @@ class FlowTest25 < Test::Unit::TestCase
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def test_cancel_1
|
59
|
+
|
58
60
|
dotest(
|
59
61
|
TestDefinition1,
|
60
|
-
"before",
|
61
|
-
0.
|
62
|
+
"before",
|
63
|
+
0.900)
|
62
64
|
end
|
63
65
|
|
64
66
|
|
data/test/ft_27_getflowpos.rb
CHANGED
@@ -43,14 +43,14 @@ class FlowTest27 < Test::Unit::TestCase
|
|
43
43
|
|
44
44
|
fei = @engine.launch(TestDefinition0)
|
45
45
|
|
46
|
-
sleep 0.
|
46
|
+
sleep 0.200
|
47
47
|
|
48
48
|
l = @engine.get_process_stack(fei.wfid)
|
49
49
|
|
50
|
-
#print_exp_list
|
50
|
+
#print_exp_list l
|
51
51
|
|
52
52
|
assert_equal \
|
53
|
-
l.size,
|
53
|
+
3, l.size, "get_process_stack() returned #{l.size} elements"
|
54
54
|
|
55
55
|
ps = @engine.list_process_status
|
56
56
|
#puts
|
@@ -61,6 +61,8 @@ 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
|
+
assert_not_nil ps[fei.parent_wfid].launch_time
|
65
|
+
|
64
66
|
ps = @engine.list_process_status fei.wfid[0, 4]
|
65
67
|
|
66
68
|
assert_equal ps[fei.parent_wfid].errors.size, 0
|
@@ -89,15 +91,16 @@ class FlowTest27 < Test::Unit::TestCase
|
|
89
91
|
end
|
90
92
|
end
|
91
93
|
|
92
|
-
#def xxxx_gfp_0b
|
93
94
|
def test_gfp_0b
|
94
95
|
|
95
|
-
|
96
|
+
log_level_to_debug
|
97
|
+
|
98
|
+
sp = @engine.register_participant "store_p", OpenWFE::YamlParticipant
|
96
99
|
|
97
100
|
#fei = @engine.launch TestDefinition0
|
98
101
|
fei = @engine.launch Gfp27b
|
99
102
|
|
100
|
-
sleep 0.
|
103
|
+
sleep 0.200
|
101
104
|
|
102
105
|
#l = @engine.get_process_stack(fei.wfid)
|
103
106
|
l = @engine.get_process_stack(fei)
|
@@ -106,16 +109,16 @@ class FlowTest27 < Test::Unit::TestCase
|
|
106
109
|
|
107
110
|
#print_exp_list l
|
108
111
|
|
109
|
-
assert_equal l.size
|
112
|
+
assert_equal 3, l.size
|
110
113
|
|
111
114
|
l = @engine.list_processes()
|
112
|
-
assert_equal l.size
|
115
|
+
assert_equal 1, l.size
|
113
116
|
|
114
117
|
l = @engine.list_processes(false, "nada")
|
115
|
-
assert_equal l.size
|
118
|
+
assert_equal 0, l.size
|
116
119
|
|
117
120
|
l = @engine.list_workflows(false, fei.wfid[0, 3])
|
118
|
-
assert_equal l.size
|
121
|
+
assert_equal 1, l.size
|
119
122
|
|
120
123
|
#
|
121
124
|
# resume flow and terminate it
|
@@ -128,7 +131,7 @@ class FlowTest27 < Test::Unit::TestCase
|
|
128
131
|
|
129
132
|
@engine.wait_for fei
|
130
133
|
|
131
|
-
assert_equal sp.size
|
134
|
+
assert_equal 0, sp.size
|
132
135
|
end
|
133
136
|
|
134
137
|
end
|
@@ -48,17 +48,16 @@ class FlowTest28 < Test::Unit::TestCase
|
|
48
48
|
|
49
49
|
fei = @engine.launch(TestDefinition0)
|
50
50
|
|
51
|
-
sleep 0.
|
51
|
+
sleep 0.300
|
52
52
|
|
53
53
|
Find.find("./work/out/") do |path|
|
54
54
|
next unless path.match ".*\.yaml$"
|
55
55
|
FileUtils.mv(path, "./work/in/")
|
56
56
|
end
|
57
57
|
|
58
|
-
sleep 2
|
58
|
+
sleep 2.000
|
59
59
|
|
60
|
-
assert_equal
|
61
|
-
engine.get_expression_storage.size, 1
|
60
|
+
assert_equal 1, engine.get_expression_storage.size
|
62
61
|
end
|
63
62
|
|
64
63
|
end
|
data/test/ft_2_concurrence.rb
CHANGED
@@ -22,9 +22,10 @@ class FlowTest2 < Test::Unit::TestCase
|
|
22
22
|
|
23
23
|
# test_con_0 got moved to ft_2c_concurrence.rb
|
24
24
|
|
25
|
-
#def xxxx_con_1
|
26
25
|
def test_con_1
|
27
26
|
|
27
|
+
#log_level_to_debug
|
28
|
+
|
28
29
|
dotest(
|
29
30
|
'''<process-definition name="ft_2_concurrence" revision="1">
|
30
31
|
<concurrence
|
@@ -41,10 +42,7 @@ class FlowTest2 < Test::Unit::TestCase
|
|
41
42
|
true)
|
42
43
|
end
|
43
44
|
|
44
|
-
def
|
45
|
-
#def test_con_2
|
46
|
-
|
47
|
-
#$OWFE_LOG.level = Logger::INFO
|
45
|
+
def _test_con_2
|
48
46
|
|
49
47
|
dotest(
|
50
48
|
'''<process-definition name="ft_2_concurrence" revision="2">
|
@@ -58,12 +56,10 @@ class FlowTest2 < Test::Unit::TestCase
|
|
58
56
|
</process-definition>''',
|
59
57
|
"b",
|
60
58
|
true)
|
61
|
-
|
62
|
-
#$OWFE_LOG.level = Logger::INFO
|
63
59
|
end
|
64
60
|
|
65
|
-
#def xxxx_con_3
|
66
61
|
def test_con_3
|
62
|
+
|
67
63
|
dotest(
|
68
64
|
'''<process-definition name="ft_2_concurrence" revision="3">
|
69
65
|
<concurrence over-if="${over}">
|
@@ -75,8 +71,8 @@ class FlowTest2 < Test::Unit::TestCase
|
|
75
71
|
true)
|
76
72
|
end
|
77
73
|
|
78
|
-
#def xxxx_con_4
|
79
74
|
def test_con_4
|
75
|
+
|
80
76
|
dotest(
|
81
77
|
'''<process-definition name="ft_2_concurrence" revision="4">
|
82
78
|
<concurrence over-if="${nada}">
|
@@ -92,8 +88,8 @@ a""",
|
|
92
88
|
true)
|
93
89
|
end
|
94
90
|
|
95
|
-
#def xxxx_con_5
|
96
91
|
def test_con_5
|
92
|
+
|
97
93
|
dotest(
|
98
94
|
'''<process-definition name="ft_2_concurrence" revision="5">
|
99
95
|
<concurrence over-if="false">
|
@@ -122,9 +118,9 @@ a""",
|
|
122
118
|
end
|
123
119
|
end
|
124
120
|
|
125
|
-
#def xxxx_con_6
|
126
121
|
def test_con_6
|
127
|
-
|
122
|
+
|
123
|
+
dotest TestDefinition6, "b\nc"
|
128
124
|
end
|
129
125
|
|
130
126
|
end
|
data/test/ft_2b_concurrence.rb
CHANGED
@@ -39,9 +39,10 @@ class FlowTest2b < Test::Unit::TestCase
|
|
39
39
|
#
|
40
40
|
# TEST 0
|
41
41
|
|
42
|
-
#def xxxx_con_0
|
43
42
|
def test_con_0
|
43
|
+
|
44
44
|
prepare()
|
45
|
+
|
45
46
|
dotest(\
|
46
47
|
'''<process-definition name="2b_con" revision="0">
|
47
48
|
<sequence>
|
@@ -169,7 +170,7 @@ ${f:charly}</print>
|
|
169
170
|
end
|
170
171
|
|
171
172
|
def test_2
|
172
|
-
dotest
|
173
|
+
dotest Isolate01, "0\n1\n2", true
|
173
174
|
end
|
174
175
|
|
175
176
|
end
|
@@ -31,13 +31,12 @@ class FlowTest30 < Test::Unit::TestCase
|
|
31
31
|
# TEST 0
|
32
32
|
|
33
33
|
class TestDefinition0 < ProcessDefinition
|
34
|
-
|
35
|
-
_print "${f:message}"
|
36
|
-
end
|
34
|
+
_print "${f:message}"
|
37
35
|
end
|
38
36
|
|
39
|
-
|
40
|
-
|
37
|
+
def test_0
|
38
|
+
|
39
|
+
log_level_to_debug
|
41
40
|
|
42
41
|
sl = OpenWFE::SocketListener.new(
|
43
42
|
"socket_listener", @engine.application_context, 7008)
|
@@ -58,7 +57,7 @@ class FlowTest30 < Test::Unit::TestCase
|
|
58
57
|
#puts ">>>#{reply}<<<"
|
59
58
|
assert (reply.match "^.fei .*0.$")
|
60
59
|
|
61
|
-
sleep 0.
|
60
|
+
sleep 0.200
|
62
61
|
|
63
62
|
trace = @tracer.to_s
|
64
63
|
|
data/test/ft_32c_journal.rb
CHANGED
@@ -56,7 +56,7 @@ class FlowTest32c < Test::Unit::TestCase
|
|
56
56
|
li = LaunchItem.new Test0
|
57
57
|
fei = @engine.launch li
|
58
58
|
|
59
|
-
sleep 0.
|
59
|
+
sleep 0.500
|
60
60
|
|
61
61
|
get_journal.flush_buckets
|
62
62
|
|
@@ -77,7 +77,7 @@ class FlowTest32c < Test::Unit::TestCase
|
|
77
77
|
|
78
78
|
sleep 0.500
|
79
79
|
|
80
|
-
assert_equal get_error_count(fei.wfid)
|
80
|
+
assert_equal 2, get_error_count(fei.wfid)
|
81
81
|
|
82
82
|
#
|
83
83
|
# fixing the cause of the error and then replaying the error
|
data/test/ft_32d_journal.rb
CHANGED
@@ -42,7 +42,7 @@ class FlowTest32d < Test::Unit::TestCase
|
|
42
42
|
|
43
43
|
@engine.application_context[:keep_journals] = true
|
44
44
|
|
45
|
-
@engine.init_service
|
45
|
+
@engine.init_service "journal", Journal
|
46
46
|
|
47
47
|
@engine.register_participant(:alpha) do |wi|
|
48
48
|
@tracer << "alpha\n"
|
@@ -56,13 +56,11 @@ class FlowTest32d < Test::Unit::TestCase
|
|
56
56
|
li = LaunchItem.new Test0
|
57
57
|
fei = @engine.launch li
|
58
58
|
|
59
|
-
sleep 0.
|
59
|
+
sleep 0.500
|
60
60
|
|
61
61
|
get_journal.flush_buckets
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
assert_equal get_error_count(fei.wfid), 1
|
63
|
+
assert_equal 1, get_error_count(fei.wfid)
|
66
64
|
|
67
65
|
@engine.register_participant(:nada) do |wi|
|
68
66
|
@tracer << "nada\n"
|
@@ -77,8 +75,9 @@ class FlowTest32d < Test::Unit::TestCase
|
|
77
75
|
|
78
76
|
sleep 1.0
|
79
77
|
|
80
|
-
assert_equal
|
78
|
+
assert_equal "alpha\nnada\nbravo", @tracer.to_s
|
81
79
|
|
80
|
+
fn = get_journal.workdir + "/" + fei.wfid + ".journal"
|
82
81
|
assert (not File.exist?(fn))
|
83
82
|
end
|
84
83
|
|
data/test/ft_33_description.rb
CHANGED
@@ -81,19 +81,24 @@ class FlowTest33 < Test::Unit::TestCase
|
|
81
81
|
# TEST 4
|
82
82
|
|
83
83
|
def test_4
|
84
|
+
|
85
|
+
@engine.register_participant :check do |fexp, wi|
|
86
|
+
@tracer << fexp.lookup_variable('description').class.name
|
87
|
+
@tracer << "\n"
|
88
|
+
end
|
89
|
+
|
84
90
|
dotest(
|
85
91
|
"""<process-definition name='test_1' revision='x'>
|
86
92
|
<description language='en'>nothing</description>
|
87
93
|
<description language='es'>nada</description>
|
88
94
|
<sequence>
|
95
|
+
<participant ref='check' />
|
89
96
|
<print>${description}</print>
|
90
97
|
<print>${description__en}</print>
|
91
98
|
<print>${description__es}</print>
|
92
99
|
</sequence>
|
93
100
|
</process-definition>""",
|
94
|
-
""
|
95
|
-
nothing
|
96
|
-
nada""")
|
101
|
+
"String\nnothing\nnothing\nnada")
|
97
102
|
end
|
98
103
|
|
99
104
|
end
|
data/test/ft_34_cancelwfid.rb
CHANGED
@@ -55,18 +55,18 @@ class FlowTest34 < Test::Unit::TestCase
|
|
55
55
|
|
56
56
|
def test_cancelwfid_1
|
57
57
|
|
58
|
-
log_level_to_debug
|
58
|
+
#log_level_to_debug
|
59
59
|
|
60
60
|
sp = @engine.register_participant(
|
61
61
|
"store_participant", OpenWFE::YamlParticipant)
|
62
62
|
|
63
63
|
fei = @engine.launch(TestCancelWfid0)
|
64
64
|
|
65
|
-
sleep 0.
|
65
|
+
sleep 0.300
|
66
66
|
|
67
67
|
@engine.cancel_process(fei.wfid)
|
68
68
|
|
69
|
-
sleep 0.
|
69
|
+
sleep 0.300
|
70
70
|
|
71
71
|
assert_equal @engine.get_process_stack(fei.wfid).size, 0
|
72
72
|
|
data/test/ft_38_tag.rb
CHANGED
@@ -38,9 +38,9 @@ class FlowTest38 < Test::Unit::TestCase
|
|
38
38
|
|
39
39
|
def test_tag_0
|
40
40
|
|
41
|
-
log_level_to_debug
|
41
|
+
#log_level_to_debug
|
42
42
|
|
43
|
-
dotest
|
43
|
+
dotest TestTag0, "blah"
|
44
44
|
end
|
45
45
|
|
46
46
|
|
@@ -60,8 +60,7 @@ class FlowTest38 < Test::Unit::TestCase
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
64
|
-
#def test_tag_1
|
63
|
+
def test_tag_1
|
65
64
|
|
66
65
|
count = 0
|
67
66
|
|
@@ -71,7 +70,7 @@ class FlowTest38 < Test::Unit::TestCase
|
|
71
70
|
|
72
71
|
dotest TestTag1, "blah\nhello", 2
|
73
72
|
|
74
|
-
assert_equal
|
73
|
+
assert_equal 1, count
|
75
74
|
end
|
76
75
|
|
77
76
|
|
@@ -90,8 +89,7 @@ class FlowTest38 < Test::Unit::TestCase
|
|
90
89
|
end
|
91
90
|
end
|
92
91
|
|
93
|
-
def
|
94
|
-
#def test_tag_2
|
92
|
+
def test_tag_2
|
95
93
|
|
96
94
|
count = 0
|
97
95
|
|
@@ -101,7 +99,7 @@ class FlowTest38 < Test::Unit::TestCase
|
|
101
99
|
|
102
100
|
dotest TestTag2, "hello\nblah", true
|
103
101
|
|
104
|
-
assert_equal
|
102
|
+
assert_equal 1, count
|
105
103
|
end
|
106
104
|
|
107
105
|
|
@@ -120,8 +118,7 @@ class FlowTest38 < Test::Unit::TestCase
|
|
120
118
|
end
|
121
119
|
end
|
122
120
|
|
123
|
-
def
|
124
|
-
#def test_tag_3
|
121
|
+
def test_tag_3
|
125
122
|
|
126
123
|
dotest TestTag3, "1\n3"
|
127
124
|
end
|
data/test/ft_39_reserve.rb
CHANGED
@@ -33,7 +33,8 @@ class FlowTest39 < Test::Unit::TestCase
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_0
|
36
|
-
|
36
|
+
|
37
|
+
dotest TestReserve39a0, "ok", true
|
37
38
|
end
|
38
39
|
|
39
40
|
|
@@ -52,7 +53,8 @@ class FlowTest39 < Test::Unit::TestCase
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def test_1
|
55
|
-
|
56
|
+
|
57
|
+
dotest TestReserve39a1, "true\ntrue\nover.", true
|
56
58
|
end
|
57
59
|
|
58
60
|
|
data/test/ft_3_equals.rb
CHANGED
@@ -20,7 +20,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
20
20
|
#end
|
21
21
|
|
22
22
|
def test_equals_0
|
23
|
-
dotest(
|
23
|
+
dotest(
|
24
24
|
'''<process-definition name="equals_0" revision="0">
|
25
25
|
<sequence>
|
26
26
|
<equals value="a" other-value="a" />
|
@@ -30,7 +30,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_equals_1
|
33
|
-
dotest(
|
33
|
+
dotest(
|
34
34
|
'''<process-definition name="equals_1" revision="0">
|
35
35
|
<sequence>
|
36
36
|
<equals value="a" other-value="b" />
|
@@ -40,7 +40,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_if_0
|
43
|
-
dotest(
|
43
|
+
dotest(
|
44
44
|
'''<process-definition name="if_0" revision="0">
|
45
45
|
<if>
|
46
46
|
<equals value="a" other-value="a" />
|
@@ -50,7 +50,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_if_1
|
53
|
-
dotest(
|
53
|
+
dotest(
|
54
54
|
'''<process-definition name="if_1" revision="0">
|
55
55
|
<if>
|
56
56
|
<equals value="a" other-value="a" />
|
@@ -61,7 +61,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_if_2
|
64
|
-
dotest(
|
64
|
+
dotest(
|
65
65
|
'''<process-definition name="if_2" revision="0">
|
66
66
|
<if>
|
67
67
|
<equals value="a" other-value="b" />
|
@@ -71,7 +71,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_if_3
|
74
|
-
dotest(
|
74
|
+
dotest(
|
75
75
|
'''<process-definition name="if_3" revision="0">
|
76
76
|
<if>
|
77
77
|
<equals value="a" other-value="b" />
|
@@ -82,7 +82,7 @@ class FlowTest3 < Test::Unit::TestCase
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_equals_0
|
85
|
-
dotest(
|
85
|
+
dotest(
|
86
86
|
'<process-definition name="'+name_of_test+'''" revision="0">
|
87
87
|
<sequence>
|
88
88
|
<set field="a" value="true" />
|
@@ -135,29 +135,34 @@ true
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def test_equals_3
|
138
|
+
|
139
|
+
#log_level_to_debug
|
140
|
+
|
138
141
|
dotest(
|
139
142
|
'<process-definition name="'+name_of_test+'''" revision="0">
|
140
143
|
<sequence>
|
141
144
|
<if test="3 > 2">
|
142
|
-
<print>
|
145
|
+
<print>ok0</print>
|
143
146
|
</if>
|
144
147
|
<if test="3 > a">
|
145
148
|
<print>bad</print>
|
146
|
-
<print>
|
149
|
+
<print>ok1</print>
|
147
150
|
</if>
|
148
151
|
<if test="3>a">
|
149
152
|
<print>bad</print>
|
150
|
-
<print>
|
153
|
+
<print>ok2</print>
|
151
154
|
</if>
|
152
155
|
<if test="3 > 2">
|
153
|
-
<print>
|
156
|
+
<print>ok3</print>
|
157
|
+
<print>bad</print>
|
154
158
|
</if>
|
155
159
|
<if test="1 < 2.0">
|
156
|
-
<print>
|
160
|
+
<print>ok4</print>
|
161
|
+
<print>bad</print>
|
157
162
|
</if>
|
158
163
|
</sequence>
|
159
164
|
</process-definition>''',
|
160
|
-
("ok\n"
|
165
|
+
(0..4).collect { |i| "ok#{i}" }.join("\n"))
|
161
166
|
end
|
162
167
|
|
163
168
|
end
|