test/ft_32_journal.rb in openwferu-0.9.7 vs test/ft_32_journal.rb in openwferu-0.9.8
- old
+ new
@@ -26,20 +26,23 @@
#
# TEST 0
class TestDefinition0 < ProcessDefinition
- concurrence do
- #sequence do
+ #concurrence do
+ sequence do
+ #set :variable => "//toto", :value => "nada"
participant :alpha
bravo
end
end
- #def xxxx_flowname_0
- def test_flowname_0
+ #def xxxx_journal_0
+ def test_journal_0
+ @engine.application_context[:keep_journals] = true
+
@engine.init_service("journal", Journal)
@engine.register_participant(:alpha) do |wi|
@tracer << "alpha\n"
end
@@ -49,12 +52,32 @@
fei = dotest(TestDefinition0, "alpha\nbravo")
journal_service = @engine.application_context["journal"]
- fn = journal_service.workdir + "/" + fei.wfid + ".journal"
+ fn = journal_service.donedir + "/" + fei.wfid + ".journal"
- journal_service.replay fn
+ #journal_service.analyze fn
+
+ #sleep(10)
+
+ assert_equal @engine.get_expression_storage.size, 1
+
+ journal_service.replay fn, 18
+ #
+ # replay at offset 18 without "refiring"
+ #
+ # flow waits
+
+ assert_equal @engine.get_expression_storage.size, 6
+
+ journal_service.replay fn, 18, true
+ #
+ # replay at offset 18 with "refiring"
+ #
+ # flow resumes
+
+ assert_equal @engine.get_expression_storage.size, 1
end
end