Sha256: 674fbb882423e6eb2c5c736dd1a93cebb00d012d38a285063a9fc3b027eb9d8c

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

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

require 'flowtestbase'
require 'openwfe/def'
require 'openwfe/participants/participants'

include OpenWFE


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

    #def setup
    #end

    #def teardown
    #end


    #
    # Test 0
    #

    class Test0 < ProcessDefinition
        sequence do
            listen :to => "^channel_.$", :upon => :reply
            _print "ok"
        end
    end

    def test_0

        #log_level_to_debug

        @engine.launch Test0

        sleep 0.350

        assert_equal @tracer.to_s, ""

        wi = OpenWFE::InFlowWorkItem.new
        wi.participant_name = "channel_z"

        r = @engine.reply wi
        assert r

        sleep 0.350

        #
        # "post test", checking that engine replies 'false' when
        # nobody consumed the message

        assert_equal @tracer.to_s, "ok"

        wi = OpenWFE::InFlowWorkItem.new
        wi.participant_name = "channel_unknown"

        r = @engine.reply wi
        assert (not r)
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.17 test/ft_54b_listen.rb