Sha256: f9012f2465fa48fe856abf6f953d31df0002d0a5f3e6f84587d9429146bae956

Contents?: true

Size: 1.7 KB

Versions: 11

Compression:

Stored size: 1.7 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Tue Jan  2 13:14:37 JST 2007
#

require 'flowtestbase'
require 'openwfe/expressions/raw_prog'


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

    #def setup
    #end

    #def teardown
    #end


    #
    # Test 0
    #

    class BpDef0 < OpenWFE::ProcessDefinition
        def make
            process_definition :name => "test0", :revision => "0" do
                sequence do
                    participant :ref => "block-participant"
                    _print "done."
                end
            end
        end
    end

    def test_bp_0
        dotest(
            BpDef0,
            """the block participant received a workitem
done.""")
    end


    #
    # Test 1
    #

    class BpDef1 < OpenWFE::ProcessDefinition
        def make
            process_definition :name => "test1", :revision => "0" do
                bp1a
            end
        end
    end

    def test_bp_1

        @engine.register_participant("bp1a") do |fexp, wi|
            @tracer << "bp1a : "
            @tracer << fexp.class.name
            @tracer << "\n"
        end

        dotest(
            BpDef1,
            """bp1a : OpenWFE::ParticipantExpression""")
    end


    #
    # Test 2
    #

    class BpDef2 < OpenWFE::ProcessDefinition
        sequence do
            bp
            _print "${f:__result__}"
        end
    end

    def test_bp_2

        @engine.register_participant("bp") do |fexp, wi|
            "a string result"
                #
                # the 'return' value of a block participant is stored
                # in the "__result__" field of the workitem
        end

        dotest(BpDef2, "a string result")
    end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
openwferu-0.9.10 test/ft_12_blockparticipant.rb
openwferu-0.9.10.653 test/ft_12_blockparticipant.rb
openwferu-0.9.11 test/ft_12_blockparticipant.rb
openwferu-0.9.12 test/ft_12_blockparticipant.rb
openwferu-0.9.12.863 test/ft_12_blockparticipant.rb
openwferu-0.9.13 test/ft_12_blockparticipant.rb
openwferu-0.9.14 test/ft_12_blockparticipant.rb
openwferu-0.9.15 test/ft_12_blockparticipant.rb
openwferu-0.9.16 test/ft_12_blockparticipant.rb
openwferu-0.9.8 test/ft_12_blockparticipant.rb
openwferu-0.9.9 test/ft_12_blockparticipant.rb