Sha256: 2ecf39c428a25315e12a60a166d50b4c9e857b990d47960666e6628adc75e06a

Contents?: true

Size: 808 Bytes

Versions: 1

Compression:

Stored size: 808 Bytes

Contents

#
# testing ruote
#
# Tue Apr 26 03:30:29 JST 2011
#
# between Changi and Haneda (JA622A)
#

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


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

  def test_workitems_dispatching_message

    pdef = Ruote.process_definition do
      set 'v:alpha' => '''
        def consume(wi)
          context.tracer << "#{wi.participant_name}\n"
        end
        def cancel(fei, flavour)
          context.tracer << "cancelled\n"
        end
      '''
      alpha
    end

    #@engine.noisy = true

    wfid = @engine.launch(pdef)

    @engine.wait_for(:alpha)
    @engine.wait_for(1)

    assert_equal 'alpha', @tracer.to_s

    @engine.cancel(wfid)
    @engine.wait_for(wfid)

    assert_equal "alpha\ncancelled", @tracer.to_s
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-maestrodev-2.2.1 test/functional/ft_60_code_participant.rb