test/atom_test.rb in openwferu-0.9.11 vs test/atom_test.rb in openwferu-0.9.12
- old
+ new
@@ -28,32 +28,28 @@
#end
#
# test atom 0
- class Atom0Definition < ProcessDefinition
- def make
- process_definition :name => "atom0", :revision => "0" do
- sequence do
+ class AtomDefinition0 < ProcessDefinition
+ sequence do
- set \
- :field => "atom_entry_title",
- :value => "#{$run_index}"
- set \
- :field => "colour",
- :value => "blue"
- participant :ref => "feed0-alpha"
+ set \
+ :field => "atom_entry_title",
+ :value => "#{$run_index}"
+ set \
+ :field => "colour",
+ :value => "blue"
+ participant :ref => "feed0-alpha"
- set \
- :field => "atom_entry_title",
- :value => "#{$run_index}"
- set \
- :field => "colour",
- :value => "red"
- participant :ref => "feed1-bravo"
- end
- end
+ set \
+ :field => "atom_entry_title",
+ :value => "#{$run_index}"
+ set \
+ :field => "colour",
+ :value => "red"
+ participant :ref => "feed1-bravo"
end
end
def test_atom_0
@@ -65,11 +61,11 @@
""")
feed1 = AtomParticipant.new(7) do |fe, participant, workitem|
- t = Time.new.to_s
+ t = Time.now.to_s
"""
<p>
<h1>${f:colour}</h1>
<ul>
<li>flowexpression : #{fe.fei.to_s}</li>
@@ -84,16 +80,21 @@
@engine.register_participant("feed0-.*", feed0)
@engine.register_participant("feed1-.*", feed1)
$run_index = "first run"
- @engine.launch(LaunchItem.new(Atom0Definition))
+ @engine.launch(LaunchItem.new(AtomDefinition0))
$run_index = "second run"
- @engine.launch(LaunchItem.new(Atom0Definition))
+ @engine.launch(LaunchItem.new(AtomDefinition0))
$run_index = "third and last run"
- @engine.launch(LaunchItem.new(Atom0Definition))
+ @engine.launch(LaunchItem.new(AtomDefinition0))
+
+ @engine.join_until_idle
+
+ assert File.exist?('work/atom_feed0-alpha.xml')
+ assert File.exist?('work/atom_feed1-bravo.xml')
end
end