test/ft_58_ejournal.rb in openwferu-0.9.15 vs test/ft_58_ejournal.rb in openwferu-0.9.16
- old
+ new
@@ -35,11 +35,10 @@
participant :nada
participant :bravo
end
end
- #def xxxx_0
def test_0
ejournal = @engine.get_error_journal
@engine.register_participant(:alpha) do |wi|
@@ -48,49 +47,25 @@
#fei = dotest(Test0, "alpha", 0.500, true)
li = LaunchItem.new Test0
fei = @engine.launch li
- sleep 0.200
+ sleep 0.300
assert File.exist?("work/ejournal/#{fei.parent_wfid}.ejournal") \
if @engine.is_a?(FilePersistedEngine)
errors = ejournal.get_error_log fei
#require 'pp'; pp ejournal
+ #puts "/// error journal of class #{ejournal.class.name}"
- assert_equal errors.length, 1
+ assert_equal 1, errors.length
- first_error = errors[0]
-
assert ejournal.has_errors?(fei)
assert ejournal.has_errors?(fei.wfid)
- # let's look at how errors do stack
-
- ejournal.replay_at_last_error fei.wfid
-
- sleep 0.200
-
- errors = ejournal.get_error_log fei
-
- assert_equal errors.length, 2
-
- second_error = errors[1]
-
- assert second_error.date > first_error.date
-
- # let's clean the log (we have the error as 'second_error')
-
- ejournal.remove_error_log fei.wfid
-
- errors = ejournal.get_error_log fei
-
- assert_equal errors.length, 0
- assert ( ! ejournal.has_errors?(fei))
-
# OK, let's fix the root and replay
@engine.register_participant(:nada) do |wi|
@tracer << "nada\n"
end
@@ -98,20 +73,20 @@
@tracer << "bravo\n"
end
# fix done
- assert_equal @tracer.to_s, "alpha"
+ assert_equal "alpha", @tracer.to_s
- ejournal.replay_at_error second_error
+ @engine.replay_at_error errors.first
- sleep 0.200
+ sleep 0.300
- assert_equal @tracer.to_s, "alpha\nnada\nbravo"
+ assert_equal "alpha\nnada\nbravo", @tracer.to_s
errors = ejournal.get_error_log fei
- assert_equal errors.length, 0
+ assert_equal 0, errors.length
assert ( ! ejournal.has_errors?(fei))
end
end