ruote 0.9.18
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +24 -0
- data/bin/validate-workflow.rb +89 -0
- data/examples/about_state.rb +81 -0
- data/examples/bigflow.rb +19 -0
- data/examples/csv_weather.rb +23 -0
- data/examples/engine_template.rb +247 -0
- data/examples/flowtracing.rb +24 -0
- data/examples/homeworkreview.rb +68 -0
- data/examples/kotoba.rb +22 -0
- data/examples/mano_tracker.rb +172 -0
- data/examples/openwferu.rb +58 -0
- data/examples/quotereporter.rb +157 -0
- data/examples/scheduler_cron_usage.rb +48 -0
- data/examples/scheduler_usage.rb +56 -0
- data/lib/openwfe.rb +41 -0
- data/lib/openwfe/contextual.rb +111 -0
- data/lib/openwfe/def.rb +46 -0
- data/lib/openwfe/engine.rb +37 -0
- data/lib/openwfe/engine/engine.rb +756 -0
- data/lib/openwfe/engine/expool_methods.rb +172 -0
- data/lib/openwfe/engine/file_persisted_engine.rb +105 -0
- data/lib/openwfe/engine/participant_methods.rb +133 -0
- data/lib/openwfe/engine/status_methods.rb +353 -0
- data/lib/openwfe/engine/update_exp_methods.rb +112 -0
- data/lib/openwfe/exceptions.rb +51 -0
- data/lib/openwfe/expool/errorjournal.rb +476 -0
- data/lib/openwfe/expool/expressionpool.rb +1144 -0
- data/lib/openwfe/expool/expstorage.rb +403 -0
- data/lib/openwfe/expool/history.rb +174 -0
- data/lib/openwfe/expool/journal.rb +224 -0
- data/lib/openwfe/expool/journal_replay.rb +321 -0
- data/lib/openwfe/expool/parser.rb +242 -0
- data/lib/openwfe/expool/representation.rb +121 -0
- data/lib/openwfe/expool/threadedexpstorage.rb +188 -0
- data/lib/openwfe/expool/wfidgen.rb +388 -0
- data/lib/openwfe/expool/yamlexpstorage.rb +224 -0
- data/lib/openwfe/expressions/condition.rb +244 -0
- data/lib/openwfe/expressions/environment.rb +246 -0
- data/lib/openwfe/expressions/expressionmap.rb +258 -0
- data/lib/openwfe/expressions/fe_cancel.rb +109 -0
- data/lib/openwfe/expressions/fe_command.rb +241 -0
- data/lib/openwfe/expressions/fe_concurrence.rb +662 -0
- data/lib/openwfe/expressions/fe_cron.rb +259 -0
- data/lib/openwfe/expressions/fe_cursor.rb +259 -0
- data/lib/openwfe/expressions/fe_define.rb +192 -0
- data/lib/openwfe/expressions/fe_do.rb +168 -0
- data/lib/openwfe/expressions/fe_equals.rb +291 -0
- data/lib/openwfe/expressions/fe_filter.rb +129 -0
- data/lib/openwfe/expressions/fe_filter_definition.rb +168 -0
- data/lib/openwfe/expressions/fe_fqv.rb +250 -0
- data/lib/openwfe/expressions/fe_if.rb +303 -0
- data/lib/openwfe/expressions/fe_iterator.rb +145 -0
- data/lib/openwfe/expressions/fe_listen.rb +371 -0
- data/lib/openwfe/expressions/fe_losfor.rb +111 -0
- data/lib/openwfe/expressions/fe_misc.rb +421 -0
- data/lib/openwfe/expressions/fe_participant.rb +269 -0
- data/lib/openwfe/expressions/fe_reserve.rb +212 -0
- data/lib/openwfe/expressions/fe_save.rb +274 -0
- data/lib/openwfe/expressions/fe_sequence.rb +117 -0
- data/lib/openwfe/expressions/fe_set.rb +139 -0
- data/lib/openwfe/expressions/fe_sleep.rb +166 -0
- data/lib/openwfe/expressions/fe_step.rb +159 -0
- data/lib/openwfe/expressions/fe_subprocess.rb +168 -0
- data/lib/openwfe/expressions/fe_timeout.rb +127 -0
- data/lib/openwfe/expressions/fe_wait.rb +78 -0
- data/lib/openwfe/expressions/fe_when.rb +142 -0
- data/lib/openwfe/expressions/filter.rb +104 -0
- data/lib/openwfe/expressions/flowexpression.rb +847 -0
- data/lib/openwfe/expressions/iterator.rb +221 -0
- data/lib/openwfe/expressions/merge.rb +84 -0
- data/lib/openwfe/expressions/raw.rb +547 -0
- data/lib/openwfe/expressions/rprocdef.rb +375 -0
- data/lib/openwfe/expressions/time.rb +333 -0
- data/lib/openwfe/expressions/timeout.rb +178 -0
- data/lib/openwfe/expressions/value.rb +126 -0
- data/lib/openwfe/filterdef.rb +259 -0
- data/lib/openwfe/flowexpressionid.rb +357 -0
- data/lib/openwfe/listeners/listener.rb +97 -0
- data/lib/openwfe/listeners/listeners.rb +139 -0
- data/lib/openwfe/listeners/socketlisteners.rb +272 -0
- data/lib/openwfe/logging.rb +122 -0
- data/lib/openwfe/omixins.rb +95 -0
- data/lib/openwfe/orest/controlclient.rb +119 -0
- data/lib/openwfe/orest/definitions.rb +113 -0
- data/lib/openwfe/orest/exception.rb +60 -0
- data/lib/openwfe/orest/oldrestservlet.rb +279 -0
- data/lib/openwfe/orest/osocket.rb +148 -0
- data/lib/openwfe/orest/restclient.rb +176 -0
- data/lib/openwfe/orest/workitem.rb +206 -0
- data/lib/openwfe/orest/worklistclient.rb +272 -0
- data/lib/openwfe/orest/xmlcodec.rb +670 -0
- data/lib/openwfe/participants.rb +38 -0
- data/lib/openwfe/participants/enoparticipants.rb +230 -0
- data/lib/openwfe/participants/participant.rb +141 -0
- data/lib/openwfe/participants/participantmap.rb +249 -0
- data/lib/openwfe/participants/participants.rb +407 -0
- data/lib/openwfe/participants/soapparticipants.rb +135 -0
- data/lib/openwfe/participants/socketparticipants.rb +202 -0
- data/lib/openwfe/participants/storeparticipants.rb +254 -0
- data/lib/openwfe/rudefinitions.rb +130 -0
- data/lib/openwfe/service.rb +103 -0
- data/lib/openwfe/storage/yamlcustom.rb +106 -0
- data/lib/openwfe/storage/yamlfilestorage.rb +245 -0
- data/lib/openwfe/tools/flowtracer.rb +81 -0
- data/lib/openwfe/util/dollar.rb +217 -0
- data/lib/openwfe/util/irb.rb +86 -0
- data/lib/openwfe/util/observable.rb +144 -0
- data/lib/openwfe/util/ometa.rb +62 -0
- data/lib/openwfe/util/workqueue.rb +124 -0
- data/lib/openwfe/util/xml.rb +418 -0
- data/lib/openwfe/utils.rb +554 -0
- data/lib/openwfe/version.rb +37 -0
- data/lib/openwfe/workitem.rb +499 -0
- data/lib/openwfe/worklist/oldrest.rb +244 -0
- data/lib/openwfe/worklist/storelocks.rb +293 -0
- data/lib/openwfe/worklist/storeparticipant.rb +44 -0
- data/lib/openwfe/worklist/worklist.rb +297 -0
- data/test/README.txt +27 -0
- data/test/back_0916_test.rb +111 -0
- data/test/bm/bm_1_xml_vs_prog.rb +56 -0
- data/test/bm/bm_2_step.rb +109 -0
- data/test/bm/ft_0f_5ms.rb +35 -0
- data/test/bm/ft_26_load.rb +210 -0
- data/test/bm/ft_26b_load.rb +86 -0
- data/test/bm/ft_26c_load.rb +97 -0
- data/test/bm/ft_26d_load.rb +97 -0
- data/test/bm/ft_recu.rb +71 -0
- data/test/clone_test.rb +122 -0
- data/test/concurrence_test.rb +77 -0
- data/test/condition_test.rb +155 -0
- data/test/console_test.rb +12 -0
- data/test/cron_ltest.rb +15 -0
- data/test/description_test.rb +87 -0
- data/test/eno_test.rb +76 -0
- data/test/expmap_test.rb +54 -0
- data/test/expool_20031219_0916.tgz +0 -0
- data/test/fe_lookup_att_test.rb +62 -0
- data/test/fei_test.rb +181 -0
- data/test/file_persisted_engine_test.rb +64 -0
- data/test/file_persistence_test.rb +134 -0
- data/test/filep_cancel_test.rb +123 -0
- data/test/filter_test.rb +109 -0
- data/test/flowtestbase.rb +351 -0
- data/test/ft_0.rb +68 -0
- data/test/ft_0b_sequence.rb +36 -0
- data/test/ft_0c_testname.rb +33 -0
- data/test/ft_0d_participant.rb +30 -0
- data/test/ft_0e_multibody.rb +34 -0
- data/test/ft_10_loop.rb +134 -0
- data/test/ft_11_ppd.rb +415 -0
- data/test/ft_11b_ppd.rb +54 -0
- data/test/ft_12_blockparticipant.rb +97 -0
- data/test/ft_13_eno.rb +52 -0
- data/test/ft_14_subprocess.rb +88 -0
- data/test/ft_14b_subprocess.rb +192 -0
- data/test/ft_14c_subprocess.rb +68 -0
- data/test/ft_15_iterator.rb +216 -0
- data/test/ft_15b_iterator.rb +74 -0
- data/test/ft_16_fqv.rb +73 -0
- data/test/ft_17_condition.rb +84 -0
- data/test/ft_18_pname.rb +56 -0
- data/test/ft_1_unset.rb +175 -0
- data/test/ft_1b_unset.rb +39 -0
- data/test/ft_20_cron.rb +53 -0
- data/test/ft_21_cron.rb +87 -0
- data/test/ft_21b_cron_pause.rb +82 -0
- data/test/ft_22_history.rb +74 -0
- data/test/ft_23_when.rb +77 -0
- data/test/ft_23b_when.rb +70 -0
- data/test/ft_23c_wait.rb +80 -0
- data/test/ft_23d_cww.rb +58 -0
- data/test/ft_24_def.rb +44 -0
- data/test/ft_25_cancel.rb +89 -0
- data/test/ft_27_getflowpos.rb +147 -0
- data/test/ft_28_fileparticipant.rb +63 -0
- data/test/ft_29_httprb.rb +106 -0
- data/test/ft_2_concurrence.rb +135 -0
- data/test/ft_2b_concurrence.rb +188 -0
- data/test/ft_2c_concurrence.rb +64 -0
- data/test/ft_30_socketlistener.rb +203 -0
- data/test/ft_31_flowname.rb +40 -0
- data/test/ft_32_journal.rb +91 -0
- data/test/ft_32c_journal.rb +102 -0
- data/test/ft_32d_journal.rb +84 -0
- data/test/ft_33_description.rb +107 -0
- data/test/ft_34_cancelwfid.rb +80 -0
- data/test/ft_35_localdefs.rb +75 -0
- data/test/ft_36_subprocids.rb +97 -0
- data/test/ft_37_pnames.rb +70 -0
- data/test/ft_38_tag.rb +127 -0
- data/test/ft_38b_tag.rb +161 -0
- data/test/ft_38c_tag.rb +100 -0
- data/test/ft_39_reserve.rb +63 -0
- data/test/ft_39b_reserve.rb +84 -0
- data/test/ft_3_equals.rb +170 -0
- data/test/ft_3b_lookup_vf.rb +83 -0
- data/test/ft_40_defined.rb +61 -0
- data/test/ft_41_case.rb +110 -0
- data/test/ft_42_environments.rb +75 -0
- data/test/ft_43_pat10.rb +85 -0
- data/test/ft_44_save.rb +70 -0
- data/test/ft_44b_restore.rb +212 -0
- data/test/ft_45_citerator.rb +214 -0
- data/test/ft_46_pparams.rb +62 -0
- data/test/ft_47_filter.rb +160 -0
- data/test/ft_48_fe_filter.rb +88 -0
- data/test/ft_49_condition.rb +126 -0
- data/test/ft_4_misc.rb +237 -0
- data/test/ft_50_xml_attribute.rb +155 -0
- data/test/ft_51_stack.rb +55 -0
- data/test/ft_52_obs_participant.rb +123 -0
- data/test/ft_53_null_noop_participant.rb +62 -0
- data/test/ft_54_listen.rb +288 -0
- data/test/ft_54b_listen.rb +66 -0
- data/test/ft_54c_listen.rb +99 -0
- data/test/ft_55_ptimeout.rb +59 -0
- data/test/ft_56_timeout.rb +59 -0
- data/test/ft_57_a.rb +145 -0
- data/test/ft_58_ejournal.rb +151 -0
- data/test/ft_59_ps.rb +150 -0
- data/test/ft_59b_ps_for_pat.rb +58 -0
- data/test/ft_5_time.rb +118 -0
- data/test/ft_60_ecancel.rb +161 -0
- data/test/ft_61_elsub.rb +51 -0
- data/test/ft_62_procparticipant.rb +71 -0
- data/test/ft_63_pause.rb +124 -0
- data/test/ft_64_alias.rb +102 -0
- data/test/ft_64_clone.rb +69 -0
- data/test/ft_65_stringlaunch.rb +59 -0
- data/test/ft_66_subforget.rb +70 -0
- data/test/ft_67_schedlaunch.rb +116 -0
- data/test/ft_68_ifparticipant.rb +70 -0
- data/test/ft_69_cancelmissing.rb +51 -0
- data/test/ft_6_lambda.rb +64 -0
- data/test/ft_70_lookupvar.rb +55 -0
- data/test/ft_71_log.rb +60 -0
- data/test/ft_72_lookup_processes.rb +76 -0
- data/test/ft_73_cancel_sub.rb +139 -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 +88 -0
- data/test/ft_77_segments.rb +35 -0
- data/test/ft_78_eval.rb +150 -0
- data/test/ft_79_tticket.rb +187 -0
- data/test/ft_79b_tticket.rb +172 -0
- data/test/ft_79c_outcome.rb +56 -0
- data/test/ft_7_lose.rb +104 -0
- data/test/ft_7b_lose.rb +78 -0
- data/test/ft_80_spname.rb +91 -0
- data/test/ft_81_exp.rb +60 -0
- data/test/ft_82_trecu.rb +46 -0
- data/test/ft_83_badpause.rb +58 -0
- data/test/ft_84_updateexp.rb +198 -0
- data/test/ft_85_dolhash.rb +43 -0
- data/test/ft_86_dollar_fv.rb +68 -0
- data/test/ft_87_define.rb +74 -0
- data/test/ft_8_forget.rb +44 -0
- data/test/ft_9_cursor.rb +145 -0
- data/test/ft_9b_cursor.rb +105 -0
- data/test/ft_tests.rb +124 -0
- data/test/hash_test.rb +75 -0
- data/test/hparticipant_test.rb +164 -0
- data/test/lookup_att_test.rb +90 -0
- data/test/lookup_vf_test.rb +94 -0
- data/test/misc_test.rb +90 -0
- data/test/nut_0_irb.rb +20 -0
- data/test/obs_test.rb +142 -0
- data/test/orest_test.rb +251 -0
- data/test/param_test.rb +290 -0
- data/test/participant_test.rb +101 -0
- data/test/pending.rb +23 -0
- data/test/ps_representation.rb +133 -0
- data/test/rake_ltest.rb +38 -0
- data/test/rake_qtest.rb +68 -0
- data/test/raw_prog_test.rb +412 -0
- data/test/restart_cron_test.rb +136 -0
- data/test/restart_paused_test.rb +98 -0
- data/test/restart_sleep_test.rb +140 -0
- data/test/restart_tests.rb +18 -0
- data/test/restart_when_test.rb +112 -0
- data/test/ruby_procdef_test.rb +132 -0
- data/test/rutest_utils.rb +63 -0
- data/test/sec_test.rb +205 -0
- data/test/slock_test.rb +80 -0
- data/test/storage_test.rb +44 -0
- data/test/test.rb +3 -0
- data/test/timeout_test.rb +105 -0
- data/test/util_xml_test.rb +112 -0
- data/test/wfid_test.rb +175 -0
- data/test/wi_test.rb +75 -0
- metadata +433 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest40 < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestDefined40a0 < OpenWFE::ProcessDefinition
|
27
|
+
sequence do
|
28
|
+
|
29
|
+
defined :field => "nada"
|
30
|
+
_print "${f:__result__}"
|
31
|
+
|
32
|
+
set :field => "nada", :value => "stuff"
|
33
|
+
|
34
|
+
defined :field => "nada"
|
35
|
+
_print "${f:__result__}"
|
36
|
+
defined :field_value => "nada"
|
37
|
+
_print "${f:__result__}"
|
38
|
+
|
39
|
+
defined :field_match => "^na.*"
|
40
|
+
_print "${f:__result__}"
|
41
|
+
defined :field_match => "^Na.*"
|
42
|
+
_print "${f:__result__}"
|
43
|
+
defined :field_match => "da$"
|
44
|
+
_print "${f:__result__}"
|
45
|
+
|
46
|
+
undefined :field_value => "nada"
|
47
|
+
_print "${f:__result__}"
|
48
|
+
undefined :field_value => "other"
|
49
|
+
_print "${f:__result__}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_0
|
54
|
+
|
55
|
+
dotest(
|
56
|
+
TestDefined40a0,
|
57
|
+
%w{ false true true true false true false true }.join("\n"))
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
data/test/ft_41_case.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest41 < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestCase41a0 < OpenWFE::ProcessDefinition
|
27
|
+
sequence do
|
28
|
+
_case do
|
29
|
+
reval "2 % 2 == 0"
|
30
|
+
_print "ok 0"
|
31
|
+
end
|
32
|
+
_case do
|
33
|
+
reval "2 % 2 == 1"
|
34
|
+
_print "bad 1"
|
35
|
+
_print "ok 1"
|
36
|
+
end
|
37
|
+
_case do
|
38
|
+
reval "2 % 2 == 1"
|
39
|
+
_print "bad 2"
|
40
|
+
reval "2 % 2 == 0"
|
41
|
+
_print "ok 2"
|
42
|
+
_print "bad 2"
|
43
|
+
end
|
44
|
+
_case do
|
45
|
+
reval "2 % 2 == 1"
|
46
|
+
_print "bad 2b"
|
47
|
+
reval "2 % 2 == 0"
|
48
|
+
_print "ok 2b"
|
49
|
+
end
|
50
|
+
_case do
|
51
|
+
reval "2 % 2 == 1"
|
52
|
+
_print "bad 3"
|
53
|
+
reval "2 % 2 == 3"
|
54
|
+
_print "bad 3"
|
55
|
+
_print "ok 3"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_0
|
61
|
+
|
62
|
+
dotest(
|
63
|
+
TestCase41a0,
|
64
|
+
[ 'ok 0', 'ok 1', 'ok 2', 'ok 2b', 'ok 3' ].join("\n"))
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
#
|
69
|
+
# Test 1
|
70
|
+
#
|
71
|
+
|
72
|
+
class TestCase41a1 < OpenWFE::ProcessDefinition
|
73
|
+
sequence do
|
74
|
+
|
75
|
+
_if :test => "1 == 1"
|
76
|
+
_print "${f:__result__}"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_1
|
81
|
+
|
82
|
+
dotest TestCase41a1, 'true'
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
#
|
87
|
+
# Test 2
|
88
|
+
#
|
89
|
+
|
90
|
+
class TestCase41a2 < OpenWFE::ProcessDefinition
|
91
|
+
sequence do
|
92
|
+
_case do
|
93
|
+
_if :test => "1 == 1"
|
94
|
+
_print "ok"
|
95
|
+
end
|
96
|
+
_case do
|
97
|
+
_if :test => "false"
|
98
|
+
_print "bad 1"
|
99
|
+
_print "ok 1"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_2
|
105
|
+
|
106
|
+
dotest TestCase41a2, "ok\nok 1"
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest42 < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestCase42a0 < OpenWFE::ProcessDefinition
|
27
|
+
sequence do
|
28
|
+
set :variable => "v", :value => "a"
|
29
|
+
concurrence do
|
30
|
+
set :variable => "v", :value => "b"
|
31
|
+
set :variable => "v", :value => "c"
|
32
|
+
forget do
|
33
|
+
set :variable => "v", :value => "d"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
_print "v:${v}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_0
|
41
|
+
|
42
|
+
dotest TestCase42a0, [ "v:b", "v:c" ]
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
#
|
47
|
+
# Test 1
|
48
|
+
#
|
49
|
+
|
50
|
+
# DISABLED
|
51
|
+
|
52
|
+
class TestCase42a1 < OpenWFE::ProcessDefinition
|
53
|
+
sequence do
|
54
|
+
set :variable => "v", :value => "a"
|
55
|
+
concurrence :count => 2 do
|
56
|
+
set :variable => "v", :value => "b"
|
57
|
+
set :variable => "v", :value => "c"
|
58
|
+
lose do
|
59
|
+
set :variable => "v", :value => "d"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
_print "v:${v}"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def _test_1
|
67
|
+
|
68
|
+
dotest(
|
69
|
+
TestCase42a1,
|
70
|
+
"v:d",
|
71
|
+
true)
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
data/test/ft_43_pat10.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest43 < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestCase43a0 < OpenWFE::ProcessDefinition
|
27
|
+
def initialize (jump)
|
28
|
+
super()
|
29
|
+
@jump = jump
|
30
|
+
end
|
31
|
+
def make
|
32
|
+
process_definition :name => "jump", :revision => "0" do
|
33
|
+
sequence do
|
34
|
+
set :field => "__cursor_command__", :value => "jump #{@jump}"
|
35
|
+
cursor do
|
36
|
+
_print "0"
|
37
|
+
_print "1"
|
38
|
+
_print "2"
|
39
|
+
end
|
40
|
+
_print "3"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_0
|
47
|
+
|
48
|
+
dotest TestCase43a0.new(1), "1\n2\n3"
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_1
|
52
|
+
|
53
|
+
dotest TestCase43a0.new(2), "2\n3"
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_2
|
57
|
+
|
58
|
+
dotest TestCase43a0.new(2000), "2\n3"
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
#
|
63
|
+
# Test 3
|
64
|
+
#
|
65
|
+
|
66
|
+
class TestCase43a3 < OpenWFE::ProcessDefinition
|
67
|
+
sequence do
|
68
|
+
set :field => "__cursor_command__", :value => "jump 2"
|
69
|
+
cursor do
|
70
|
+
_print "0"
|
71
|
+
skip :step => 2
|
72
|
+
jump :step => 0
|
73
|
+
_print "1"
|
74
|
+
end
|
75
|
+
_print "2"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_3
|
80
|
+
|
81
|
+
dotest TestCase43a3, "0\n1\n2"
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
data/test/ft_44_save.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest44 < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestCase44a0 < OpenWFE::ProcessDefinition
|
27
|
+
sequence do
|
28
|
+
set :field => "f", :value => "v"
|
29
|
+
save :to_field => "saved"
|
30
|
+
#pp_workitem
|
31
|
+
_print "${f:saved.f}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_0
|
36
|
+
|
37
|
+
dotest TestCase44a0, "v"
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
#
|
42
|
+
# Test 1
|
43
|
+
#
|
44
|
+
|
45
|
+
class TestCase44a1 < OpenWFE::ProcessDefinition
|
46
|
+
sequence do
|
47
|
+
|
48
|
+
set :field => "f", :value => "field_value"
|
49
|
+
save :to_variable => "v"
|
50
|
+
|
51
|
+
#pp_workitem
|
52
|
+
#_print "${r:fexp.lookup_variable('v').f}"
|
53
|
+
#
|
54
|
+
# doesn't work in case of ptest
|
55
|
+
|
56
|
+
print_var
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_1
|
61
|
+
|
62
|
+
@engine.register_participant :print_var do |fexp, wi|
|
63
|
+
@tracer << fexp.lookup_variable('v').f.to_s
|
64
|
+
end
|
65
|
+
|
66
|
+
dotest TestCase44a1, "field_value"
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
@@ -0,0 +1,212 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFEru
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'flowtestbase'
|
9
|
+
require 'openwfe/def'
|
10
|
+
|
11
|
+
|
12
|
+
class FlowTest44b < Test::Unit::TestCase
|
13
|
+
include FlowTestBase
|
14
|
+
|
15
|
+
#def setup
|
16
|
+
#end
|
17
|
+
|
18
|
+
#def teardown
|
19
|
+
#end
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Test 0
|
24
|
+
#
|
25
|
+
|
26
|
+
class TestCase44b0 < OpenWFE::ProcessDefinition
|
27
|
+
sequence do
|
28
|
+
set :field => "f", :value => "v"
|
29
|
+
save :to_field => "saved"
|
30
|
+
#pp_workitem
|
31
|
+
_print "${f:saved.f}"
|
32
|
+
restore :from_field => "saved"
|
33
|
+
_print "${f:saved.f}"
|
34
|
+
_print "${f:f}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_0
|
39
|
+
|
40
|
+
dotest TestCase44b0, "v\n\nv"
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
#
|
45
|
+
# Test 1
|
46
|
+
#
|
47
|
+
|
48
|
+
class TestCase44b1 < OpenWFE::ProcessDefinition
|
49
|
+
sequence do
|
50
|
+
set :field => "f", :value => "field_value"
|
51
|
+
save :to_variable => "v"
|
52
|
+
#pp_workitem
|
53
|
+
set :field => "f", :value => "field_value_x"
|
54
|
+
_print "${f:f}"
|
55
|
+
restore :from_variable => "v"
|
56
|
+
_print "${f:f}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_1
|
61
|
+
|
62
|
+
dotest TestCase44b1, "field_value_x\nfield_value"
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
#
|
67
|
+
# Test 2
|
68
|
+
#
|
69
|
+
|
70
|
+
class TestCase44b2 < OpenWFE::ProcessDefinition
|
71
|
+
sequence do
|
72
|
+
set :field => "f", :value => "field_value"
|
73
|
+
save :to_variable => "v"
|
74
|
+
restore :from_variable => :v, :to_field => :f1
|
75
|
+
#pp_workitem
|
76
|
+
_print "${f:f1.f}"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_2
|
81
|
+
|
82
|
+
dotest TestCase44b2, "field_value"
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
#
|
87
|
+
# Test 3
|
88
|
+
#
|
89
|
+
|
90
|
+
class TestCase44b3 < OpenWFE::ProcessDefinition
|
91
|
+
sequence do
|
92
|
+
set :field => "f0", :value => "value_a"
|
93
|
+
save :to_variable => "v"
|
94
|
+
set :field => "f0", :value => "value_aa"
|
95
|
+
set :field => "f1", :value => "value_b"
|
96
|
+
restore :from_variable => :v, :merge_lead => :current
|
97
|
+
#pp_workitem
|
98
|
+
_print "${f:f0}"
|
99
|
+
_print "${f:f1}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_3
|
104
|
+
|
105
|
+
dotest TestCase44b3, "value_aa\nvalue_b"
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
#
|
110
|
+
# Test 4
|
111
|
+
#
|
112
|
+
|
113
|
+
class TestCase44b4 < OpenWFE::ProcessDefinition
|
114
|
+
sequence do
|
115
|
+
set :field => "f0", :value => "value_a"
|
116
|
+
save :to_variable => "v"
|
117
|
+
set :field => "f0", :value => "value_aa"
|
118
|
+
set :field => "f1", :value => "value_b"
|
119
|
+
restore :from_variable => :v, :merge_lead => :restored
|
120
|
+
#pp_workitem
|
121
|
+
_print "${f:f0}"
|
122
|
+
_print "${f:f1}"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def test_4
|
127
|
+
|
128
|
+
dotest TestCase44b4, "value_a\nvalue_b"
|
129
|
+
end
|
130
|
+
|
131
|
+
# tests about set_fields...
|
132
|
+
|
133
|
+
#
|
134
|
+
# Test 5
|
135
|
+
#
|
136
|
+
|
137
|
+
class Test44b5 < OpenWFE::ProcessDefinition
|
138
|
+
sequence do
|
139
|
+
set_fields :value => {
|
140
|
+
"customer" => { "name" => "Zigue", "age" => 34 },
|
141
|
+
"approved" => false }
|
142
|
+
_print "${f:customer.name} (${f:customer.age}) ${f:approved}"
|
143
|
+
#pp_fields
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_5
|
148
|
+
|
149
|
+
dotest Test44b5, "Zigue (34) false"
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# Test 6
|
154
|
+
#
|
155
|
+
|
156
|
+
class Test44b6 < OpenWFE::ProcessDefinition
|
157
|
+
set_fields :value => {
|
158
|
+
"customer" => { "name" => "Zigue", "age" => 34 },
|
159
|
+
"approved" => false }
|
160
|
+
sequence do
|
161
|
+
_print "${f:customer.name} (${f:customer.age}) ${f:approved}"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def test_6
|
166
|
+
|
167
|
+
dotest Test44b6, "Zigue (34) false"
|
168
|
+
end
|
169
|
+
|
170
|
+
#
|
171
|
+
# Test 7
|
172
|
+
#
|
173
|
+
|
174
|
+
class Test44b7 < OpenWFE::ProcessDefinition
|
175
|
+
set_fields do
|
176
|
+
{
|
177
|
+
"customer" => { "name" => "Zigue", "age" => 34 },
|
178
|
+
"approved" => false
|
179
|
+
}
|
180
|
+
end
|
181
|
+
sequence do
|
182
|
+
_print "${f:customer.name} (${f:customer.age}) ${f:approved}"
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def _test_7
|
187
|
+
|
188
|
+
dotest Test44b7, "Zigue (34) false"
|
189
|
+
end
|
190
|
+
|
191
|
+
#
|
192
|
+
# Test 8
|
193
|
+
#
|
194
|
+
|
195
|
+
class Test44b8 < OpenWFE::ProcessDefinition
|
196
|
+
set_fields :value => {
|
197
|
+
"customer" => { "name" => "Zigue", "age" => 34 },
|
198
|
+
"approved" => false }, :merge_lead => :current
|
199
|
+
sequence do
|
200
|
+
_print "${f:customer.name} (${f:customer.age}) ${f:approved}"
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def test_8
|
205
|
+
|
206
|
+
li = LaunchItem.new Test44b8
|
207
|
+
li.approved = true
|
208
|
+
dotest li, "Zigue (34) true"
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|
212
|
+
|