On Fri, Sep 25, 2009 at 4:52 AM, David <[email protected]> wrote: > Thanks for the fast response. Want this regression test for your > ruote 2.0 suite? It is intended to live in test/functional. > > Best, > David > > # > # Testing Ruote (OpenWFEru) > # > # Additional regression tests for concurrencess. > # > require File.join(File.dirname(__FILE__), 'base') > > class Eft6aConcurrenceTest < Test::Unit::TestCase > include FunctionalBase > > def test_equal_time_favors_first > self.run_engine > assert_equal 'first', @tracer.to_s > end > > def test_second_is_faster > self.run_engine :first_time => 1.0 > assert_equal 'second', @tracer.to_s > end > > def test_first_is_faster > self.run_engine :second_time => 1.0 > assert_equal 'first', @tracer.to_s > end > > protected > > def run_engine(options={}) > �...@first_time = options[:first_time] || 0.0 > �...@second_time = options[:second_time] || 0.0 > �...@pdef = Ruote.process_definition :name => 'simple' do > sequence do > concurrence do # spec says this is equivalent to :count => 1 > participant :ref => 'first' > participant :ref => 'second' > end > participant :ref => 'trace' > end > end > > �[email protected]_participant :first do |wi| > sleep @first_time > wi.fields['result'] = 'first' > end > > �[email protected]_participant :second do |wi| > sleep @second_time > wi.fields['result'] = 'second' > end > > �[email protected]_participant :trace do |wi| > �...@tracer << "#{wi.fields['result']}" > end > > �...@wfid = @engine.launch(@pdef, :fields => {}) > �...@outcome = @engine.wait_for(@wfid) > end > end
Thanks, I will adapt it. Please try to reply to the list so that the conversation stays open. Best regards, -- John Mettraux - http://jmettraux.wordpress.com --~--~---------~--~----~------------~-------~--~----~ you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en -~----------~----~----~----~------~----~------~--~---
