test/fei_test.rb in ruote-0.9.18 vs test/fei_test.rb in ruote-0.9.19

- old
+ new

@@ -15,167 +15,167 @@ require 'openwfe/rudefinitions' class FeiTest < Test::Unit::TestCase - #def setup - #end + #def setup + #end - #def teardown - #end + #def teardown + #end - def test_equality + def test_equality - fei1 = new_fei() - fei2 = new_fei() + fei1 = new_fei() + fei2 = new_fei() - assert \ - fei1.object_id != fei2.object_id, \ - "feis are not two distinct feis" - assert \ - fei1.hash == fei2.hash, \ - "feis do not have the same hash" - assert \ - fei1 == fei2, \ - "feis are not equals (==)" - assert \ - fei1.eql?(fei2), \ - "feis are not equals (eql?)" - end + assert \ + fei1.object_id != fei2.object_id, \ + "feis are not two distinct feis" + assert \ + fei1.hash == fei2.hash, \ + "feis do not have the same hash" + assert \ + fei1 == fei2, \ + "feis are not equals (==)" + assert \ + fei1.eql?(fei2), \ + "feis are not equals (eql?)" + end - def test_inequality + def test_inequality - fei1 = new_fei() + fei1 = new_fei() - fei2 = new_fei() - fei2.expression_name = OpenWFE::EN_ENVIRONMENT + fei2 = new_fei() + fei2.expression_name = OpenWFE::EN_ENVIRONMENT - assert \ - fei1.object_id != fei2.object_id, \ - "feis are not two distinct feis" - assert \ - fei1.hash != fei2.hash, \ - "feis do have the same hash" - assert \ - fei1 != fei2, \ - "feis are equals (==)" - assert \ - (not fei1.eql?(fei2)), \ - "feis are equals (eql?)" - end + assert \ + fei1.object_id != fei2.object_id, \ + "feis are not two distinct feis" + assert \ + fei1.hash != fei2.hash, \ + "feis do have the same hash" + assert \ + fei1 != fei2, \ + "feis are equals (==)" + assert \ + (not fei1.eql?(fei2)), \ + "feis are equals (eql?)" + end - def test_in_hash - h = Hash.new() + def test_in_hash + h = Hash.new() - fei1 = new_fei() - fei2 = new_fei() + fei1 = new_fei() + fei2 = new_fei() - h[fei1] = 'one' - h[fei2] = 'two' + h[fei1] = 'one' + h[fei2] = 'two' - #puts_hash(h) - #puts "fei1 : #{fei1.to_debug_s}" - #puts "fei2 : #{fei2.to_debug_s}" + #puts_hash(h) + #puts "fei1 : #{fei1.to_debug_s}" + #puts "fei2 : #{fei2.to_debug_s}" - assert \ - h.size() == 1, - "h should have one entry" - assert \ - h[fei1] == h[fei2], - "both keys should point to the same thing" - assert \ - h[fei1] == 'two', - "value should be 'two' (fei1)" - assert \ - h[fei2] == 'two', - "value should be 'two' (fei2)" - end + assert \ + h.size() == 1, + "h should have one entry" + assert \ + h[fei1] == h[fei2], + "both keys should point to the same thing" + assert \ + h[fei1] == 'two', + "value should be 'two' (fei1)" + assert \ + h[fei2] == 'two', + "value should be 'two' (fei2)" + end - def test_dup - fei0 = new_fei() - fei1 = fei0.dup() + def test_dup + fei0 = new_fei() + fei1 = fei0.dup() - assert \ - fei0 == fei1, - "feis should be equal" + assert \ + fei0 == fei1, + "feis should be equal" - fei1.expression_name = OpenWFE::EN_ENVIRONMENT + fei1.expression_name = OpenWFE::EN_ENVIRONMENT - assert \ - fei0 != fei1, - "feis should not be equal" - end + assert \ + fei0 != fei1, + "feis should not be equal" + end - def test_parse_unparse - fei0 = new_fei() - s = fei0.to_s - fei1 = OpenWFE::FlowExpressionId.to_fei(s) - fei2 = OpenWFE::FlowExpressionId.from_s(s) + def test_parse_unparse + fei0 = new_fei() + s = fei0.to_s + fei1 = OpenWFE::FlowExpressionId.to_fei(s) + fei2 = OpenWFE::FlowExpressionId.from_s(s) - puts "\n#{s}\n#{fei1.to_s}" if fei0 != fei1 + puts "\n#{s}\n#{fei1.to_s}" if fei0 != fei1 - assert_equal fei0, fei1 - assert_equal fei1, fei2 - end + assert_equal fei0, fei1 + assert_equal fei1, fei2 + end - def test_parent_wfid + def test_parent_wfid - fei = new_fei + fei = new_fei - assert \ - fei.parent_workflow_instance_id == "123456", - "failure 0" + assert \ + fei.parent_workflow_instance_id == "123456", + "failure 0" - fei.workflow_instance_id = "123456.0.0" + fei.workflow_instance_id = "123456.0.0" - assert \ - fei.parent_workflow_instance_id == "123456", - "failure 1" - end + assert \ + fei.parent_workflow_instance_id == "123456", + "failure 1" + end - def test_initial_engine_id_deprecation + def test_initial_engine_id_deprecation - s0 = "(fei 0.9.16 this/that http://test/test.xml test 1.0 123456 do-test 0.0)" - s1 = "(fei 0.9.16 this http://test/test.xml test 1.0 123456 do-test 0.0)" + s0 = "(fei 0.9.16 this/that http://test/test.xml test 1.0 123456 do-test 0.0)" + s1 = "(fei 0.9.16 this http://test/test.xml test 1.0 123456 do-test 0.0)" - fei0 = OpenWFE::FlowExpressionId.from_s s0 - fei1 = OpenWFE::FlowExpressionId.from_s s1 + fei0 = OpenWFE::FlowExpressionId.from_s s0 + fei1 = OpenWFE::FlowExpressionId.from_s s1 - assert_equal fei0, fei1 + assert_equal fei0, fei1 - fei0 = OpenWFE::FlowExpressionId.to_fei s0 - fei1 = OpenWFE::FlowExpressionId.to_fei s1 + fei0 = OpenWFE::FlowExpressionId.to_fei s0 + fei1 = OpenWFE::FlowExpressionId.to_fei s1 - assert_equal fei0, fei1 + assert_equal fei0, fei1 - assert_equal s1, fei0.to_s - assert_equal s1, fei1.to_s - end + assert_equal s1, fei0.to_s + assert_equal s1, fei1.to_s + end - def test_web_s + def test_web_s - s1 = "(fei 0.9.16 eng http://test/test.xml test 1.0 123456 do-test 0.0)" - fei1 = OpenWFE::FlowExpressionId.from_s s1 + s1 = "(fei 0.9.16 eng http://test/test.xml test 1.0 123456 do-test 0.0)" + fei1 = OpenWFE::FlowExpressionId.from_s s1 - assert_equal( - [ "123456", "0.0" ], - OpenWFE::FlowExpressionId.split_web_s(fei1.to_web_s)) - end + assert_equal( + [ "123456", "0.0" ], + OpenWFE::FlowExpressionId.split_web_s(fei1.to_web_s)) + end - def test_from_h + def test_from_h - fei = new_fei() - assert_equal fei, OpenWFE::FlowExpressionId.from_h(fei.to_h) - end + fei = new_fei() + assert_equal fei, OpenWFE::FlowExpressionId.from_h(fei.to_h) + end - protected + protected - def puts_hash (h) - puts - h.each do |k, v| - puts " * '#{k.to_debug_s}' --> '#{v}'" - end - puts - end + def puts_hash (h) + puts + h.each do |k, v| + puts " * '#{k.to_debug_s}' --> '#{v}'" + end + puts + end end