Sha256: aea155496df09c32a0cab9b8cbfc6579ec134c2930abba96a2bc82ac1bf4850e

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

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

require 'flowtestbase'
require 'openwfe/def'


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

    #def setup
    #end

    #def teardown
    #end


    #
    # Test 0
    #

    class Test0 < OpenWFE::ProcessDefinition
        sequence do
            concurrence :merge_type => :isolate do
                set :field => "y", :value => "y0"
                set :field => "y", :value => "y1"
                set :field => "y", :value => "y2"
            end
            catcher
        end
    end

    def test_0

        do_the_test Test0
    end

    #
    # Test 1
    #

    class Test1 < OpenWFE::ProcessDefinition
        sequence do
            concurrent_iterator(
                :on_value => "0, 1, 2", 
                :to_field => "f", 
                :merge_type => :isolate
            ) do
                set :field => "y", :value => "y${f:f}"
            end
            catcher
        end
    end

    def test_1
        do_the_test Test1
    end

    protected

        def do_the_test (definition)

            #log_level_to_debug
            
            workitem = nil

            engine.register_participant :catcher do |wi|
                workitem = wi
            end

            dotest definition, ""

            #puts
            #puts workitem.to_s

            3.times do |i|
                assert_equal "y#{i}", workitem.lookup_attribute("#{i}.y")
            end
                #
                # 3 lines replaced by 3 lines :)
        end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.18 test/ft_76_merge_isolate.rb