Sha256: c614bd57c660462ba40648ca6b7688c0a9d128158a4a9c91351253aeeb09d5b8

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

#
# testing ruote
#
# Wed Oct 28 14:51:07 JST 2009
#

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

require 'ruote/part/null_participant'


class RtTimeoutTest < Test::Unit::TestCase
  include FunctionalBase
  include RestartBase

  # Vanilla case, no need to reload.
  #
  def test_restart

    start_new_engine

    pdef = Ruote.process_definition :name => 'test' do
      participant 'alpha', :timeout => '2d'
    end

    @dashboard.register_participant 'alpha', Ruote::NullParticipant

    #noisy

    wfid = @dashboard.launch(pdef)

    wait_for(3)

    assert_equal 1, @dashboard.processes.size
    assert_equal 1, @dashboard.storage.get_many('schedules').size

    @dashboard.shutdown

    # restart...

    start_new_engine

    #noisy

    @dashboard.register_participant 'alpha', Ruote::NullParticipant

    assert_equal 1, @dashboard.processes.size
    assert_equal 1, @dashboard.storage.get_many('schedules').size

    @dashboard.cancel_process(wfid)

    wait_for(wfid)

    assert_equal 0, @dashboard.processes.size
    assert_equal 0, @dashboard.storage.get_many('schedules').size
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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