openwferu 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/validate-workflow.rb +1 -0
- data/examples/openwferu.rb +57 -0
- data/lib/openwfe/contextual.rb +2 -0
- data/lib/openwfe/engine/engine.rb +109 -17
- data/lib/openwfe/engine/file_persisted_engine.rb +11 -1
- data/lib/openwfe/exceptions.rb +53 -0
- data/lib/openwfe/expool/expressionpool.rb +195 -137
- data/lib/openwfe/expool/journal.rb +175 -0
- data/lib/openwfe/expool/journal_replay.rb +121 -0
- data/lib/openwfe/expool/wfidgen.rb +318 -0
- data/lib/openwfe/expool/yamlexpstorage.rb +23 -54
- data/lib/openwfe/expressions/condition.rb +14 -2
- data/lib/openwfe/expressions/environment.rb +47 -37
- data/lib/openwfe/expressions/expressionmap.rb +73 -67
- data/lib/openwfe/expressions/fe_cancel.rb +2 -0
- data/lib/openwfe/expressions/fe_concurrence.rb +14 -1
- data/lib/openwfe/expressions/fe_cron.rb +186 -0
- data/lib/openwfe/expressions/fe_cursor.rb +6 -0
- data/lib/openwfe/expressions/fe_define.rb +2 -0
- data/lib/openwfe/expressions/fe_fqv.rb +2 -0
- data/lib/openwfe/expressions/fe_iterator.rb +2 -0
- data/lib/openwfe/expressions/fe_losfor.rb +4 -0
- data/lib/openwfe/expressions/fe_misc.rb +16 -1
- data/lib/openwfe/expressions/fe_participant.rb +7 -0
- data/lib/openwfe/expressions/fe_raw.rb +125 -8
- data/lib/openwfe/expressions/fe_sequence.rb +2 -0
- data/lib/openwfe/expressions/fe_sleep.rb +213 -0
- data/lib/openwfe/expressions/fe_subprocess.rb +2 -0
- data/lib/openwfe/expressions/fe_value.rb +8 -0
- data/lib/openwfe/expressions/fe_when.rb +205 -0
- data/lib/openwfe/expressions/flowexpression.rb +62 -9
- data/lib/openwfe/expressions/raw_prog.rb +147 -45
- data/lib/openwfe/expressions/raw_xml.rb +50 -5
- data/lib/openwfe/expressions/timeout.rb +32 -5
- data/lib/openwfe/flowexpressionid.rb +6 -4
- data/lib/openwfe/listeners/listeners.rb +4 -3
- data/lib/openwfe/listeners/socketlisteners.rb +30 -4
- data/lib/openwfe/logging.rb +9 -1
- data/lib/openwfe/participants/participants.rb +9 -9
- data/lib/openwfe/participants/socketparticipants.rb +41 -8
- data/lib/openwfe/rudefinitions.rb +21 -0
- data/lib/openwfe/storage/yamlextras.rb +115 -0
- data/lib/openwfe/storage/yamlfilestorage.rb +23 -4
- data/lib/openwfe/util/csvtable.rb +76 -6
- data/lib/openwfe/util/dollar.rb +5 -0
- data/lib/openwfe/util/kotoba.rb +236 -0
- data/lib/openwfe/util/ometa.rb +64 -0
- data/lib/openwfe/util/safe.rb +2 -0
- data/lib/openwfe/util/scheduler.rb +58 -11
- data/lib/openwfe/utils.rb +27 -0
- data/lib/openwfe/version.rb +1 -1
- data/lib/openwfe/worklist/storeparticipant.rb +2 -3
- data/test/csv_test.rb +57 -0
- data/test/expmap_test.rb +54 -0
- data/test/file_persistence_test.rb +9 -9
- data/test/flowtestbase.rb +19 -1
- data/test/ft_11_ppd.rb +18 -0
- data/test/ft_15_iterator.rb +27 -0
- data/test/ft_23b_when.rb +2 -2
- data/test/ft_27_getflowpos.rb +19 -9
- data/test/ft_29_httprb.rb +31 -2
- data/test/ft_30_socketlistener.rb +3 -5
- data/test/ft_31_flowname.rb +40 -0
- data/test/ft_32_journal.rb +60 -0
- data/test/ft_33_description.rb +100 -0
- data/test/ft_34_cancelwfid.rb +69 -0
- data/test/ft_35_localdefs.rb +63 -0
- data/test/ft_7_lose.rb +0 -61
- data/test/ft_7b_lose.rb +85 -0
- data/test/ft_tests.rb +49 -0
- data/test/kotoba_test.rb +72 -0
- data/test/misc_test.rb +4 -12
- data/test/param_test.rb +284 -0
- data/test/rake_qtest.rb +13 -35
- data/test/rake_test.rb +2 -3
- data/test/raw_prog_test.rb +9 -7
- data/test/restart_cron_test.rb +9 -5
- data/test/restart_sleep_test.rb +104 -0
- data/test/restart_tests.rb +15 -0
- data/test/restart_when_test.rb +105 -0
- data/test/scheduler_test.rb +2 -2
- data/test/sec_test.rb +163 -0
- data/test/wfid_test.rb +69 -13
- metadata +31 -16
- data/lib/openwfe/expressions/fe_time.rb +0 -454
- data/test/restart_test.rb +0 -79
data/test/ft_7_lose.rb
CHANGED
@@ -100,66 +100,5 @@ done.""",
|
|
100
100
|
true)
|
101
101
|
end
|
102
102
|
|
103
|
-
#def xxxx_lose_1
|
104
|
-
def test_lose_1
|
105
|
-
dotest(
|
106
|
-
'<process-definition name="'+name_of_test+'''" revision="0">
|
107
|
-
<sequence>
|
108
|
-
<concurrence
|
109
|
-
count="1"
|
110
|
-
>
|
111
|
-
<lose>
|
112
|
-
<sequence>
|
113
|
-
<sleep for="500" />
|
114
|
-
<print>a</print>
|
115
|
-
</sequence>
|
116
|
-
</lose>
|
117
|
-
<print>b</print>
|
118
|
-
</concurrence>
|
119
|
-
<print>c</print>
|
120
|
-
</sequence>
|
121
|
-
</process-definition>''',
|
122
|
-
"""b
|
123
|
-
c""",
|
124
|
-
0.1,
|
125
|
-
true)
|
126
|
-
end
|
127
|
-
|
128
|
-
|
129
|
-
#
|
130
|
-
# TEST 2
|
131
|
-
|
132
|
-
class TestDefinition2 < ProcessDefinition
|
133
|
-
def make
|
134
|
-
process_definition :name => "7_lose", :revision => "2" do
|
135
|
-
sequence do
|
136
|
-
_print "before"
|
137
|
-
concurrence :count => 1 do
|
138
|
-
lose do
|
139
|
-
sequence do
|
140
|
-
_sleep :for => 350
|
141
|
-
_print "ok 4"
|
142
|
-
end
|
143
|
-
end
|
144
|
-
sequence do
|
145
|
-
_print "ok 5"
|
146
|
-
end
|
147
|
-
end
|
148
|
-
_print "after"
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
#def xxxx_lose_2
|
155
|
-
def test_lose_2
|
156
|
-
dotest(
|
157
|
-
TestDefinition2,
|
158
|
-
"""before
|
159
|
-
ok 5
|
160
|
-
after""",
|
161
|
-
0.1)
|
162
|
-
end
|
163
|
-
|
164
103
|
end
|
165
104
|
|
data/test/ft_7b_lose.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Mon Dec 25 14:27:48 JST 2006
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'openwfe/def'
|
11
|
+
require 'flowtestbase'
|
12
|
+
|
13
|
+
|
14
|
+
class FlowTest7b < Test::Unit::TestCase
|
15
|
+
include FlowTestBase
|
16
|
+
|
17
|
+
#def setup
|
18
|
+
#end
|
19
|
+
|
20
|
+
#def teardown
|
21
|
+
#end
|
22
|
+
|
23
|
+
#def xxxx_lose_1
|
24
|
+
def test_lose_1
|
25
|
+
dotest(
|
26
|
+
'<process-definition name="'+name_of_test+'''" revision="0">
|
27
|
+
<sequence>
|
28
|
+
<concurrence
|
29
|
+
count="1"
|
30
|
+
>
|
31
|
+
<lose>
|
32
|
+
<sequence>
|
33
|
+
<sleep for="500" />
|
34
|
+
<print>a</print>
|
35
|
+
</sequence>
|
36
|
+
</lose>
|
37
|
+
<print>b</print>
|
38
|
+
</concurrence>
|
39
|
+
<print>c</print>
|
40
|
+
</sequence>
|
41
|
+
</process-definition>''',
|
42
|
+
"""b
|
43
|
+
c""",
|
44
|
+
0.1,
|
45
|
+
true)
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
#
|
50
|
+
# TEST 2
|
51
|
+
|
52
|
+
class TestDefinition2 < ProcessDefinition
|
53
|
+
def make
|
54
|
+
process_definition :name => "7_lose", :revision => "2" do
|
55
|
+
sequence do
|
56
|
+
_print "before"
|
57
|
+
concurrence :count => 1 do
|
58
|
+
lose do
|
59
|
+
sequence do
|
60
|
+
_sleep :for => 350
|
61
|
+
_print "ok 4"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
sequence do
|
65
|
+
_print "ok 5"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
_print "after"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
#def xxxx_lose_2
|
75
|
+
def test_lose_2
|
76
|
+
dotest(
|
77
|
+
TestDefinition2,
|
78
|
+
"""before
|
79
|
+
ok 5
|
80
|
+
after""",
|
81
|
+
0.1)
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
data/test/ft_tests.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#
|
2
|
+
# Testing OpenWFE
|
3
|
+
#
|
4
|
+
# John Mettraux at openwfe.org
|
5
|
+
#
|
6
|
+
# Mon Oct 9 22:19:44 JST 2006
|
7
|
+
#
|
8
|
+
|
9
|
+
#require 'test/unit'
|
10
|
+
|
11
|
+
require 'ft_0'
|
12
|
+
require 'ft_0b_sequence'
|
13
|
+
require 'ft_0c_testname'
|
14
|
+
require 'ft_0d_participant'
|
15
|
+
require 'ft_1_unset'
|
16
|
+
require 'ft_1b_unset'
|
17
|
+
require 'ft_2_concurrence'
|
18
|
+
require 'ft_2b_concurrence'
|
19
|
+
require 'ft_2c_concurrence'
|
20
|
+
require 'ft_3_equals'
|
21
|
+
require 'ft_4_misc'
|
22
|
+
require 'ft_6_lambda'
|
23
|
+
require 'ft_7_lose'
|
24
|
+
require 'ft_7b_lose'
|
25
|
+
require 'ft_8_forget'
|
26
|
+
require 'ft_9_cursor'
|
27
|
+
require 'ft_10_loop'
|
28
|
+
require 'ft_10b_loop2'
|
29
|
+
require 'ft_11_ppd'
|
30
|
+
require 'ft_12_blockparticipant'
|
31
|
+
require 'ft_14_subprocess'
|
32
|
+
require 'ft_14b_subprocess'
|
33
|
+
require 'ft_15_iterator'
|
34
|
+
require 'ft_16_fqv'
|
35
|
+
require 'ft_17_condition'
|
36
|
+
require 'ft_18_pname'
|
37
|
+
require 'ft_19_csv'
|
38
|
+
require 'ft_22_history'
|
39
|
+
require 'ft_23_when'
|
40
|
+
require 'ft_23b_when'
|
41
|
+
require 'ft_24_def'
|
42
|
+
require 'ft_25_cancel'
|
43
|
+
require 'ft_27_getflowpos'
|
44
|
+
require 'ft_28_fileparticipant'
|
45
|
+
require 'ft_30_socketlistener'
|
46
|
+
require 'ft_31_flowname'
|
47
|
+
require 'ft_34_cancelwfid'
|
48
|
+
require 'ft_35_localdefs'
|
49
|
+
|
data/test/kotoba_test.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE (Kotoba)
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Sun Mar 18 13:29:37 JST 2007
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'test/unit'
|
11
|
+
require 'openwfe/util/kotoba'
|
12
|
+
|
13
|
+
#
|
14
|
+
# testing misc things
|
15
|
+
#
|
16
|
+
|
17
|
+
class KotobaTest < Test::Unit::TestCase
|
18
|
+
|
19
|
+
#def setup
|
20
|
+
#end
|
21
|
+
|
22
|
+
#def teardown
|
23
|
+
#end
|
24
|
+
|
25
|
+
def test_kotoba
|
26
|
+
t = Time.now
|
27
|
+
#puts t.to_f
|
28
|
+
|
29
|
+
st = t.to_f * 1000 * 10
|
30
|
+
|
31
|
+
#puts st
|
32
|
+
|
33
|
+
st = Integer(st) % (10 * 1000 * 60 * 60)
|
34
|
+
#st = 28340469
|
35
|
+
|
36
|
+
s = Kotoba::from_integer(st)
|
37
|
+
|
38
|
+
st2 = Kotoba::to_integer(s)
|
39
|
+
s2 = Kotoba::from_integer(st2)
|
40
|
+
|
41
|
+
#puts st
|
42
|
+
#puts s
|
43
|
+
|
44
|
+
#puts st2
|
45
|
+
#puts s2
|
46
|
+
|
47
|
+
assert_equal s, s2
|
48
|
+
assert_equal st, st2
|
49
|
+
|
50
|
+
a = Kotoba::split(s)
|
51
|
+
|
52
|
+
assert_equal a.join, s
|
53
|
+
|
54
|
+
#puts Kotoba::to_integer("tunashima")
|
55
|
+
#puts Kotoba::to_integer("tsunashima")
|
56
|
+
|
57
|
+
assert Kotoba::is_kotoba_word("takeshi")
|
58
|
+
|
59
|
+
assert Kotoba::is_kotoba_word("tsunasima")
|
60
|
+
assert Kotoba::is_kotoba_word("tunashima")
|
61
|
+
|
62
|
+
assert (not Kotoba::is_kotoba_word("dsfadf"))
|
63
|
+
assert (not Kotoba::is_kotoba_word("takeshin"))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
#require 'pp'
|
68
|
+
#pp Kotoba::split(s2)
|
69
|
+
#
|
70
|
+
#puts Kotoba::is_kotoba_word("asdfadsg")
|
71
|
+
#puts Kotoba::is_kotoba_word(s2)
|
72
|
+
|
data/test/misc_test.rb
CHANGED
@@ -36,18 +36,6 @@ class MiscTest < Test::Unit::TestCase
|
|
36
36
|
OpenWFE::ends_with("c'est la fin", "fin")
|
37
37
|
end
|
38
38
|
|
39
|
-
def test_expression_map
|
40
|
-
|
41
|
-
em = OpenWFE::ExpressionMap.new('expressionmap', {})
|
42
|
-
|
43
|
-
assert \
|
44
|
-
em.get_class('process-definition') == OpenWFE::DefineExpression,
|
45
|
-
"class of 'process-definition' should be DefineExpression"
|
46
|
-
assert \
|
47
|
-
em.is_definition?('process-definition'),
|
48
|
-
"process-definition should be considered as a definition"
|
49
|
-
end
|
50
|
-
|
51
39
|
def test_ensure_for_filename
|
52
40
|
|
53
41
|
assert OpenWFE::ensure_for_filename("abc") == "abc"
|
@@ -64,6 +52,10 @@ class MiscTest < Test::Unit::TestCase
|
|
64
52
|
assert OpenWFE::clean_path("my//file//path") == "my/file/path"
|
65
53
|
end
|
66
54
|
|
55
|
+
def test_stu
|
56
|
+
assert_equal "a_b_c", OpenWFE::stu("a b c")
|
57
|
+
end
|
58
|
+
|
67
59
|
def test_dup
|
68
60
|
a0 = A.new
|
69
61
|
a0.a = 1
|
data/test/param_test.rb
ADDED
@@ -0,0 +1,284 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Testing OpenWFE
|
4
|
+
#
|
5
|
+
# John Mettraux at openwfe.org
|
6
|
+
#
|
7
|
+
# Tue Jan 2 13:14:37 JST 2007
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'flowtestbase'
|
11
|
+
require 'openwfe/def'
|
12
|
+
require 'openwfe/workitem'
|
13
|
+
require 'openwfe/exceptions'
|
14
|
+
|
15
|
+
|
16
|
+
class ParameterTest < Test::Unit::TestCase
|
17
|
+
include FlowTestBase
|
18
|
+
|
19
|
+
#def setup
|
20
|
+
#end
|
21
|
+
|
22
|
+
#def teardown
|
23
|
+
#end
|
24
|
+
|
25
|
+
#
|
26
|
+
# test 0
|
27
|
+
|
28
|
+
def test_param_0
|
29
|
+
|
30
|
+
definition = '''
|
31
|
+
<process-definition name="reqtest" revision="0">
|
32
|
+
<parameter field="address"/>
|
33
|
+
<print>${f:address}</print>
|
34
|
+
</process-definition>'''.strip
|
35
|
+
|
36
|
+
li = OpenWFE::LaunchItem.new(definition)
|
37
|
+
|
38
|
+
e = nil
|
39
|
+
|
40
|
+
begin
|
41
|
+
@engine.launch(li)
|
42
|
+
rescue Exception => e
|
43
|
+
#puts e
|
44
|
+
#puts OpenWFE::exception_to_s(e)
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_equal \
|
48
|
+
e.to_s,
|
49
|
+
"field 'address' is missing"
|
50
|
+
|
51
|
+
# second round
|
52
|
+
|
53
|
+
li = OpenWFE::LaunchItem.new(definition)
|
54
|
+
li.address = "rose garden 4"
|
55
|
+
|
56
|
+
#require 'pp' ; pp li
|
57
|
+
|
58
|
+
e = nil
|
59
|
+
|
60
|
+
begin
|
61
|
+
@engine.launch(li)
|
62
|
+
rescue Exception => e
|
63
|
+
#puts e
|
64
|
+
#puts OpenWFE::exception_to_s(e)
|
65
|
+
end
|
66
|
+
|
67
|
+
assert_nil e
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
#
|
72
|
+
# test 1
|
73
|
+
|
74
|
+
class TestParam1 < OpenWFE::ProcessDefinition
|
75
|
+
|
76
|
+
param :field => "customer"
|
77
|
+
param :field => "address"
|
78
|
+
|
79
|
+
_print "#{f:customer}, #{f:address}"
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_param_1
|
83
|
+
|
84
|
+
li = OpenWFE::LaunchItem.new(TestParam1)
|
85
|
+
|
86
|
+
e = nil
|
87
|
+
|
88
|
+
begin
|
89
|
+
@engine.launch(li)
|
90
|
+
rescue Exception => e
|
91
|
+
#puts e
|
92
|
+
#puts OpenWFE::exception_to_s(e)
|
93
|
+
end
|
94
|
+
|
95
|
+
assert_equal \
|
96
|
+
e.to_s,
|
97
|
+
"field 'customer' is missing"
|
98
|
+
|
99
|
+
li = OpenWFE::LaunchItem.new(TestParam1)
|
100
|
+
li.customer = "bauhaus"
|
101
|
+
li.address = "rose garden 4"
|
102
|
+
|
103
|
+
e = nil
|
104
|
+
|
105
|
+
begin
|
106
|
+
@engine.launch(li)
|
107
|
+
rescue Exception => e
|
108
|
+
#puts e
|
109
|
+
#puts OpenWFE::exception_to_s(e)
|
110
|
+
end
|
111
|
+
|
112
|
+
assert_nil e
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
#
|
117
|
+
# test 2
|
118
|
+
|
119
|
+
class TestParam2 < OpenWFE::ProcessDefinition
|
120
|
+
|
121
|
+
param :field => "address", :default => "(unknown address)"
|
122
|
+
|
123
|
+
sequence do
|
124
|
+
#pp_workitem
|
125
|
+
_print "${f:address}"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_param_2
|
130
|
+
|
131
|
+
li = OpenWFE::LaunchItem.new(TestParam2)
|
132
|
+
|
133
|
+
e = nil
|
134
|
+
|
135
|
+
begin
|
136
|
+
@engine.launch(li)
|
137
|
+
rescue Exception => e
|
138
|
+
#puts e
|
139
|
+
#puts OpenWFE::exception_to_s(e)
|
140
|
+
end
|
141
|
+
|
142
|
+
assert_nil e
|
143
|
+
assert_equal @tracer.to_s, "(unknown address)"
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
#
|
148
|
+
# test 3
|
149
|
+
|
150
|
+
class TestParam3 < OpenWFE::ProcessDefinition
|
151
|
+
|
152
|
+
param :field => :address, :type => :string
|
153
|
+
|
154
|
+
sequence do
|
155
|
+
#pp_workitem
|
156
|
+
_print "${f:address}"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_param_3
|
161
|
+
|
162
|
+
li = OpenWFE::LaunchItem.new(TestParam3)
|
163
|
+
li.address = 3
|
164
|
+
|
165
|
+
e = nil
|
166
|
+
|
167
|
+
begin
|
168
|
+
@engine.launch(li)
|
169
|
+
rescue Exception => e
|
170
|
+
#puts e
|
171
|
+
#puts OpenWFE::exception_to_s(e)
|
172
|
+
end
|
173
|
+
|
174
|
+
assert_nil e
|
175
|
+
assert_equal @tracer.to_s, "3"
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
#
|
180
|
+
# test 4
|
181
|
+
|
182
|
+
class TestParam4 < OpenWFE::ProcessDefinition
|
183
|
+
|
184
|
+
param :field => :zip, :type => :integer
|
185
|
+
|
186
|
+
_print "${f:zip}"
|
187
|
+
end
|
188
|
+
|
189
|
+
def test_param_4
|
190
|
+
|
191
|
+
li = OpenWFE::LaunchItem.new(TestParam4)
|
192
|
+
li.zip = "Colorado"
|
193
|
+
|
194
|
+
e = nil
|
195
|
+
|
196
|
+
begin
|
197
|
+
@engine.launch(li)
|
198
|
+
rescue Exception => e
|
199
|
+
#puts e
|
200
|
+
#puts OpenWFE::exception_to_s(e)
|
201
|
+
end
|
202
|
+
|
203
|
+
assert_not_nil e
|
204
|
+
assert_equal e.to_s, 'invalid value for Integer: "Colorado"'
|
205
|
+
end
|
206
|
+
|
207
|
+
|
208
|
+
#
|
209
|
+
# test 5
|
210
|
+
|
211
|
+
def test_param_5
|
212
|
+
|
213
|
+
definition = '''
|
214
|
+
<process-definition name="paramtest" revision="5">
|
215
|
+
<parameter field="phone" match="^[0-9]{3}-[0-9]{3}-[0-9]{4}$" />
|
216
|
+
<print>${field:phone}</print>
|
217
|
+
</process-definition>'''.strip
|
218
|
+
|
219
|
+
li = OpenWFE::LaunchItem.new(definition)
|
220
|
+
|
221
|
+
e = nil
|
222
|
+
|
223
|
+
begin
|
224
|
+
@engine.launch(li)
|
225
|
+
rescue Exception => e
|
226
|
+
#puts e
|
227
|
+
#puts OpenWFE::exception_to_s(e)
|
228
|
+
end
|
229
|
+
|
230
|
+
assert_equal e.to_s, "field 'phone' is missing"
|
231
|
+
assert_equal e.class, OpenWFE::ParameterException
|
232
|
+
|
233
|
+
# second round
|
234
|
+
|
235
|
+
li = OpenWFE::LaunchItem.new(definition)
|
236
|
+
li.phone = "4444-333-4444"
|
237
|
+
|
238
|
+
#require 'pp' ; pp li
|
239
|
+
|
240
|
+
e = nil
|
241
|
+
|
242
|
+
begin
|
243
|
+
@engine.launch(li)
|
244
|
+
rescue Exception => e
|
245
|
+
#puts e
|
246
|
+
#puts OpenWFE::exception_to_s(e)
|
247
|
+
end
|
248
|
+
|
249
|
+
assert_not_nil e
|
250
|
+
assert_equal e.to_s, "value of field 'phone' doesn't match"
|
251
|
+
end
|
252
|
+
|
253
|
+
|
254
|
+
#
|
255
|
+
# test 6
|
256
|
+
|
257
|
+
class TestParam6 < OpenWFE::ProcessDefinition
|
258
|
+
|
259
|
+
param :field => "customer_type", :default => "2", :type => "int"
|
260
|
+
|
261
|
+
_print "#{f:customer}, #{f:address}"
|
262
|
+
end
|
263
|
+
|
264
|
+
def test_param_1
|
265
|
+
|
266
|
+
li = OpenWFE::LaunchItem.new(TestParam6)
|
267
|
+
|
268
|
+
e = nil
|
269
|
+
begin
|
270
|
+
@engine.pre_launch_check(li)
|
271
|
+
rescue Exception => e
|
272
|
+
#puts e
|
273
|
+
#puts OpenWFE::exception_to_s(e)
|
274
|
+
end
|
275
|
+
|
276
|
+
#require 'pp'; pp li
|
277
|
+
|
278
|
+
assert_nil e
|
279
|
+
assert li.customer_type
|
280
|
+
assert li.customer_type == 2
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|
284
|
+
|
data/test/rake_qtest.rb
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
#require 'test/unit'
|
10
10
|
|
11
|
-
File.delete('engine.log') \
|
12
|
-
if File.exist? 'engine.log'
|
11
|
+
#File.delete('engine.log') \
|
12
|
+
# if File.exist? 'engine.log'
|
13
13
|
|
14
14
|
require 'fei_test'
|
15
15
|
require 'wfid_test'
|
@@ -24,40 +24,18 @@ require 'file_persistence_test'
|
|
24
24
|
require 'cronline_test'
|
25
25
|
require 'csv_test'
|
26
26
|
require 'safely_test'
|
27
|
+
#require 'model_test'
|
28
|
+
require 'kotoba_test'
|
29
|
+
require 'expmap_test'
|
27
30
|
|
28
|
-
require '
|
29
|
-
require '
|
30
|
-
|
31
|
-
require '
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
require '
|
36
|
-
require 'ft_2c_concurrence'
|
37
|
-
require 'ft_3_equals'
|
38
|
-
require 'ft_4_misc'
|
39
|
-
require 'ft_6_lambda'
|
40
|
-
require 'ft_7_lose'
|
41
|
-
require 'ft_8_forget'
|
42
|
-
require 'ft_9_cursor'
|
43
|
-
require 'ft_10_loop'
|
44
|
-
require 'ft_10b_loop2'
|
45
|
-
require 'ft_11_ppd'
|
46
|
-
require 'ft_12_blockparticipant'
|
47
|
-
require 'ft_14_subprocess'
|
48
|
-
require 'ft_14b_subprocess'
|
49
|
-
require 'ft_15_iterator'
|
50
|
-
require 'ft_16_fqv'
|
51
|
-
require 'ft_17_condition'
|
52
|
-
require 'ft_18_pname'
|
53
|
-
require 'ft_19_csv'
|
54
|
-
require 'ft_22_history'
|
55
|
-
require 'ft_23_when'
|
56
|
-
require 'ft_24_def'
|
57
|
-
require 'ft_25_cancel'
|
58
|
-
require 'ft_27_getflowpos'
|
59
|
-
require 'ft_28_fileparticipant'
|
60
|
-
require 'ft_30_socketlistener'
|
31
|
+
require 'sec_test'
|
32
|
+
require 'param_test'
|
33
|
+
|
34
|
+
require 'ft_tests'
|
35
|
+
#
|
36
|
+
# all the 'ft' tests are required in 'ft_tests.rb'
|
37
|
+
|
38
|
+
#require 'ft_32_journal'
|
61
39
|
|
62
40
|
require 'hparticipant_test'
|
63
41
|
require 'timeout_test'
|
data/test/rake_test.rb
CHANGED
@@ -15,11 +15,10 @@ require 'ft_5_time'
|
|
15
15
|
require 'scheduler_test'
|
16
16
|
require 'cron_test'
|
17
17
|
|
18
|
-
require '
|
19
|
-
|
18
|
+
require 'restart_tests'
|
19
|
+
|
20
20
|
require 'ft_20_cron'
|
21
21
|
require 'ft_21_cron'
|
22
|
-
require 'ft_23b_when'
|
23
22
|
|
24
23
|
#
|
25
24
|
# the quick tests
|