Sha256: 1bbb9a0e7b982d5ea34ea1de4d38ad443d125c4d6fe49c9715e9dda2fa96f62a

Contents?: true

Size: 1.77 KB

Versions: 2

Compression:

Stored size: 1.77 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Mon Oct  9 22:19:44 JST 2006
#

require 'openwfe/def'

require 'flowtestbase'

require 'openwfe/expool/journal'



class FlowTest32 < Test::Unit::TestCase
    include FlowTestBase

    #def teardown
    #end

    #def setup
    #end

    #
    # TEST 0

    class TestDefinition0 < ProcessDefinition
        #concurrence do
        sequence do
            #set :variable => "//toto", :value => "nada"
            participant :alpha
            bravo
        end
    end

    #def xxxx_journal_0
    def test_journal_0

        @engine.application_context[:keep_journals] = true

        @engine.init_service("journal", Journal)

        @engine.register_participant(:alpha) do |wi|
            @tracer << "alpha\n"
        end
        @engine.register_participant(:bravo) do |wi|
            @tracer << "bravo\n"
        end

        #fei = dotest(TestDefinition0, "alpha\nbravo")
        fei = dotest(TestDefinition0, "alpha\nbravo", 0.250)

        journal_service = @engine.application_context["journal"]

        fn = journal_service.donedir + "/" + fei.wfid + ".journal"

        #puts journal_service.analyze fn

        #sleep(10)

        assert_equal @engine.get_expression_storage.size, 1

        journal_service.replay fn, 18
            #
            # replay at offset 18 without "refiring"
            #
            # flow waits

        sleep 0.250

        #puts
        #puts @engine.get_expression_storage.to_s
        #puts

        assert_equal @engine.get_expression_storage.size, 6

        journal_service.replay fn, 18, true
            #
            # replay at offset 18 with "refiring"
            #
            # flow resumes

        sleep 0.500

        assert_equal @engine.get_expression_storage.size, 1
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openwferu-0.9.10 test/ft_32_journal.rb
openwferu-0.9.10.653 test/ft_32_journal.rb