Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LocalParticpant : added a reject(workitem) method
- Loading branch information
Showing
5 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# | ||
# testing ruote | ||
# | ||
# Mon Apr 19 14:38:54 JST 2010 | ||
# | ||
# Qcon Tokyo, special day | ||
# | ||
|
||
require File.join(File.dirname(__FILE__), 'base') | ||
|
||
require 'ruote/part/local_participant' | ||
|
||
|
||
class FtParticipantRejectTest < Test::Unit::TestCase | ||
include FunctionalBase | ||
|
||
class DifficultParticipant | ||
include Ruote::LocalParticipant | ||
def initialize (opts) | ||
end | ||
def consume (workitem) | ||
context.tracer << "diff\n" | ||
if workitem.fields['rejected'].nil? | ||
workitem.fields['rejected'] = true | ||
reject(workitem) | ||
else | ||
reply_to_engine(workitem) | ||
end | ||
end | ||
end | ||
|
||
def test_workitems_dispatching_message | ||
|
||
pdef = Ruote.process_definition do | ||
alpha | ||
end | ||
|
||
@engine.register_participant :alpha, DifficultParticipant | ||
|
||
#noisy | ||
|
||
assert_trace(%w[ diff diff ], pdef) | ||
end | ||
end | ||
|