Sha256: 32f0a3c101e8d154f1ccdd20811add907618103005fae121f8403e170a1b4cf0

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

#
# testing ruote
#
# Sun Jun 14 13:33:17 JST 2009
#

require File.expand_path('../base', __FILE__)


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

  def test_basic

    pdef = Ruote.process_definition do
      sequence do
        forget do
          alpha
        end
        alpha
      end
    end

    @dashboard.register_participant :alpha do
      tracer << "alpha\n"
    end

    wfid = @dashboard.launch(pdef)

    wait_for(:alpha)
    wait_for(:alpha)
    wait_for(wfid)
    wait_for(wfid)

    assert_equal "alpha\nalpha", @tracer.to_s

    assert_equal 1, logger.log.select { |e| e['action'] == 'ceased' }.size
    assert_equal 1, logger.log.select { |e| e['action'] == 'terminated' }.size
  end

  def test_multi

    pdef = Ruote.define do
      forget do
        alpha
        bravo
      end
      charly
    end

    @dashboard.register_participant '.+' do |wi|
      context.tracer << wi.participant_name + "\n"
    end

    wfid = @dashboard.launch(pdef)

    3.times { @dashboard.wait_for('dispatched') }

    assert_equal %w[ alpha bravo charly ], @tracer.to_a.sort
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruote-2.3.0.3 test/functional/eft_7_forget.rb
ruote-2.3.0.2 test/functional/eft_7_forget.rb
ruote-2.3.0.1 test/functional/eft_7_forget.rb
ruote-2.3.0 test/functional/eft_7_forget.rb