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

- old
+ new

@@ -8,119 +8,126 @@ require 'flowtestbase' require 'openwfe/def' class FlowTest49 < Test::Unit::TestCase - include FlowTestBase + include FlowTestBase - #def setup - #end + #def setup + #end - #def teardown - #end + #def teardown + #end - # - # Test 0 - # + # + # Test 0 + # - class TestCondition49a0 < OpenWFE::ProcessDefinition - sequence do - _if :test => "false" - _print "0 ${f:__result__}" - _if :test => "true; false" - _print "1 ${f:__result__}" - _if :test => "false; true" - _print "2 ${f:__result__}" - #_if :test => "print ''; true" - _if :test => "''; true" - _print "3 ${f:__result__}" - #_if :test => "begin print ''; end; true" - _if :test => "begin ''; end; true" - _print "4 ${f:__result__}" + class TestCondition49a0 < OpenWFE::ProcessDefinition + sequence do - unset :field => "__result__" + _if :test => "false" + _print "0 ${f:__result__}" - _if :test => "true == " - _print "5 ${f:__result__}" - _if :test => " == true" - _print "6 ${f:__result__}" - end - end + _if :test => "true; false" + _print "1 ${f:__result__}" - def test_0 + _if :test => "false; true" + _print "2 ${f:__result__}" - dotest( - TestCondition49a0, - [ "0 false", - "1 false", - "2 true", - "3 true", - "4 true", - "5 false", - "6 false" ].join("\n")) - end + #_if :test => "print ''; true" + _if :test => "''; true" + _print "3 ${f:__result__}" + #_if :test => "begin print ''; end; true" + _if :test => "begin ''; end; true" + _print "4 ${f:__result__}" - # - # Test 1 - # + unset :field => "__result__" - class TestCondition49a1 < OpenWFE::ProcessDefinition - sequence do - _if :test => "true and false and false" - _print "0 ${f:__result__}" - _if :rtest => "true and true and true" - _print "1 ${f:__result__}" - _if :rtest => "false or false or true" - _print "2 ${f:__result__}" - end + _if :test => "true == " + _print "5 ${f:__result__}" + _if :test => " == true" + _print "6 ${f:__result__}" end + end - def test_1 + def test_0 - dotest( - TestCondition49a1, - [ "0 false", "1 true", "2 true" ].join("\n")) + log_level_to_debug + + dotest( + TestCondition49a0, + [ "0 false", + "1 true", + "2 true", + "3 true", + "4 true", + "5 false", + "6 false" ].join("\n")) + end + + + # + # Test 1 + # + + class TestCondition49a1 < OpenWFE::ProcessDefinition + sequence do + _if :test => "true and false and false" + _print "0 ${f:__result__}" + _if :rtest => "true and true and true" + _print "1 ${f:__result__}" + _if :rtest => "false or false or true" + _print "2 ${f:__result__}" end + end + def test_1 - # - # Test 2 - # + dotest( + TestCondition49a1, + [ "0 false", "1 true", "2 true" ].join("\n")) + end - class TestCondition49a2 < OpenWFE::ProcessDefinition - sequence do - _if :test => "true" - _print "0 ${f:__result__}" - _if :not => "false" - _print "1 ${f:__result__}" - _if :rnot => "1 > 3" - _print "2 ${f:__result__}" - unset :field => "__result__" + # + # Test 2 + # - _if :rnot => "1 > -1" - _print "3 ${f:__result__}" + class TestCondition49a2 < OpenWFE::ProcessDefinition + sequence do + _if :test => "true" + _print "0 ${f:__result__}" + _if :not => "false" + _print "1 ${f:__result__}" + _if :rnot => "1 > 3" + _print "2 ${f:__result__}" - _if :rtest => "workitem.is_a?(String)" - _print "4 ${f:__result__}" + unset :field => "__result__" - _if :rtest => "wi.is_a?(InFlowWorkItem)" - _print "5 ${f:__result__}" - end - end + _if :rnot => "1 > -1" + _print "3 ${f:__result__}" - def test_2 + _if :rtest => "workitem.is_a?(String)" + _print "4 ${f:__result__}" - dotest( - TestCondition49a2, - [ "0 true", - "1 true", - "2 true", - "3 false", - "4 false", - "5 true" ].join("\n")) + _if :rtest => "wi.is_a?(InFlowWorkItem)" + _print "5 ${f:__result__}" end + end + + def test_2 + + dotest( + TestCondition49a2, + [ "0 true", + "1 true", + "2 true", + "3 false", + "4 false", + "5 true" ].join("\n")) + end end