Sha256: c7a6a38036f717e31ffb6a05d7607e6ed96df2ea1ff395696d91c7ebefab5645

Contents?: true

Size: 1.81 KB

Versions: 3

Compression:

Stored size: 1.81 KB

Contents

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

require 'openwfe/def'
require 'openwfe/worklist/storeparticipant'

require 'flowtestbase'


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

    #def teardown
    #end

    #def setup
    #end

    #
    # TEST 0

    class TestDefinition0 < ProcessDefinition
        def make
            _process_definition :name => "27_gfp", :revision => "0" do
                _sequence do
                    store_p
                end
            end
        end
    end

    #def xxxx_gfp_0
    def test_gfp_0

        #sp = @engine.register_participant("store_p", OpenWFE::YamlParticipant)
        sp = @engine.register_participant("store_p", OpenWFE::HashParticipant)

        fei = @engine.launch(TestDefinition0)

        l = @engine.get_expression_pool.get_flow_position(fei.wfid)

        #print_exp_list(l)

        assert \
            l.size == 3, 
            "get_flow_position() returned #{l.size} elements"

        wi = sp.first_workitem

        sp.forward(wi)

        assert_equal sp.size, 0
    end


    #def xxxx_gfp_0b
    def test_gfp_0b

        sp = @engine.register_participant("store_p", OpenWFE::YamlParticipant)

        fei = @engine.launch(TestDefinition0)

        l = @engine.get_flow_position(fei.wfid)
            #
            # shortcut version

        #print_exp_list l

        assert_equal l.size, 3

        l = @engine.list_processes()
        assert_equal l.size, 1

        l = @engine.list_processes(false, "nada")
        assert_equal l.size, 0

        l = @engine.list_workflows(false, fei.wfid[0, 3])
        assert_equal l.size, 1

        #
        # resume flow and terminate it

        wi = sp.first_workitem

        assert wi

        sp.forward(wi)

        assert_equal sp.size, 0
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openwferu-0.9.7 test/ft_27_getflowpos.rb
openwferu-0.9.8 test/ft_27_getflowpos.rb
openwferu-0.9.9 test/ft_27_getflowpos.rb