Sha256: a81f5af83d29b83a74c50e46a442f29f70580622dc86f8e6c379943f3c7b690f

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

#
# Testing Ruote (OpenWFEru)
#
# Wed Jun 10 11:03:26 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


class FtParticipantConsumptionTest < Test::Unit::TestCase
  include FunctionalBase

  def test_workitems_dispatching_message

    pdef = Ruote.process_definition do
      sequence do
        alpha
      end
    end

    @engine.register_participant :alpha do |workitem|
      @tracer << "#{workitem.participant_name}\n"
    end

    #noisy

    assert_trace(pdef, 'alpha')

    Thread.pass
      # making sure the reply to the participant expression is intercepted
      # as well

    assert_equal(
      2, logger.log.select { |e| e['participant_name'] == 'alpha' }.size)
  end

  def test_missing_participant_name

    pdef = Ruote.process_definition do
      sequence do
        participant
      end
    end

    #noisy

    wfid = @engine.launch(pdef)

    wait_for(wfid)

    ps = @engine.process(wfid)

    assert_equal(
      1, ps.errors.size)
    assert_equal(
      '#<ArgumentError: no participant name specified>', ps.errors[0].message)
  end

  def test_dot_star

    pdef = Ruote.process_definition do
      sequence do
        alpha
      end
    end

    @engine.register_participant '.*' do |workitem|
      @tracer << "#{workitem.participant_name} #{workitem.fei.expid}\n"
    end

    assert_trace(pdef, 'alpha 0_0_0')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruote-2.1.3 test/functional/ft_8_participant_consumption.rb
ruote-2.1.2 test/functional/ft_8_participant_consumption.rb
ruote-2.1.1 test/functional/ft_8_participant_consumption.rb