Sha256: a18af31a49499ad2f72f89244d9624e3f3c3f2b70d83f5bfba4f2f0c8b898faf

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Tue Jan  2 13:14:37 JST 2007
#

#require 'profile'

require 'flowtestbase'
require 'openwfe/expressions/raw_prog'

include OpenWFE


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

    #def setup
    #end

    #def teardown
    #end

    #
    # Test 0
    #

    class TestDefinition0 < ProcessDefinition
        count
    end

    #def xxxx_load_0
    def test_load_0

        #require 'openwfe/expool/journal'
        #@engine.application_context[:keep_journals] = true
        #@engine.init_service("journal", Journal)

        $count = 0

        @engine.register_participant("count") do |workitem|
            $count += 1
            #puts "count is #{$count}"
        end
        

        n = 1000
        n.times do |i|
            @engine.launch(LaunchItem.new(TestDefinition0))
            
        end
        
        puts "launched #{n} items"

        #n.times do |i|
        #    Thread.new do
        #        @engine.launch(LaunchItem.new(TestDefinition0))
        #    end
        #end

        #5.times do 
        #    Thread.new do
        #        (n / 5).times do
        #            @engine.launch(LaunchItem.new(TestDefinition0))
        #        end
        #    end
        #end
        #sleep 1

        join_until_idle

        assert_equal $count, n
    end
    
    def join_until_idle ()
      storage = @engine.get_expression_storage
      while storage.size > 1
        sleep 1
        puts "storage.size:#{storage.size}"
      end
    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openwferu-0.9.12 test/ft_26b_load.rb
openwferu-0.9.12.863 test/ft_26b_load.rb
openwferu-0.9.13 test/ft_26b_load.rb
openwferu-0.9.14 test/ft_26b_load.rb