test/functional/restart_base.rb in ruote-0.9.20 vs test/functional/restart_base.rb in ruote-2.1.1

- old
+ new

@@ -1,43 +1,34 @@ # -# Testing Ruote (OpenWFEru) +# testing ruote # -# John Mettraux at openwfe.org +# Wed Jul 1 23:27:49 JST 2009 # -# Wed Feb 4 10:16:34 JST 2009 -# -require 'openwfe/engine' - -$in_memory_engine = false - module RestartBase - def in_memory_engine + def setup + @tracer = Tracer.new + end - return true if $in_memory_engine - return false unless @engine.class == OpenWFE::Engine + def teardown + @engine.shutdown + @storage.purge! + end - $in_memory_engine = true + protected - puts - puts " skipping restart (rft_) tests : in-memory engine" - puts + def start_new_engine - true - end + @storage = determine_storage( + 's_logger' => [ 'ruote/log/test_logger', 'Ruote::TestLogger' ], + :persistent => true) - def restart_engine + @engine = Ruote::Engine.new(Ruote::Worker.new(@storage)) - ac = { - '__tracer' => @tracer, - :persist_as_yaml => @engine.ac[:persist_as_yaml], - :no_expstorage_cache => @engine.ac[:no_expstorage_cache] - } + #@tracer.clear - @engine = @engine.class.new(ac) - - @engine.reload # very important + @engine.add_service('tracer', @tracer) end end