test/flowtestbase.rb in openwferu-0.9.9 vs test/flowtestbase.rb in openwferu-0.9.10

- old
+ new

@@ -18,28 +18,30 @@ require 'rutest_utils' include OpenWFE +#$SLEEP_TIME = 0.100 $WORKFLOW_ENGINE_CLASS = Engine persistence = ENV["__persistence__"] require "openwfe/engine/file_persisted_engine" if persistence if persistence == "pure-persistence" + #$SLEEP_TIME = 0.999 $WORKFLOW_ENGINE_CLASS = FilePersistedEngine elsif persistence == "cached-persistence" + #$SLEEP_TIME = 0.250 $WORKFLOW_ENGINE_CLASS = CachedFilePersistedEngine end puts puts "testing with engine of class " + $WORKFLOW_ENGINE_CLASS.to_s puts -#class FlowTestBase < Test::Unit::TestCase module FlowTestBase attr_reader \ :engine, :tracer @@ -84,14 +86,10 @@ def teardown @engine.stop if @engine end - #def default_test () - # assert true - #end - protected def print_exp_list (l) puts l.each do |fexp| @@ -121,17 +119,32 @@ OpenWFE::LaunchItem.new(flowDef) end fei = @engine.launch(li) - #sleep(sleep_time) - @engine.get_scheduler.join_until_no_more_jobs if join + #if join == true + # @engine.get_scheduler.join_until_no_more_jobs + #elsif join.is_a?(Numeric) + # sleep join + #end + #if join.is_a?(Numeric) + # sleep join + #elsif join == true + # @engine.wait_for_engine + #else + # sleep $SLEEP_TIME + #end + if join.is_a?(Numeric) + sleep join + else + @engine.wait_for fei + end trace = @tracer.to_s #puts "...'#{trace}' ?= '#{expectedTrace}'" - if expectedTrace.kind_of? [].class + if expectedTrace.kind_of?(Array) result = false expectedTrace.each do |etrace| result = (result or (trace == etrace)) end