Sha256: f50c172321bc72af7c89ba761ca3f1baccdc9dc4c535b36dd207bc5c6c3bbb72

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

        assert_equal @tracer.to_s, ""

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

        r = @engine.reply wi
        assert r

        sleep 0.200

        #
        # "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.16 test/ft_54b_listen.rb