Sha256: a3f471c546450bb1ec81e77758833a44a52d9687899bd2d75f52f629a83ac952

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

#
# testing ruote
#
# Fri May 15 09:51:28 JST 2009
#

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

require 'ruote/part/null_participant'


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

  def test_launch_terminate

    #noisy

    pdef = Ruote.process_definition do
    end

    assert_trace '', pdef

    #puts; logger.log.each { |e| p e }; puts
    assert_equal %w[ launch terminated ], logger.log.map { |e| e['action'] }
  end

  def test_stop_worker

    sleep 0.010 # warm up time

    assert_equal true, @engine.context.worker.running

    @engine.shutdown

    assert_equal false, @engine.context.worker.running

    pdef = Ruote.process_definition do; end

    @engine.launch(pdef)

    Thread.pass

    assert_equal 1, @engine.storage.get_many('msgs').size
  end

  def test_remaining_messages

    @engine.register_participant :alfred, Ruote::NullParticipant

    pdef = Ruote.process_definition do
    end

    assert_trace '', pdef

    sleep 0.300

    assert_equal [], @engine.storage.get_msgs
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruote-2.2.0 test/functional/ft_0_worker.rb
ruote-2.1.11 test/functional/ft_0_worker.rb
ruote-2.1.10 test/functional/ft_0_worker.rb
ruote-2.1.9 test/functional/ft_0_worker.rb
ruote-2.1.8 test/functional/ft_0_worker.rb