test/ft_11_ppd.rb in openwferu-0.9.4 vs test/ft_11_ppd.rb in openwferu-0.9.5
- old
+ new
@@ -12,11 +12,12 @@
require 'openwfe/def'
include OpenWFE
-class FlowTest11 < FlowTestBase
+class FlowTest11 < Test::Unit::TestCase
+ include FlowTestBase
#def setup
#end
#def teardown
@@ -178,12 +179,11 @@
""".strip
def test_ppd_4
#def xxxx_ppd_4
- s = TestDefinition4.do_make(
- ExpressionMap.new(nil, nil)).to_code_s
+ s = TestDefinition4.do_make.to_code_s
#puts
#puts s
#puts
#puts TestDefinition4.do_make(ExpressionMap.new(nil, nil)).to_s
@@ -236,12 +236,11 @@
""".strip
def test_ppd_5
#def xxxx_ppd_5
- s = TestDefinition5.do_make(
- ExpressionMap.new(nil, nil)).to_code_s
+ s = TestDefinition5.do_make.to_code_s
#puts
#puts s
#puts
#puts TestDefinition5.do_make(ExpressionMap.new(nil, nil)).to_s
@@ -261,12 +260,12 @@
# Test 6
#
class TestDefinition6 < ProcessDefinition
- def initialize (expressions, count)
- super(expressions)
+ def initialize (count)
+ super()
@count = count
end
def make
process_definition :name => "test6", :revision => "0" do
@@ -279,13 +278,12 @@
end
end
def test_ppd_6
#def xxxx_ppd_6
-
dotest(
- TestDefinition6.new(@engine, 3),
+ TestDefinition6.new(3),
"""0
1
2""")
end
@@ -305,11 +303,10 @@
end
end
def test_ppd_7
#def xxxx_ppd_7
-
dotest(
TestDefinition7,
"""a
b""")
end
@@ -330,11 +327,10 @@
end
end
def test_ppd_8
#def xxxx_ppd_8
-
dotest(
TestDefinition8,
"toto")
end
@@ -343,24 +339,54 @@
# Test 9
#
class TestDefinition9 < ProcessDefinition
def make
- process_definition :name => "test8", :revision => "0" do
+ process_definition :name => "test9", :revision => "0" do
_toto
process_definition :name => "toto" do
_print "toto"
end
end
end
end
def test_ppd_9
#def xxxx_ppd_9
-
dotest(
TestDefinition9,
"toto")
+ end
+
+
+ #
+ # Test 10
+ #
+
+ class TestDefinition10 < ProcessDefinition
+ def make
+ process_definition :name => "test10", :revision => "0" do
+ sequence do
+ participant :ref => "toto_underscore"
+ _toto_underscore
+ toto_underscore
+ end
+ end
+ end
+ end
+
+ def test_ppd_10
+ #def xxxx_ppd_10
+
+ @engine.register_participant(:toto_underscore) do |workitem|
+ @tracer << "toto\n"
+ end
+
+ dotest(
+ TestDefinition10,
+ """toto
+toto
+toto""")
end
end