Sha256: 9bceaeedb34c59d06813fa252056ee92ba556a373e92719514f241dfd6e380be

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Sun Oct 29 15:41:44 JST 2006
#
# somewhere between Philippina and the Japan
#

require 'test/unit'

#require 'openwfe/workitem'
require 'openwfe/engine/engine'
require 'openwfe/expressions/raw_prog'
require 'openwfe/worklist/storeparticipant'

require 'rutest_utils'

include OpenWFE


class TimeoutTest < Test::Unit::TestCase

    #def setup
    #    @engine = $WORKFLOW_ENGINE_CLASS.new()
    #end

    #def teardown
    #end

    class TimeoutDefinition0 < ProcessDefinition
        def make
            process_definition :name => "to0", :revision => "0" do
                sequence do
                    participant :ref => "albert", :timeout => "500"
                    _print "over"
                end
            end
        end
    end

    def test_timeout_0

        albert = HashParticipant.new

        engine = Engine.new

        engine.application_context["__tracer"] = Tracer.new

        engine.register_participant(:albert, albert)

        li = LaunchItem.new(TimeoutDefinition0)

        engine.launch(li)

        sleep(2)

        s = engine.application_context["__tracer"].to_s

        #puts "trace is >#{s}<"
        #puts "albert.size is #{albert.size}"

        assert \
            albert.size == 0,
            "workitem was not removed from workitem store"
        assert \
            s == "over",
            "flow did not reacher 'over'"
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.3 test/timeout_test.rb