Browse files

dropping ProcessStatus#to_h for now

ruote-kit has its own
  • Loading branch information...
1 parent 8906405 commit f9aaad40e55a07c5a9e736428029bf2e457c1dae @jmettraux jmettraux committed Jul 28, 2010
Showing with 49 additions and 67 deletions.
  1. +18 −24 lib/ruote/engine/process_status.rb
  2. +16 −22 test/functional/ft_1_process_status.rb
  3. +15 −21 test/functional/ft_2_errors.rb
View
42 lib/ruote/engine/process_status.rb
@@ -289,30 +289,24 @@ def to_dot (opts={})
s.join("\n")
end
- # Mostly used by ruote-kit.
- #
- def to_h
-
- h = {}
-
- %w[
- wfid
- definition_name definition_revision
- original_tree current_tree
- variables tags
- ].each { |m| h[m] = self.send(m) }
-
- h['launched_time'] = launched_time
- h['last_active'] = last_active
-
- # all_variables and all_tags ?
-
- h['root_expression'] = nil
- h['expressions'] = @expressions.collect { |e| e.fei.to_h }
- h['errors'] = @errors.collect { |e| e.to_h }
-
- h
- end
+ #--
+ #def to_h
+ # h = {}
+ # %w[
+ # wfid
+ # definition_name definition_revision
+ # original_tree current_tree
+ # variables tags
+ # ].each { |m| h[m] = self.send(m) }
+ # h['launched_time'] = launched_time
+ # h['last_active'] = last_active
+ # # all_variables and all_tags ?
+ # h['root_expression'] = nil
+ # h['expressions'] = @expressions.collect { |e| e.fei.to_h }
+ # h['errors'] = @errors.collect { |e| e.to_h }
+ # h
+ #end
+ #++
# Returns the current version of the process definition tree. If no
# manipulation (gardening) was performed on the tree, this method yields
View
38 test/functional/ft_1_process_status.rb
@@ -37,28 +37,22 @@ def test_ps
{"my process"=>["0", ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]]]},
ps.variables)
- # checking process_status.to_h
-
- h = ps.to_h
- #p h
-
- assert_equal wfid, h['wfid']
- assert_equal 2, h['expressions'].size
- assert_equal 'my process', h['definition_name']
-
- assert_equal Time, Time.parse(h['launched_time']).class
-
- assert_equal(
- ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]],
- h['original_tree'])
-
- assert_equal(
- ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]],
- h['current_tree'])
-
- assert_equal(
- {"my process"=>["0", ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]]]},
- h['variables'])
+ ## checking process_status.to_h
+ #h = ps.to_h
+ ##p h
+ #assert_equal wfid, h['wfid']
+ #assert_equal 2, h['expressions'].size
+ #assert_equal 'my process', h['definition_name']
+ #assert_equal Time, Time.parse(h['launched_time']).class
+ #assert_equal(
+ # ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]],
+ # h['original_tree'])
+ #assert_equal(
+ # ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]],
+ # h['current_tree'])
+ #assert_equal(
+ # {"my process"=>["0", ["define", {"name"=>"my process"}, [["participant", {"ref"=>"alpha"}, []]]]]},
+ # h['variables'])
end
def test_variables
View
36 test/functional/ft_2_errors.rb
@@ -339,27 +339,21 @@ def test_forgotten_subprocess
assert_nil @engine.process(wfid)
end
- def test_ps_to_h
-
- pdef = Ruote.process_definition do
- error 'nada'
- end
-
- #noisy
-
- wfid = @engine.launch(pdef)
- wait_for(wfid)
-
- ps = @engine.process(wfid)
-
- es = ps.to_h['errors']
- e = es.first
-
- assert_equal 1, es.size
- assert_equal 'reply', e['msg']['action']
- assert_equal wfid, e['msg']['fei']['wfid']
- assert_equal 8, e.size
- end
+ #def test_ps_to_h
+ # pdef = Ruote.process_definition do
+ # error 'nada'
+ # end
+ # #noisy
+ # wfid = @engine.launch(pdef)
+ # wait_for(wfid)
+ # ps = @engine.process(wfid)
+ # es = ps.to_h['errors']
+ # e = es.first
+ # assert_equal 1, es.size
+ # assert_equal 'reply', e['msg']['action']
+ # assert_equal wfid, e['msg']['fei']['wfid']
+ # assert_equal 8, e.size
+ #end
def test_error_intercepted

0 comments on commit f9aaad4

Please sign in to comment.