Sha256: b72c3cf62cafc5b02994ed160400ec6827935f6fc31e483f3c20d68bdf2d3d0f

Contents?: true

Size: 1.45 KB

Versions: 2

Compression:

Stored size: 1.45 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Mon Jul  9 10:25:18 JST 2007
#

require 'openwfe/def'
require 'flowtestbase'


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

    #def teardown
    #end

    #def setup
    #end

    #
    # TEST 0

    class TestDefinition0 < ProcessDefinition
        sequence do
            _print "a"
            sequence do
                _print "b.0"
                _sleep "1s"
                _print "b.1"
            end
            _print "c"
        end
    end

    def test_0

        #$OWFE_LOG.level = Logger::DEBUG

        fei = @engine.launch TestDefinition0

        sleep 0.200

        #puts
        #puts @engine.get_process_stack fei.wfid
        #puts

        fei.expression_id = "0.0.1"
        fei.expression_name = "sequence"
        @engine.cancel_expression fei

        sleep 0.200

        assert_equal @tracer.to_s, "a\nb.0\nc"

        assert_equal @engine.get_process_stack(fei.wfid).size, 0

        #$OWFE_LOG.level = Logger::INFO
    end

    def test_1

        #$OWFE_LOG.level = Logger::DEBUG

        fei = @engine.launch TestDefinition0

        sleep 0.200

        fei.expression_id = "0.0.1.2"
        fei.expression_name = "print"
        @engine.cancel_expression fei

        @engine.wait_for(fei.wfid)

        assert_equal @tracer.to_s, "a\nb.0\nc"

        assert_equal @engine.get_process_stack(fei.wfid).size, 0

        #$OWFE_LOG.level = Logger::INFO
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openwferu-0.9.14 test/ft_60_ecancel.rb
openwferu-0.9.15 test/ft_60_ecancel.rb