Sha256: ba04a6cfcb0b42e16f84a701c4aff6821d027efd07dad0b85a2068367412ce4e

Contents?: true

Size: 1.45 KB

Versions: 1

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.300

        #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.300

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

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

        #$OWFE_LOG.level = Logger::INFO
    end

    def test_1

        #$OWFE_LOG.level = Logger::DEBUG

        fei = @engine.launch TestDefinition0

        sleep 0.300

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

        @engine.wait_for(fei.wfid)

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

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

        #$OWFE_LOG.level = Logger::INFO
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.16 test/ft_60_ecancel.rb