Sha256: e81c16b67a3e7276a15b1c37bda13a44aa3de3f7c038a2d06cb530a313d9936d

Contents?: true

Size: 942 Bytes

Versions: 1

Compression:

Stored size: 942 Bytes

Contents

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

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


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

  #def setup
  #end

  #def teardown
  #end


  #
  # Test 0
  #

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

  def test_0

    #log_level_to_debug

    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
ruote-0.9.19 test/ft_54b_listen.rb