Sha256: 953536d3ac8afa42916731f748915db978c948739b0584125ba924f43f798857

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

#
# Testing OpenWFEru
#
# John Mettraux at openwfe.org
#

require 'flowtestbase'
require 'openwfe/def'

include OpenWFE



class FlowTest23c < Test::Unit::TestCase
    include FlowTestBase

    #def setup
    #end

    #def teardown
    #end

    #
    # Test 0
    #

    class Wait0c < ProcessDefinition
        sequence do
            concurrence do
                sequence do
                    wait :until => "${done} == true", :frequency => "2s"
                    _print "after wait"
                end
                sequence do
                    _sleep "1s"
                    _print "before done"
                    _set :variable => "done", :value => "true"
                end
            end
            _print "over"
        end
    end

    def test_0
        dotest(
            Wait0c, 
            """
before done
after wait
over
            """.strip, 
            3)
    end

    #
    # Test 1
    #

    class Wait1c < ProcessDefinition
        sequence do
            concurrence do
                sequence do
                    wait :frequency => "2s" do
                        equals :variable_value => "done", :other_value => "true"
                    end
                    _print "after when"
                end
                sequence do
                    _sleep "1s"
                    _print "before done"
                    _set :variable => "done", :value => "true"
                end
            end
            _print "over"
        end
    end

    def test_1
        dotest(
            Wait1c, 
            """
before done
after when
over
            """.strip, 
            4)
    end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
openwferu-0.9.11 test/ft_23c_wait.rb
openwferu-0.9.12 test/ft_23c_wait.rb
openwferu-0.9.12.863 test/ft_23c_wait.rb
openwferu-0.9.13 test/ft_23c_wait.rb
openwferu-0.9.14 test/ft_23c_wait.rb
openwferu-0.9.15 test/ft_23c_wait.rb