Sha256: 420cbd00b2f95bcab96268f00a8bd0ff73fd7ae767c87d0b557e0a32f4d5d871
Contents?: true
Size: 1.18 KB
Versions: 2
Compression:
Stored size: 1.18 KB
Contents
# # testing ruote # # Mon Jun 14 12:02:53 JST 2010 # require File.join(File.dirname(__FILE__), 'base') require 'ruote/part/local_participant' class FtMiscParticipantTest < Test::Unit::TestCase include FunctionalBase class MyParticipant include Ruote::LocalParticipant def consume (workitem) workitem.fields['seen'] = true reply_to_engine(workitem) end end class MyMessageParticipant include Ruote::LocalParticipant def initialize (opts) @opts = opts end def consume (workitem) workitem.fields['message'] = @opts['message'] reply_to_engine(workitem) end end def test_participant_without_initialize @engine.register_participant :alpha, MyParticipant #noisy wfid = @engine.launch(Ruote.process_definition do alpha end) r = wait_for(wfid) assert_equal true, r['workitem']['fields']['seen'] end def test_participant_with_initialize @engine.register_participant :bravo, MyMessageParticipant, 'message' => 'hi' #noisy wfid = @engine.launch(Ruote.process_definition do bravo end) r = wait_for(wfid) assert_equal 'hi', r['workitem']['fields']['message'] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruote-2.1.11 | test/functional/ft_41_participants.rb |
ruote-2.1.10 | test/functional/ft_41_participants.rb |