Sha256: e2781305fb71e45c680f723451de02094ea066d222a0ca116d6b1c8bc4b89258
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
# # Testing OpenWFE # # John Mettraux at openwfe.org # # Sun Oct 29 15:41:44 JST 2006 # # Kita Yokohama # require 'test/unit' #require 'openwfe/workitem' #require 'openwfe/flowexpressionid' require 'openwfe/engine/engine' require 'openwfe/expressions/raw_prog' require 'openwfe/worklist/storeparticipant' include OpenWFE class ConcurrenceAndParticipantTest < Test::Unit::TestCase def setup @engine = Engine.new() end #def teardown #end # # concurrence test class Hpc0 < ProcessDefinition concurrence do #participant :alice #participant :bob alice bob end end def test_hpc_0 @hpAlice = HashParticipant.new @hpBob = HashParticipant.new @engine.register_participant(:alice, @hpAlice) @engine.register_participant(:bob, @hpBob) @engine.launch(Hpc0) sleep 0.100 assert_equal @hpAlice.size, 1 assert_equal @hpBob.size, 1 end def test_1 @engine.register_participant :alice do |workitem| puts "alice in" sleep 0.100 puts "alice out" end @engine.register_participant :bob do |workitem| puts "bob in" sleep 0.100 puts "bob out" end @engine.launch Hpc0 sleep 2 end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
openwferu-0.9.14 | test/concurrence_test.rb |
openwferu-0.9.15 | test/concurrence_test.rb |
openwferu-0.9.16 | test/concurrence_test.rb |