openwferu 0.9.15 → 0.9.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/README.txt +4 -2
  2. data/lib/openwfe/engine/engine.rb +143 -25
  3. data/lib/openwfe/engine/file_persisted_engine.rb +3 -3
  4. data/lib/openwfe/expool/errorjournal.rb +48 -25
  5. data/lib/openwfe/expool/expressionpool.rb +77 -106
  6. data/lib/openwfe/expool/expstorage.rb +6 -5
  7. data/lib/openwfe/expool/threadedexpstorage.rb +190 -0
  8. data/lib/openwfe/expool/yamlexpstorage.rb +5 -150
  9. data/lib/openwfe/expressions/condition.rb +6 -6
  10. data/lib/openwfe/expressions/environment.rb +7 -2
  11. data/lib/openwfe/expressions/expressionmap.rb +14 -0
  12. data/lib/openwfe/expressions/fe_command.rb +2 -1
  13. data/lib/openwfe/expressions/fe_concurrence.rb +40 -18
  14. data/lib/openwfe/expressions/fe_cron.rb +14 -11
  15. data/lib/openwfe/expressions/fe_cursor.rb +2 -3
  16. data/lib/openwfe/expressions/fe_define.rb +34 -31
  17. data/lib/openwfe/expressions/fe_equals.rb +11 -21
  18. data/lib/openwfe/expressions/fe_filter_definition.rb +0 -2
  19. data/lib/openwfe/expressions/fe_fqv.rb +1 -3
  20. data/lib/openwfe/expressions/fe_if.rb +37 -12
  21. data/lib/openwfe/expressions/fe_iterator.rb +1 -1
  22. data/lib/openwfe/expressions/fe_listen.rb +147 -28
  23. data/lib/openwfe/expressions/fe_losfor.rb +13 -1
  24. data/lib/openwfe/expressions/fe_misc.rb +70 -11
  25. data/lib/openwfe/expressions/fe_participant.rb +3 -3
  26. data/lib/openwfe/expressions/fe_reserve.rb +1 -1
  27. data/lib/openwfe/expressions/fe_save.rb +11 -12
  28. data/lib/openwfe/expressions/fe_sequence.rb +22 -29
  29. data/lib/openwfe/expressions/fe_sleep.rb +11 -7
  30. data/lib/openwfe/expressions/fe_subprocess.rb +24 -10
  31. data/lib/openwfe/expressions/fe_value.rb +35 -15
  32. data/lib/openwfe/expressions/fe_when.rb +2 -4
  33. data/lib/openwfe/expressions/flowexpression.rb +73 -37
  34. data/lib/openwfe/expressions/merge.rb +2 -4
  35. data/lib/openwfe/expressions/raw.rb +40 -31
  36. data/lib/openwfe/expressions/raw_prog.rb +18 -9
  37. data/lib/openwfe/expressions/raw_xml.rb +1 -8
  38. data/lib/openwfe/expressions/simplerep.rb +27 -5
  39. data/lib/openwfe/expressions/time.rb +45 -15
  40. data/lib/openwfe/expressions/timeout.rb +2 -1
  41. data/lib/openwfe/expressions/wtemplate.rb +2 -2
  42. data/lib/openwfe/flowexpressionid.rb +62 -16
  43. data/lib/openwfe/listeners/listener.rb +28 -37
  44. data/lib/openwfe/listeners/listeners.rb +1 -1
  45. data/lib/openwfe/listeners/socketlisteners.rb +7 -15
  46. data/lib/openwfe/logging.rb +5 -4
  47. data/lib/openwfe/{rest → orest}/controlclient.rb +3 -5
  48. data/lib/openwfe/{rest → orest}/definitions.rb +0 -2
  49. data/lib/openwfe/{rest → orest}/exception.rb +0 -0
  50. data/lib/openwfe/{rest → orest}/oldrestservlet.rb +1 -1
  51. data/lib/openwfe/{rest → orest}/osocket.rb +1 -1
  52. data/lib/openwfe/{rest → orest}/restclient.rb +0 -2
  53. data/lib/openwfe/orest/workitem.rb +206 -0
  54. data/lib/openwfe/{rest → orest}/worklistclient.rb +15 -5
  55. data/lib/openwfe/{rest → orest}/xmlcodec.rb +4 -1
  56. data/lib/openwfe/participants/enoparticipants.rb +4 -14
  57. data/lib/openwfe/participants/participantmap.rb +16 -12
  58. data/lib/openwfe/participants/participants.rb +46 -1
  59. data/lib/openwfe/participants/socketparticipants.rb +1 -6
  60. data/lib/openwfe/service.rb +15 -6
  61. data/lib/openwfe/storage/yamlcustom.rb +3 -0
  62. data/lib/openwfe/storage/yamlfilestorage.rb +3 -1
  63. data/lib/openwfe/util/dollar.rb +21 -14
  64. data/lib/openwfe/util/lru.rb +29 -10
  65. data/lib/openwfe/util/observable.rb +4 -1
  66. data/lib/openwfe/util/otime.rb +3 -0
  67. data/lib/openwfe/util/scheduler.rb +346 -114
  68. data/lib/openwfe/utils.rb +67 -13
  69. data/lib/openwfe/version.rb +1 -1
  70. data/lib/openwfe/workitem.rb +22 -165
  71. data/lib/openwfe/worklist/oldrest.rb +2 -2
  72. data/test/bm/bm_1_xml_vs_prog.rb +56 -0
  73. data/test/{ft_26_load.rb → bm/ft_26_load.rb} +0 -0
  74. data/test/{ft_26b_load.rb → bm/ft_26b_load.rb} +0 -0
  75. data/test/{ft_26c_load.rb → bm/ft_26c_load.rb} +16 -4
  76. data/test/clone_test.rb +62 -0
  77. data/test/cron_test.rb +56 -1
  78. data/test/cronline_test.rb +17 -8
  79. data/test/description_test.rb +57 -0
  80. data/test/dollar_test.rb +17 -6
  81. data/test/eno_test.rb +22 -9
  82. data/test/fe_lookup_att_test.rb +50 -0
  83. data/test/fei_test.rb +18 -9
  84. data/test/flowtestbase.rb +24 -2
  85. data/test/ft_0.rb +10 -12
  86. data/test/ft_0e_multibody.rb +34 -0
  87. data/test/ft_10_loop.rb +4 -6
  88. data/test/ft_11_ppd.rb +5 -20
  89. data/test/ft_14b_subprocess.rb +2 -2
  90. data/test/ft_15_iterator.rb +56 -4
  91. data/test/ft_15b_iterator.rb +48 -0
  92. data/test/ft_16_fqv.rb +18 -3
  93. data/test/ft_23c_wait.rb +7 -5
  94. data/test/ft_25_cancel.rb +5 -3
  95. data/test/ft_27_getflowpos.rb +14 -11
  96. data/test/ft_28_fileparticipant.rb +3 -4
  97. data/test/ft_2_concurrence.rb +8 -12
  98. data/test/ft_2b_concurrence.rb +3 -2
  99. data/test/ft_30_socketlistener.rb +5 -6
  100. data/test/ft_32c_journal.rb +2 -2
  101. data/test/ft_32d_journal.rb +5 -6
  102. data/test/ft_33_description.rb +8 -3
  103. data/test/ft_34_cancelwfid.rb +3 -3
  104. data/test/ft_38_tag.rb +7 -10
  105. data/test/ft_39_reserve.rb +4 -2
  106. data/test/ft_3_equals.rb +18 -13
  107. data/test/ft_44b_restore.rb +2 -6
  108. data/test/ft_49_condition.rb +16 -12
  109. data/test/ft_4_misc.rb +51 -12
  110. data/test/ft_50_xml_attribute.rb +1 -1
  111. data/test/ft_54_listen.rb +96 -10
  112. data/test/ft_54b_listen.rb +68 -0
  113. data/test/ft_55_ptimeout.rb +1 -2
  114. data/test/ft_58_ejournal.rb +8 -33
  115. data/test/ft_59_ps.rb +2 -3
  116. data/test/ft_59b_ps_for_pat.rb +59 -0
  117. data/test/ft_5_time.rb +45 -4
  118. data/test/ft_60_ecancel.rb +7 -7
  119. data/test/ft_61_elsub.rb +1 -1
  120. data/test/ft_64_alias.rb +1 -1
  121. data/test/ft_67_schedlaunch.rb +29 -16
  122. data/test/ft_69_cancelmissing.rb +1 -1
  123. data/test/ft_6_lambda.rb +8 -6
  124. data/test/ft_70_lookupvar.rb +2 -2
  125. data/test/ft_71_log.rb +60 -0
  126. data/test/ft_72_lookup_processes.rb +79 -0
  127. data/test/ft_73_cancel_sub.rb +144 -0
  128. data/test/ft_74_block_and_workitem_dup.rb +63 -0
  129. data/test/ft_75_ruby_attributes.rb +87 -0
  130. data/test/ft_76_merge_isolate.rb +90 -0
  131. data/test/ft_7_lose.rb +2 -1
  132. data/test/ft_tests.rb +9 -0
  133. data/test/lookup_att_test.rb +90 -0
  134. data/test/misc_test.rb +33 -50
  135. data/test/orest_test.rb +1 -1
  136. data/test/participant_test.rb +32 -8
  137. data/test/pending.rb +6 -7
  138. data/test/rake_ltest.rb +3 -0
  139. data/test/rake_qtest.rb +4 -1
  140. data/test/raw_prog_test.rb +1 -1
  141. data/test/restart_cron_test.rb +6 -6
  142. data/test/restart_sleep_test.rb +8 -8
  143. data/test/ruby_procdef_test.rb +2 -2
  144. data/test/rutest_utils.rb +9 -3
  145. data/test/scheduler_1_test.rb +88 -0
  146. data/test/scheduler_test.rb +49 -4
  147. data/test/sec_test.rb +18 -11
  148. metadata +51 -34
  149. 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.500)
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.500)
62
+ "before",
63
+ 0.900)
62
64
  end
63
65
 
64
66
 
@@ -43,14 +43,14 @@ class FlowTest27 < Test::Unit::TestCase
43
43
 
44
44
  fei = @engine.launch(TestDefinition0)
45
45
 
46
- sleep 0.100
46
+ sleep 0.200
47
47
 
48
48
  l = @engine.get_process_stack(fei.wfid)
49
49
 
50
- #print_exp_list(l)
50
+ #print_exp_list l
51
51
 
52
52
  assert_equal \
53
- l.size, 3, "get_process_stack() returned #{l.size} elements"
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
- sp = @engine.register_participant("store_p", OpenWFE::YamlParticipant)
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.100
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, 3
112
+ assert_equal 3, l.size
110
113
 
111
114
  l = @engine.list_processes()
112
- assert_equal l.size, 1
115
+ assert_equal 1, l.size
113
116
 
114
117
  l = @engine.list_processes(false, "nada")
115
- assert_equal l.size, 0
118
+ assert_equal 0, l.size
116
119
 
117
120
  l = @engine.list_workflows(false, fei.wfid[0, 3])
118
- assert_equal l.size, 1
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, 0
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.1
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
@@ -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 xxxx_con_2
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
- dotest(TestDefinition6, "b\nc")
122
+
123
+ dotest TestDefinition6, "b\nc"
128
124
  end
129
125
 
130
126
  end
@@ -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(Isolate01, "0\n1\n2", true)
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
- def make
35
- _print "${f:message}"
36
- end
34
+ _print "${f:message}"
37
35
  end
38
36
 
39
- #def xxxx_sl_0
40
- def test_sl_0
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.100
60
+ sleep 0.200
62
61
 
63
62
  trace = @tracer.to_s
64
63
 
@@ -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.250
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), 2
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
@@ -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("journal", Journal)
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.200
59
+ sleep 0.500
60
60
 
61
61
  get_journal.flush_buckets
62
62
 
63
- fn = get_journal.workdir + "/" + fei.wfid + ".journal"
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 @tracer.to_s, "alpha\nnada\nbravo"
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
 
@@ -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
- """nothing
95
- nothing
96
- nada""")
101
+ "String\nnothing\nnothing\nnada")
97
102
  end
98
103
 
99
104
  end
@@ -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.100
65
+ sleep 0.300
66
66
 
67
67
  @engine.cancel_process(fei.wfid)
68
68
 
69
- sleep 0.100
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(TestTag0, "blah")
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 xxxx_tag_1
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 count, 1
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 xxxx_tag_2
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 count, 1
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 xxxx_tag_3
124
- #def test_tag_3
121
+ def test_tag_3
125
122
 
126
123
  dotest TestTag3, "1\n3"
127
124
  end
@@ -33,7 +33,8 @@ class FlowTest39 < Test::Unit::TestCase
33
33
  end
34
34
 
35
35
  def test_0
36
- dotest(TestReserve39a0, "ok", true)
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
- dotest(TestReserve39a1, "true\ntrue\nover.", true)
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>ok</print>
145
+ <print>ok0</print>
143
146
  </if>
144
147
  <if test="3 > a">
145
148
  <print>bad</print>
146
- <print>ok</print>
149
+ <print>ok1</print>
147
150
  </if>
148
151
  <if test="3>a">
149
152
  <print>bad</print>
150
- <print>ok</print>
153
+ <print>ok2</print>
151
154
  </if>
152
155
  <if test="3 &gt; 2">
153
- <print>ok</print>
156
+ <print>ok3</print>
157
+ <print>bad</print>
154
158
  </if>
155
159
  <if test="1 &lt; 2.0">
156
- <print>ok</print>
160
+ <print>ok4</print>
161
+ <print>bad</print>
157
162
  </if>
158
163
  </sequence>
159
164
  </process-definition>''',
160
- ("ok\n" * 5).strip)
165
+ (0..4).collect { |i| "ok#{i}" }.join("\n"))
161
166
  end
162
167
 
163
168
  end
@@ -90,13 +90,9 @@ field_value
90
90
  end
91
91
  end
92
92
 
93
- #def xxxx_2
94
93
  def test_2
95
- dotest(
96
- TestCase44b2,
97
- """
98
- field_value
99
- """.strip)
94
+
95
+ dotest TestCase44b2, "field_value"
100
96
  end
101
97
 
102
98