Sha256: a1b4811d643b957c61c6be02dea7b40b2226a9155b5322cb768fa56c75c570b0

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

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

require 'rubygems'

require 'openwfe/def'
require 'openwfe/participants'

require 'flowtestbase'


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

  #def teardown
  #end

  #def setup
  #end


  #
  # test 5
  #

  class TestTag5 < OpenWFE::ProcessDefinition

    sequence do
      sub0
    end

    process_definition :name => "sub0" do
      sequence :tag => "seq0" do
        peekin
      end
    end
  end

  def test_tag_5

    @engine.register_participant :peekin do |fexp, wi|

      wfid = fexp.fei.parent_workflow_instance_id

      assert_equal 3, @engine.get_variables(wfid).size
        # :next_sub_id and one [sub] process definition

      assert_equal 0, @engine.process_status(wfid).tags.size
      assert_equal "", @engine.process_status(wfid).tags.to_s

      @tracer << "peekin\n"
    end

    dotest TestTag5, "peekin"
  end


  #
  # test 5b
  #

  class TestTag5b < OpenWFE::ProcessDefinition

    sequence do
      sub0
    end

    process_definition :name => "sub0" do
      sequence :tag => "/seq0" do
        peekin
      end
    end
  end

  def test_5b

    @engine.register_participant :peekin do |fexp, wi|

      wfid = fexp.fei.parent_workflow_instance_id

      assert_equal 4, @engine.get_variables(wfid).size
        # :next_sub_id and one [sub] process definition (and the tag)

      assert_equal 1, @engine.process_status(wfid).tags.size
      assert_equal "seq0", @engine.process_status(wfid).tags.to_s

      @tracer << "peekin\n"
    end

    dotest TestTag5b, "peekin"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.19 test/ft_38c_tag.rb