openwferu 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/about_state.rb +81 -0
- data/examples/engine_template.rb +7 -0
- data/lib/openwfe/contextual.rb +2 -2
- data/lib/openwfe/def.rb +2 -3
- data/lib/openwfe/{util/schedulers.rb → engine.rb} +3 -39
- data/lib/openwfe/engine/engine.rb +202 -251
- data/lib/openwfe/engine/process_status.rb +359 -0
- data/lib/openwfe/expool/errorjournal.rb +6 -6
- data/lib/openwfe/expool/expressionpool.rb +161 -239
- data/lib/openwfe/expool/expstorage.rb +185 -55
- data/lib/openwfe/expool/journal.rb +1 -2
- data/lib/openwfe/expool/parser.rb +233 -0
- data/lib/openwfe/expool/threadedexpstorage.rb +6 -18
- data/lib/openwfe/expool/wfidgen.rb +25 -7
- data/lib/openwfe/expool/yamlexpstorage.rb +60 -37
- data/lib/openwfe/expressions/condition.rb +49 -12
- data/lib/openwfe/expressions/environment.rb +45 -15
- data/lib/openwfe/expressions/expressionmap.rb +39 -19
- data/lib/openwfe/expressions/fe_concurrence.rb +24 -13
- data/lib/openwfe/expressions/fe_cron.rb +19 -18
- data/lib/openwfe/expressions/fe_cursor.rb +69 -28
- data/lib/openwfe/expressions/fe_define.rb +4 -1
- data/lib/openwfe/expressions/fe_do.rb +1 -3
- data/lib/openwfe/expressions/fe_equals.rb +131 -20
- data/lib/openwfe/expressions/fe_fqv.rb +27 -3
- data/lib/openwfe/expressions/fe_iterator.rb +14 -7
- data/lib/openwfe/expressions/fe_listen.rb +7 -2
- data/lib/openwfe/expressions/fe_misc.rb +187 -20
- data/lib/openwfe/expressions/fe_participant.rb +8 -7
- data/lib/openwfe/expressions/fe_reserve.rb +105 -33
- data/lib/openwfe/expressions/fe_save.rb +55 -5
- data/lib/openwfe/expressions/{fe_value.rb → fe_set.rb} +6 -82
- data/lib/openwfe/expressions/fe_sleep.rb +25 -15
- data/lib/openwfe/expressions/fe_subprocess.rb +2 -2
- data/lib/openwfe/expressions/fe_wait.rb +3 -2
- data/lib/openwfe/expressions/fe_when.rb +7 -15
- data/lib/openwfe/expressions/flowexpression.rb +90 -49
- data/lib/openwfe/expressions/merge.rb +7 -1
- data/lib/openwfe/expressions/raw.rb +261 -63
- data/lib/openwfe/expressions/{raw_prog.rb → rprocdef.rb} +94 -179
- data/lib/openwfe/expressions/time.rb +36 -12
- data/lib/openwfe/expressions/timeout.rb +9 -7
- data/lib/openwfe/expressions/value.rb +126 -0
- data/lib/openwfe/flowexpressionid.rb +52 -22
- data/lib/openwfe/listeners/listeners.rb +3 -3
- data/lib/openwfe/listeners/socketlisteners.rb +8 -5
- data/lib/openwfe/logging.rb +6 -3
- data/lib/openwfe/omixins.rb +8 -6
- data/lib/openwfe/orest/xmlcodec.rb +16 -12
- data/lib/openwfe/participants.rb +38 -0
- data/lib/openwfe/participants/participant.rb +1 -1
- data/lib/openwfe/participants/participantmap.rb +24 -10
- data/lib/openwfe/participants/participants.rb +4 -3
- data/lib/openwfe/participants/soapparticipants.rb +1 -1
- data/lib/openwfe/participants/socketparticipants.rb +1 -1
- data/lib/openwfe/rudefinitions.rb +7 -5
- data/lib/openwfe/storage/yamlcustom.rb +10 -10
- data/lib/openwfe/storage/yamlfilestorage.rb +12 -12
- data/lib/openwfe/tools/flowtracer.rb +6 -5
- data/lib/openwfe/util/dollar.rb +42 -85
- data/lib/openwfe/util/ometa.rb +1 -3
- data/lib/openwfe/util/workqueue.rb +1 -1
- data/lib/openwfe/utils.rb +33 -11
- data/lib/openwfe/version.rb +2 -2
- data/lib/openwfe/workitem.rb +76 -14
- data/lib/openwfe/worklist/storelocks.rb +9 -4
- data/lib/openwfe/worklist/storeparticipant.rb +1 -1
- data/test/back_0916_test.rb +101 -0
- data/test/bm/ft_26_load.rb +1 -1
- data/test/bm/ft_26b_load.rb +1 -1
- data/test/bm/ft_26c_load.rb +3 -2
- data/test/bm/ft_26d_load.rb +97 -0
- data/test/bm/ft_recu.rb +71 -0
- data/test/concurrence_test.rb +1 -1
- data/test/condition_test.rb +152 -0
- data/test/description_test.rb +12 -7
- data/test/eno_test.rb +1 -1
- data/test/expool_20031219_0916.tgz +0 -0
- data/test/fe_lookup_att_test.rb +1 -1
- data/test/fei_test.rb +16 -0
- data/test/file_persistence_test.rb +8 -12
- data/test/filep_cancel_test.rb +116 -0
- data/test/flowtestbase.rb +47 -25
- data/test/ft_0.rb +1 -1
- data/test/ft_10_loop.rb +29 -14
- data/test/{ft_10b_loop2.rb → ft_10b_loop.rb} +2 -11
- data/test/ft_11_ppd.rb +6 -17
- data/test/ft_11b_ppd.rb +1 -4
- data/test/ft_12_blockparticipant.rb +1 -1
- data/test/ft_13_eno.rb +1 -1
- data/test/ft_15_iterator.rb +1 -1
- data/test/ft_15b_iterator.rb +1 -1
- data/test/ft_17_condition.rb +6 -6
- data/test/ft_18_pname.rb +1 -1
- data/test/ft_20_cron.rb +1 -1
- data/test/ft_21_cron.rb +6 -4
- data/test/ft_22_history.rb +1 -1
- data/test/ft_23_when.rb +1 -1
- data/test/ft_23b_when.rb +18 -6
- data/test/ft_23c_wait.rb +8 -6
- data/test/ft_25_cancel.rb +7 -5
- data/test/ft_27_getflowpos.rb +22 -17
- data/test/ft_28_fileparticipant.rb +1 -2
- data/test/ft_2_concurrence.rb +1 -1
- data/test/ft_2b_concurrence.rb +25 -20
- data/test/ft_30_socketlistener.rb +0 -3
- data/test/ft_34_cancelwfid.rb +9 -9
- data/test/ft_35_localdefs.rb +0 -1
- data/test/ft_36_subprocids.rb +6 -6
- data/test/ft_38_tag.rb +3 -2
- data/test/ft_38b_tag.rb +229 -0
- data/test/ft_39_reserve.rb +3 -18
- data/test/ft_39b_reserve.rb +34 -5
- data/test/ft_3b_lookup_vf.rb +83 -0
- data/test/ft_40_defined.rb +2 -11
- data/test/ft_42_environments.rb +4 -6
- data/test/ft_44b_restore.rb +88 -22
- data/test/ft_45_citerator.rb +57 -11
- data/test/ft_49_condition.rb +4 -2
- data/test/ft_4_misc.rb +24 -3
- data/test/ft_50_xml_attribute.rb +17 -20
- data/test/ft_54_listen.rb +1 -1
- data/test/ft_54b_listen.rb +2 -2
- data/test/ft_56_timeout.rb +8 -1
- data/test/ft_57_a.rb +10 -10
- data/test/ft_59_ps.rb +49 -16
- data/test/ft_60_ecancel.rb +52 -10
- data/test/ft_63_pause.rb +8 -8
- data/test/ft_65_stringlaunch.rb +4 -6
- data/test/ft_67_schedlaunch.rb +4 -4
- data/test/ft_69_cancelmissing.rb +4 -2
- data/test/ft_70_lookupvar.rb +2 -2
- data/test/ft_72_lookup_processes.rb +2 -2
- data/test/ft_73_cancel_sub.rb +8 -8
- data/test/ft_77_segments.rb +38 -0
- data/test/ft_78_eval.rb +154 -0
- data/test/ft_79_tticket.rb +185 -0
- data/test/ft_80_spname.rb +95 -0
- data/test/ft_81_exp.rb +64 -0
- data/test/ft_82_trecu.rb +48 -0
- data/test/ft_83_badpause.rb +62 -0
- data/test/ft_84_updateexp.rb +125 -0
- data/test/ft_9b_cursor.rb +105 -0
- data/test/ft_tests.rb +14 -1
- data/test/hash_test.rb +7 -7
- data/test/hparticipant_test.rb +4 -4
- data/test/lookup_vf_test.rb +94 -0
- data/test/misc_test.rb +5 -3
- data/test/orest_test.rb +4 -3
- data/test/param_test.rb +12 -16
- data/test/participant_test.rb +36 -0
- data/test/pending.rb +10 -10
- data/test/rake_ltest.rb +1 -10
- data/test/rake_qtest.rb +7 -6
- data/test/raw_prog_test.rb +89 -121
- data/test/restart_cron_test.rb +84 -36
- data/test/restart_paused_test.rb +100 -0
- data/test/restart_sleep_test.rb +1 -1
- data/test/restart_tests.rb +1 -0
- data/test/restart_when_test.rb +33 -22
- data/test/ruby_procdef_test.rb +19 -18
- data/test/sec_test.rb +74 -35
- data/test/storage_test.rb +44 -0
- data/test/test.rb +3 -0
- data/test/timeout_test.rb +7 -18
- data/test/wfid_test.rb +2 -1
- data/test/wi_test.rb +29 -18
- metadata +121 -57
- data/lib/openwfe/expressions/raw_xml.rb +0 -176
- data/lib/openwfe/expressions/simplerep.rb +0 -266
- data/lib/openwfe/util/kotoba.rb +0 -236
- data/lib/openwfe/util/lru.rb +0 -171
- data/lib/openwfe/util/otime.rb +0 -246
- data/lib/openwfe/util/safe.rb +0 -160
- data/lib/openwfe/util/scheduler.rb +0 -1158
- data/test/cron_test.rb +0 -113
- data/test/cronline_test.rb +0 -60
- data/test/dollar_test.rb +0 -90
- data/test/kotoba_test.rb +0 -72
- data/test/lru_test.rb +0 -79
- data/test/safely_test.rb +0 -84
- data/test/scheduler_1_test.rb +0 -88
- data/test/scheduler_test.rb +0 -363
- data/test/time_test.rb +0 -84
data/test/ft_tests.rb
CHANGED
@@ -19,14 +19,16 @@ require 'ft_2_concurrence'
|
|
19
19
|
require 'ft_2b_concurrence'
|
20
20
|
require 'ft_2c_concurrence'
|
21
21
|
require 'ft_3_equals'
|
22
|
+
require 'ft_3b_lookup_vf'
|
22
23
|
require 'ft_4_misc'
|
23
24
|
require 'ft_6_lambda'
|
24
25
|
require 'ft_7_lose'
|
25
26
|
require 'ft_7b_lose'
|
26
27
|
require 'ft_8_forget'
|
27
28
|
require 'ft_9_cursor'
|
29
|
+
require 'ft_9b_cursor'
|
28
30
|
require 'ft_10_loop'
|
29
|
-
require '
|
31
|
+
require 'ft_10b_loop'
|
30
32
|
require 'ft_11_ppd'
|
31
33
|
require 'ft_11b_ppd'
|
32
34
|
require 'ft_12_blockparticipant'
|
@@ -53,6 +55,7 @@ require 'ft_35_localdefs'
|
|
53
55
|
require 'ft_36_subprocids'
|
54
56
|
require 'ft_37_pnames'
|
55
57
|
require 'ft_38_tag'
|
58
|
+
require 'ft_38b_tag'
|
56
59
|
require 'ft_39_reserve'
|
57
60
|
require 'ft_39b_reserve'
|
58
61
|
require 'ft_40_defined'
|
@@ -99,4 +102,14 @@ require 'ft_73_cancel_sub'
|
|
99
102
|
require 'ft_74_block_and_workitem_dup'
|
100
103
|
require 'ft_75_ruby_attributes'
|
101
104
|
require 'ft_76_merge_isolate'
|
105
|
+
require 'ft_77_segments'
|
106
|
+
require 'ft_78_eval'
|
107
|
+
require 'ft_79_tticket'
|
108
|
+
require 'ft_80_spname'
|
109
|
+
require 'ft_81_exp'
|
110
|
+
|
111
|
+
require 'back_0916_test'
|
112
|
+
|
113
|
+
require 'ft_82_trecu'
|
114
|
+
require 'ft_84_updateexp'
|
102
115
|
|
data/test/hash_test.rb
CHANGED
@@ -42,7 +42,7 @@ class HashTest < Test::Unit::TestCase
|
|
42
42
|
wi0.fei = new_fei
|
43
43
|
|
44
44
|
h = wi0.to_h
|
45
|
-
#
|
45
|
+
#p h
|
46
46
|
|
47
47
|
wi1 = OpenWFE::InFlowWorkItem.from_h(h)
|
48
48
|
|
@@ -57,19 +57,19 @@ class HashTest < Test::Unit::TestCase
|
|
57
57
|
|
58
58
|
def test_any_from_h
|
59
59
|
|
60
|
-
li = OpenWFE::LaunchItem.new
|
60
|
+
li = OpenWFE::LaunchItem.new
|
61
61
|
li.workflow_definition_url = "http://www.openwfe.org/nada"
|
62
62
|
li.price = "USD 12"
|
63
63
|
li.customer = "Captain Nemo"
|
64
64
|
|
65
65
|
h = li.to_h
|
66
|
-
#
|
66
|
+
#p h
|
67
67
|
|
68
|
-
li1 = OpenWFE::workitem_from_h
|
68
|
+
li1 = OpenWFE::workitem_from_h h
|
69
69
|
|
70
|
-
|
71
|
-
assert_equal
|
72
|
-
assert_equal li1.attributes.size
|
70
|
+
assert_kind_of OpenWFE::LaunchItem, li1
|
71
|
+
assert_equal "USD 12", li1.price
|
72
|
+
assert_equal 3, li1.attributes.size
|
73
73
|
end
|
74
74
|
|
75
75
|
end
|
data/test/hparticipant_test.rb
CHANGED
@@ -13,7 +13,7 @@ require 'test/unit'
|
|
13
13
|
#require 'openwfe/workitem'
|
14
14
|
require 'openwfe/flowexpressionid'
|
15
15
|
require 'openwfe/engine/engine'
|
16
|
-
require 'openwfe/
|
16
|
+
require 'openwfe/def'
|
17
17
|
require 'openwfe/worklist/storeparticipant'
|
18
18
|
|
19
19
|
include OpenWFE
|
@@ -80,7 +80,7 @@ class HParticipantTest < Test::Unit::TestCase
|
|
80
80
|
#puts "alice count : #{@hpAlice.size}"
|
81
81
|
#puts "bob count : #{@hpBob.size}"
|
82
82
|
|
83
|
-
sleep 0.
|
83
|
+
sleep 0.300
|
84
84
|
|
85
85
|
assert_equal @hpBob.size, 0
|
86
86
|
assert_equal @hpAlice.size, 1
|
@@ -95,7 +95,7 @@ class HParticipantTest < Test::Unit::TestCase
|
|
95
95
|
|
96
96
|
@hpAlice.forward(wi)
|
97
97
|
|
98
|
-
sleep 0.
|
98
|
+
sleep 0.300
|
99
99
|
|
100
100
|
assert_equal @hpAlice.size, 0
|
101
101
|
assert_equal @hpBob.size, 1
|
@@ -106,7 +106,7 @@ class HParticipantTest < Test::Unit::TestCase
|
|
106
106
|
|
107
107
|
@hpBob.proceed(wi)
|
108
108
|
|
109
|
-
sleep 0.
|
109
|
+
sleep 0.300
|
110
110
|
|
111
111
|
assert_equal @hpAlice.size, 0
|
112
112
|
assert_equal @hpBob.size, 0
|
@@ -0,0 +1,94 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Tue Mar 11 13:44:11 JST 2008
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'test/unit'
|
11
|
+
|
12
|
+
require 'rubygems'
|
13
|
+
require 'openwfe/workitem'
|
14
|
+
require 'openwfe/expressions/expressionmap'
|
15
|
+
|
16
|
+
|
17
|
+
class LookupVfTest < Test::Unit::TestCase
|
18
|
+
|
19
|
+
#def setup
|
20
|
+
#end
|
21
|
+
|
22
|
+
#def teardown
|
23
|
+
#end
|
24
|
+
|
25
|
+
|
26
|
+
def test_0
|
27
|
+
|
28
|
+
fexp = new_exp({
|
29
|
+
"on-value" => "toto"
|
30
|
+
})
|
31
|
+
wi = new_wi({
|
32
|
+
"toto" => "whatever"
|
33
|
+
})
|
34
|
+
|
35
|
+
assert_equal(
|
36
|
+
"toto",
|
37
|
+
fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
|
38
|
+
|
39
|
+
fexp = new_exp({ "on-variable-value" => "toto" }, { "toto" => "surf" })
|
40
|
+
|
41
|
+
assert_equal(
|
42
|
+
"surf",
|
43
|
+
fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
|
44
|
+
|
45
|
+
fexp = new_exp({ "on-field-value" => "toto" })
|
46
|
+
|
47
|
+
assert_equal(
|
48
|
+
"whatever",
|
49
|
+
fexp.lookup_vf_attribute(wi, "value", :prefix => "on"))
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_1
|
53
|
+
|
54
|
+
fexp = new_exp({
|
55
|
+
"on" => "surf"
|
56
|
+
})
|
57
|
+
wi = new_wi
|
58
|
+
|
59
|
+
assert_equal(
|
60
|
+
"surf",
|
61
|
+
fexp.lookup_vf_attribute(wi, "", :prefix => "on"))
|
62
|
+
|
63
|
+
assert_equal(
|
64
|
+
"surf",
|
65
|
+
fexp.lookup_vf_attribute(wi, "", :prefix => :on))
|
66
|
+
end
|
67
|
+
|
68
|
+
protected
|
69
|
+
|
70
|
+
def new_exp (atts, vars={})
|
71
|
+
|
72
|
+
fexp = OpenWFE::ParticipantExpression.new
|
73
|
+
fexp.attributes = atts
|
74
|
+
|
75
|
+
fexp.instance_variable_set :@vars, vars
|
76
|
+
|
77
|
+
class << fexp
|
78
|
+
def lookup_variable (var_name)
|
79
|
+
@vars[var_name]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
fexp
|
84
|
+
end
|
85
|
+
|
86
|
+
def new_wi (atts={})
|
87
|
+
|
88
|
+
wi = OpenWFE::InFlowWorkItem.new
|
89
|
+
wi.attributes = atts
|
90
|
+
wi
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
data/test/misc_test.rb
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
require 'test/unit'
|
11
11
|
|
12
12
|
require 'openwfe/utils'
|
13
|
+
require 'openwfe/expressions/raw'
|
14
|
+
#require 'openwfe/def'
|
13
15
|
require 'openwfe/expressions/fe_define'
|
14
16
|
require 'openwfe/expressions/expressionmap'
|
15
17
|
|
@@ -60,7 +62,7 @@ class MiscTest < Test::Unit::TestCase
|
|
60
62
|
def test_grep_0
|
61
63
|
|
62
64
|
assert OpenWFE::grep("sputnik", "Rakefile").empty?
|
63
|
-
assert_equal OpenWFE::grep("Mettraux", "Rakefile").size
|
65
|
+
assert_equal 2, OpenWFE::grep("Mettraux", "Rakefile").size
|
64
66
|
|
65
67
|
OpenWFE::grep "Mettraux", "Rakefile" do |line|
|
66
68
|
assert_match "Mettraux", line
|
@@ -72,14 +74,14 @@ class MiscTest < Test::Unit::TestCase
|
|
72
74
|
em = OpenWFE::ExpressionMap.new
|
73
75
|
|
74
76
|
assert_equal \
|
75
|
-
em.get_expression_classes(
|
77
|
+
em.get_expression_classes(Rufus::Schedulable),
|
76
78
|
[
|
77
79
|
OpenWFE::ParticipantExpression,
|
78
80
|
OpenWFE::SleepExpression,
|
79
81
|
OpenWFE::CronExpression,
|
80
82
|
OpenWFE::WhenExpression,
|
81
83
|
OpenWFE::WaitExpression,
|
82
|
-
OpenWFE::ReserveExpression,
|
84
|
+
#OpenWFE::ReserveExpression,
|
83
85
|
OpenWFE::ListenExpression,
|
84
86
|
OpenWFE::TimeoutExpression,
|
85
87
|
OpenWFE::Environment
|
data/test/orest_test.rb
CHANGED
@@ -129,10 +129,11 @@ class OldRestTest < Test::Unit::TestCase
|
|
129
129
|
actual_store.consume(new_workitem())
|
130
130
|
|
131
131
|
headers = client.get_headers "alpha"
|
132
|
+
#headers = client.get_headers "Store.alpha"
|
132
133
|
|
133
|
-
assert_equal headers.length
|
134
|
-
assert_equal headers[0].attributes["nada"]
|
135
|
-
assert_equal headers[0].nada
|
134
|
+
assert_equal 1, headers.length
|
135
|
+
assert_equal "surf", headers[0].attributes["nada"]
|
136
|
+
assert_equal "surf", headers[0].nada
|
136
137
|
|
137
138
|
#
|
138
139
|
# launching a new process...
|
data/test/param_test.rb
CHANGED
@@ -38,15 +38,13 @@ class ParameterTest < Test::Unit::TestCase
|
|
38
38
|
e = nil
|
39
39
|
|
40
40
|
begin
|
41
|
-
@engine.launch
|
41
|
+
@engine.launch li
|
42
42
|
rescue Exception => e
|
43
43
|
#puts e
|
44
44
|
#puts OpenWFE::exception_to_s(e)
|
45
45
|
end
|
46
46
|
|
47
|
-
assert_equal
|
48
|
-
e.to_s,
|
49
|
-
"field 'address' is missing"
|
47
|
+
assert_equal "field 'address' is missing", e.to_s
|
50
48
|
|
51
49
|
# second round
|
52
50
|
|
@@ -67,7 +65,7 @@ class ParameterTest < Test::Unit::TestCase
|
|
67
65
|
|
68
66
|
assert_nil e
|
69
67
|
|
70
|
-
sleep 0.
|
68
|
+
sleep 0.350
|
71
69
|
# let the flow terminate on its own
|
72
70
|
end
|
73
71
|
|
@@ -96,9 +94,7 @@ class ParameterTest < Test::Unit::TestCase
|
|
96
94
|
#puts OpenWFE::exception_to_s(e)
|
97
95
|
end
|
98
96
|
|
99
|
-
assert_equal
|
100
|
-
e.to_s,
|
101
|
-
"field 'customer' is missing"
|
97
|
+
assert_equal "field 'customer' is missing", e.to_s
|
102
98
|
|
103
99
|
li = OpenWFE::LaunchItem.new(TestParam1)
|
104
100
|
li.customer = "bauhaus"
|
@@ -143,10 +139,10 @@ class ParameterTest < Test::Unit::TestCase
|
|
143
139
|
#puts OpenWFE::exception_to_s(e)
|
144
140
|
end
|
145
141
|
|
146
|
-
sleep 0.
|
142
|
+
sleep 0.350
|
147
143
|
|
148
144
|
assert_nil e
|
149
|
-
assert_equal
|
145
|
+
assert_equal "(unknown address)", @tracer.to_s
|
150
146
|
end
|
151
147
|
|
152
148
|
|
@@ -177,12 +173,12 @@ class ParameterTest < Test::Unit::TestCase
|
|
177
173
|
#puts OpenWFE::exception_to_s(e)
|
178
174
|
end
|
179
175
|
|
180
|
-
sleep 0.
|
176
|
+
sleep 0.350
|
181
177
|
|
182
178
|
# well, I should maybe refactor the test into a method
|
183
179
|
|
184
180
|
assert_nil e
|
185
|
-
assert_equal @tracer.to_s
|
181
|
+
assert_equal "3", @tracer.to_s
|
186
182
|
end
|
187
183
|
|
188
184
|
|
@@ -211,7 +207,7 @@ class ParameterTest < Test::Unit::TestCase
|
|
211
207
|
end
|
212
208
|
|
213
209
|
assert_not_nil e
|
214
|
-
assert_equal
|
210
|
+
assert_equal 'invalid value for Integer: "Colorado"', e.to_s
|
215
211
|
end
|
216
212
|
|
217
213
|
|
@@ -237,8 +233,8 @@ class ParameterTest < Test::Unit::TestCase
|
|
237
233
|
#puts OpenWFE::exception_to_s(e)
|
238
234
|
end
|
239
235
|
|
240
|
-
assert_equal
|
241
|
-
assert_equal e.class
|
236
|
+
assert_equal "field 'phone' is missing", e.to_s
|
237
|
+
assert_equal OpenWFE::ParameterException, e.class
|
242
238
|
|
243
239
|
# second round
|
244
240
|
|
@@ -257,7 +253,7 @@ class ParameterTest < Test::Unit::TestCase
|
|
257
253
|
end
|
258
254
|
|
259
255
|
assert_not_nil e
|
260
|
-
assert_equal
|
256
|
+
assert_equal "value of field 'phone' doesn't match", e.to_s
|
261
257
|
end
|
262
258
|
|
263
259
|
|
data/test/participant_test.rb
CHANGED
@@ -60,4 +60,40 @@ class ParticipantTest < Test::Unit::TestCase
|
|
60
60
|
assert_equal 0, @engine.get_participant_map.size
|
61
61
|
end
|
62
62
|
|
63
|
+
def test_order
|
64
|
+
|
65
|
+
s = ""
|
66
|
+
|
67
|
+
@engine.register_participant "a.*", :astar
|
68
|
+
@engine.register_participant "alpha", :alpha
|
69
|
+
|
70
|
+
assert_equal :astar, @engine.get_participant("alpha")
|
71
|
+
|
72
|
+
clean_participants
|
73
|
+
|
74
|
+
@engine.register_participant "alpha", :alpha
|
75
|
+
@engine.register_participant "a.*", :astar
|
76
|
+
|
77
|
+
assert_equal :alpha, @engine.get_participant("alpha")
|
78
|
+
|
79
|
+
clean_participants
|
80
|
+
|
81
|
+
@engine.register_participant "a.*", :astar
|
82
|
+
|
83
|
+
assert_equal :astar, @engine.get_participant("alpha")
|
84
|
+
|
85
|
+
@engine.register_participant "alpha", { :participant => :alpha, :position => :first }
|
86
|
+
|
87
|
+
assert_equal :alpha, @engine.get_participant("alpha")
|
88
|
+
assert_equal :astar, @engine.get_participant("abricot")
|
89
|
+
end
|
90
|
+
|
91
|
+
protected
|
92
|
+
|
93
|
+
def clean_participants
|
94
|
+
|
95
|
+
@engine.get_participant_map.instance_variable_set(
|
96
|
+
:@participants, [])
|
97
|
+
end
|
98
|
+
|
63
99
|
end
|
data/test/pending.rb
CHANGED
@@ -7,17 +7,17 @@ module PendingJobsMixin
|
|
7
7
|
|
8
8
|
def assert_no_jobs_left
|
9
9
|
|
10
|
-
cname = @engine.class.name
|
10
|
+
#cname = @engine.class.name
|
11
|
+
#min_jobs = if cname == 'OpenWFE::CachedFilePersistedEngine'
|
12
|
+
# 1
|
13
|
+
#elsif cname == 'OpenWFE::Extras::CachedDbPersistedEngine'
|
14
|
+
# 1
|
15
|
+
#else
|
16
|
+
# 0
|
17
|
+
#end
|
18
|
+
#assert_equal min_jobs, @engine.get_scheduler.pending_job_count
|
11
19
|
|
12
|
-
|
13
|
-
1
|
14
|
-
elsif cname == 'OpenWFE::Extras::CachedDbPersistedEngine'
|
15
|
-
1
|
16
|
-
else
|
17
|
-
0
|
18
|
-
end
|
19
|
-
|
20
|
-
assert_equal min_jobs, @engine.get_scheduler.pending_job_count
|
20
|
+
assert_equal 0, @engine.get_scheduler.at_job_count
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
data/test/rake_ltest.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Mon Oct 9 22:19:44 JST 2006
|
7
7
|
#
|
8
8
|
|
9
|
-
|
9
|
+
require 'rubygems'
|
10
10
|
|
11
11
|
#
|
12
12
|
# the tests that take lots of time...
|
@@ -14,10 +14,6 @@
|
|
14
14
|
|
15
15
|
require 'ft_5_time'
|
16
16
|
|
17
|
-
require 'scheduler_test'
|
18
|
-
require 'scheduler_1_test'
|
19
|
-
require 'cron_test'
|
20
|
-
|
21
17
|
require 'restart_tests'
|
22
18
|
|
23
19
|
require 'ft_20_cron'
|
@@ -30,11 +26,6 @@ require 'ft_51_stack'
|
|
30
26
|
#
|
31
27
|
# shaky test...
|
32
28
|
|
33
|
-
require 'extras/csv_test'
|
34
|
-
#
|
35
|
-
# this test taps the google docs servers, its duration is very
|
36
|
-
# variable, so it's been put here, with lengthy tests
|
37
|
-
|
38
29
|
#
|
39
30
|
# the quick tests
|
40
31
|
#
|