Sha256: 3015e2601e7766b0fae0536f19d9aac805a3299180984b3fed5ad6a58d0fc6cf

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

#
# Testing OpenWFEru (Ruote)
#
# John Mettraux at openwfe.org
#
# Mon Oct  9 22:19:44 JST 2006
#

require 'openwfe/def'

require 'flowtestbase'


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

  #def teardown
  #end

  #def setup
  #end

  #
  # TEST 0

  class TestSubProcId0 < OpenWFE::ProcessDefinition
    concurrence do
      subproc
      subproc
    end
    process_definition :name => :subproc do
      sequence do
        #reval "puts fei"
        check
      end
    end
  end

  class TestSubProcId1 < OpenWFE::ProcessDefinition
    concurrence do
      subprocess :ref => 'subproc'
      subprocess :ref => :subproc
    end
    process_definition :name => :subproc do
      sequence do
        #reval "puts fei"
        check
      end
    end
  end

  def test_subprocid_0

    feis = {}

    @engine.register_participant(:check) do |fexp, wi|
      #puts fexp.fei.to_debug_s
      feis[fexp.fei] = true
    end

    launch TestSubProcId0
    launch TestSubProcId1

    sleep 2

    assert_equal 4, feis.keys.size
  end


  #
  # TEST about Iterator

  class TestIteratorSubId0 < OpenWFE::ProcessDefinition
    iterator :on_value => 'a, b', :to_variable => 'v' do
      check
    end
  end

  def test_iterator_subid_0

    feis = {}

    @engine.register_participant(:check) do |fexp, wi|
      #puts fexp.fei.to_debug_s
      feis[fexp.fei] = true
    end

    launch TestIteratorSubId0

    sleep 0.350

    assert_equal 2, feis.keys.size
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.19 test/ft_36_subprocids.rb