Sha256: 9ebdca206d4d6bd741c5806b64abe5957c7fb5ab17a646e64a0075c48d2d7f35

Contents?: true

Size: 1.11 KB

Versions: 13

Compression:

Stored size: 1.11 KB

Contents

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

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

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

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

    #noisy

    wfid = @engine.launch(pdef)

    wait_for(3)

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

    @engine.shutdown

    # restart...

    start_new_engine

    #noisy

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

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

    @engine.cancel_process(wfid)

    wait_for(wfid)

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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/functional/rt_5_timeout.rb
ruote-2.2.0 test/functional/rt_5_timeout.rb
ruote-2.1.11 test/functional/rt_5_timeout.rb
ruote-2.1.10 test/functional/rt_5_timeout.rb
ruote-2.1.9 test/functional/rt_5_timeout.rb
ruote-2.1.8 test/functional/rt_5_timeout.rb
ruote-2.1.7 test/functional/rt_5_timeout.rb
ruote-2.1.6 test/functional/rt_5_timeout.rb
ruote-2.1.5 test/functional/rt_5_timeout.rb
ruote-2.1.4 test/functional/rt_5_timeout.rb
ruote-2.1.3 test/functional/rt_5_timeout.rb
ruote-2.1.2 test/functional/rt_5_timeout.rb
ruote-2.1.1 test/functional/rt_5_timeout.rb