Sha256: ef3f8703b3dab38fa21726a11ffb266054a36524fb6764c106324d15d02b2a1f

Contents?: true

Size: 1.89 KB

Versions: 13

Compression:

Stored size: 1.89 KB

Contents

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

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

require 'flowtestbase'


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

    #def teardown
    #end

    def setup
        super
        @engine.ac[:remote_definitions_allowed] = true
    end

    DEFHOST = "http://openwferu.rubyforge.org/defs"

    #
    # TEST 0

    #def xxxx_httprb_0
    def test_httprb_0

        li = OpenWFE::LaunchItem.new
        li.wfdurl = "#{DEFHOST}/testdef.rb"

        dotest(
            li, 
            """a
b
c""")
    end


    #
    # TEST 1

    class MainDefinition1 < OpenWFE::ProcessDefinition
        def make
            sequence do
                _print "A"
                subprocess :ref => "#{DEFHOST}/testdef.rb"
                _print "C"
            end
        end
    end

    #def xxxx_httprb_1
    def test_httprb_1
        dotest(
            MainDefinition1, 
            """A
a
b
c
C""")
    end


    #
    # TEST 2

    class MainDefinition2 < OpenWFE::ProcessDefinition
        def make
            sequence do
                _print "-1"
                subprocess :ref => "#{DEFHOST}/testdef.xml"
                _print "3"
            end
        end
    end

    #def xxxx_httprb_2
    def test_httprb_2
        dotest(
            MainDefinition2, 
            """-1
0
1
2
3""")
    end


    #
    # TEST 3

    #def xxxx_httprb_3
    def test_httprb_3

        @engine.ac.delete(:remote_definitions_allowed)
            #
            # relocking

        li = OpenWFE::LaunchItem.new
        li.wfdurl = "#{DEFHOST}/testdef.rb"

        e = nil

        begin
            dotest(li, "")
        rescue Exception => e
        end

        #puts e

        assert_not_nil e
        assert_equal e.to_s, "loading remote definitions is not allowed"
    end

end

Version data entries

13 entries across 13 versions & 1 rubygems

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