| CODENOTIFIER | HelpYou are not signed inSign in |
Project: OpenWFEru
Revision: 1651
Author: jmettraux
Date: 08 Apr 2008 02:31:18
Changes:todo #19191 : added cancel tests for each of the tlaunch enabled expressions
Files:| ... | ...@@ -45,4 +45,5 @@ | |
| 45 | 45 | require 'ft_23b_when' |
| 46 | 46 | require 'ft_23c_wait' |
| 47 | require 'ft_23d_cww' | |
| 47 | 48 | require 'ft_24_def' |
| 48 | 49 | require 'ft_25_cancel' |
| ... | ...@@ -0,0 +1,58 @@ | |
| 1 | ||
| 2 | # | |
| 3 | # Testing OpenWFEru | |
| 4 | # | |
| 5 | # John Mettraux at openwfe.org | |
| 6 | # | |
| 7 | # Tue Apr 8 12:59:05 JST 2008 | |
| 8 | # | |
| 9 | ||
| 10 | require 'flowtestbase' | |
| 11 | require 'openwfe/def' | |
| 12 | ||
| 13 | ||
| 14 | class FlowTest23d < Test::Unit::TestCase | |
| 15 | include FlowTestBase | |
| 16 | ||
| 17 | #def setup | |
| 18 | #end | |
| 19 | ||
| 20 | #def teardown | |
| 21 | #end | |
| 22 | ||
| 23 | # | |
| 24 | # Test 0 | |
| 25 | # | |
| 26 | ||
| 27 | class Test0 < OpenWFE::ProcessDefinition | |
| 28 | concurrence do | |
| 29 | _when :test => "false == true", :timeout => "1s500" do | |
| 30 | _print "la vaca vuela" | |
| 31 | end | |
| 32 | _print "ok" | |
| 33 | end | |
| 34 | end | |
| 35 | ||
| 36 | # | |
| 37 | # Testing if the conditional _when got correctly unscheduled. | |
| 38 | # | |
| 39 | def test_0 | |
| 40 | ||
| 41 | #log_level_to_debug | |
| 42 | ||
| 43 | fei = @engine.launch Test0 | |
| 44 | ||
| 45 | sleep 0.350 | |
| 46 | ||
| 47 | #puts @engine.get_expression_storage | |
| 48 | assert_equal 6, @engine.get_expression_storage.size | |
| 49 | ||
| 50 | @engine.cancel_process fei | |
| 51 | ||
| 52 | sleep 0.350 | |
| 53 | ||
| 54 | assert_equal 1, @engine.get_expression_storage.size | |
| 55 | end | |
| 56 | ||
| 57 | end | |
| 58 |
| ... | ...@@ -0,0 +1,68 @@ | |
| 1 | ||
| 2 | # | |
| 3 | # Testing OpenWFE | |
| 4 | # | |
| 5 | # John Mettraux at openwfe.org | |
| 6 | # | |
| 7 | # Tue Apr 8 12:24:27 JST 2008 | |
| 8 | # | |
| 9 | ||
| 10 | require 'rubygems' | |
| 11 | ||
| 12 | require 'openwfe/def' | |
| 13 | require 'flowtestbase' | |
| 14 | ||
| 15 | ||
| 16 | class FlowTest14c < Test::Unit::TestCase | |
| 17 | include FlowTestBase | |
| 18 | ||
| 19 | #def setup | |
| 20 | #end | |
| 21 | ||
| 22 | #def teardown | |
| 23 | #end | |
| 24 | ||
| 25 | ||
| 26 | # | |
| 27 | # TEST 0 | |
| 28 | ||
| 29 | class Test0 < OpenWFE::ProcessDefinition | |
| 30 | sequence do | |
| 31 | sub0 :forget => true | |
| 32 | sub0 :forget => true | |
| 33 | end | |
| 34 | process_definition :name => "sub0" do | |
| 35 | _print "${r:fei.wfid[-2..-1]}" | |
| 36 | end | |
| 37 | end | |
| 38 | ||
| 39 | def test_0 | |
| 40 | ||
| 41 | #log_level_to_debug | |
| 42 | ||
| 43 | dotest Test0, ".0\n.1", 0.750 | |
| 44 | end | |
| 45 | ||
| 46 | ||
| 47 | # | |
| 48 | # TEST 1 | |
| 49 | ||
| 50 | class Test1 < OpenWFE::ProcessDefinition | |
| 51 | sequence do | |
| 52 | sub0 :forget => true | |
| 53 | sub0 | |
| 54 | end | |
| 55 | process_definition :name => "sub0" do | |
| 56 | _print "${r:fei.wfid[-2..-1]}" | |
| 57 | end | |
| 58 | end | |
| 59 | ||
| 60 | def test_1 | |
| 61 | ||
| 62 | #log_level_to_debug | |
| 63 | ||
| 64 | dotest Test1, ".0\n.1", 0.750 | |
| 65 | end | |
| 66 | ||
| 67 | end | |
| 68 |