Sha256: fda1aa54535a834bb58090d27f691b6a5c2b48a0ba2323defac4989ecb0bb21c

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

#
# Testing OpenWFEru
#
# John Mettraux at openwfe.org
#

require 'flowtestbase'
require 'openwfe/def'

include OpenWFE



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

    #def setup
    #end

    #def teardown
    #end

    #
    # Test 0
    #

    class TestDefinition0 < ProcessDefinition
        cron :tab => "* * * * *", :name => "cron" do
            participant :cron_event
        end
    end

    #
    # this one tests whether a cron event is removed when his process
    # terminates, as should be.
    #
    def test_0

        log_level_to_debug

        @engine.register_participant(:cron_event) do
            puts "cron_event at #{Time.now.to_s}"
            @tracer << "cron_event"
        end

        #puts "start at #{Time.now.to_s}"
        dotest TestDefinition0, "", 62
    end

    #
    # Test 1
    #

    class TestDefinition1 < ProcessDefinition
        sequence do
            cron :every => "2s", :name => "cron" do
                participant :cron_event
            end
            _sleep "10s"
        end
    end

    def test_1

        #log_level_to_debug

        @engine.register_participant(:cron_event) do
            @tracer << "."
        end

        dotest TestDefinition1, [ "....", "....." ]
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.17 test/ft_21_cron.rb