test/ft_22_history.rb in ruote-0.9.18 vs test/ft_22_history.rb in ruote-0.9.19
- old
+ new
@@ -11,64 +11,68 @@
require 'openwfe/expool/history'
require 'openwfe/def'
class FlowTest22 < Test::Unit::TestCase
- include FlowTestBase
+ include FlowTestBase
- #def setup
- #end
+ #def setup
+ #end
- #def teardown
- #end
+ #def teardown
+ #end
- #
- # Test 0
- #
+ #
+ # Test 0
+ #
- class TestDefinition0 < OpenWFE::ProcessDefinition
- def make
- process_definition :name => "test0", :revision => "0" do
- sequence do
- _print "a"
- _print "b"
- _print "c"
- end
- end
- end
+ class TestDefinition0 < OpenWFE::ProcessDefinition
+ sequence do
+ _print "a"
+ _print "b"
+ participant "c"
end
+ end
- def test_history_0
+ def test_history_0
- @engine.init_service("history", InMemoryHistory)
+ @engine.register_participant 'c' do
+ @tracer << "c\n"
+ end
- history = @engine.application_context["history"]
+ @engine.init_service "history", OpenWFE::InMemoryHistory
- dotest TestDefinition0, %w{ a b c }.join("\n")
+ history = @engine.application_context["history"]
- #puts history.to_s
- #puts history.entries.size()
+ dotest TestDefinition0, %w{ a b c }.join("\n")
- #f = File.open("history.log", "w")
- #f.write(history.to_s)
- #f.close()
+ #puts history.to_s
+ #puts history.entries.size()
- assert_equal 22, history.entries.size
- end
+ #f = File.open("history.log", "w")
+ #f.write(history.to_s)
+ #f.close()
- def test_history_1
+ assert_equal 4, history.entries.size
+ end
- @engine.init_service("history", FileHistory)
+ def test_history_1
- dotest TestDefinition0, %w{ a b c }.join("\n")
+ @engine.register_participant 'c' do
+ @tracer << "c\n"
+ end
- @engine.ac["history"].output_file.flush
+ @engine.init_service "history", OpenWFE::FileHistory
- linecount = File.open("work/history.log") do |f|
- f.readlines.size
- end
+ dotest TestDefinition0, %w{ a b c }.join("\n")
- assert_equal 22, linecount
+ @engine.ac["history"].output_file.flush
+
+ linecount = File.open("work/history.log") do |f|
+ f.readlines.size
end
+
+ assert_equal 4, linecount
+ end
end