On May 27, 6:38 pm, John Mettraux <[email protected]> wrote:
> The TestLogger keeps track of seen messages, it's more reliable, for cases 
> when the engine is faster than the wait_for() order. The symptom of "engine 
> faster than wait_for()" is simply the wait_for() never returning since the 
> message it's waiting for is gone.

Thanks, this actually solved my problem. I have this now:

----8<----
module ProcessSpecHelper
  def stub_hash_storage
    storage =
Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new('s_logger'
=> ['ruote/log/test_logger', 'Ruote::TestLogger'])))
    storage.add_service('history', 'ruote/log/storage_history',
'Ruote::StorageHistory')
    part = Ruote::StorageParticipant.new(storage)
    Workflow.stub!(:engine).and_return(storage)
    Workflow.stub!(:workitems).and_return(part)
    Participants.register_all
  end

  def wait_for identifier
    Workflow.engine.wait_for identifier
  end
end
---->8----

... which of course assumes Workflow::engine and Workflow::workitems
(which are quite simple). I had initially tried using one HashStorage
across multiple tests, but clearing the processes became problematic,
and I found that it wasn't too expensive to create a new HashStorage
for every test (this is called in before(:each), usually).

However, this introduces a problem in that my specs run on a different
engine than is used in production. For this reason, I've left my
integration tests (cucumber) using sleep. It's not as big of a problem
there because the tests are less granular requiring less sleeping.

Thanks for your help with this.

-- 
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

Reply via email to