openwferu 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/README +50 -2
  2. data/bin/validate-workflow.rb +64 -0
  3. data/lib/codec.rb +2 -0
  4. data/lib/controlclient.rb +19 -0
  5. data/lib/definitions.rb +2 -0
  6. data/lib/exception.rb +2 -0
  7. data/lib/flowexpressionid.rb +7 -5
  8. data/lib/openwferu.rb +2 -0
  9. data/lib/osocket.rb +2 -0
  10. data/lib/otime.rb +2 -0
  11. data/lib/restclient.rb +2 -0
  12. data/lib/ru/contextual.rb +2 -0
  13. data/lib/ru/dollar.rb +2 -0
  14. data/lib/ru/engine.rb +2 -0
  15. data/lib/ru/environment.rb +2 -0
  16. data/lib/ru/expressionmap.rb +5 -0
  17. data/lib/ru/expressionpool.rb +49 -6
  18. data/lib/ru/expressionstorage.rb +3 -1
  19. data/lib/ru/fe_base.rb +4 -1
  20. data/lib/ru/fe_concurrence.rb +82 -10
  21. data/lib/ru/fe_define.rb +2 -0
  22. data/lib/ru/fe_misc.rb +47 -0
  23. data/lib/ru/fe_participant.rb +2 -0
  24. data/lib/ru/fe_raw.rb +35 -19
  25. data/lib/ru/fe_subprocess.rb +2 -0
  26. data/lib/ru/fe_time.rb +2 -0
  27. data/lib/ru/fe_utils.rb +2 -0
  28. data/lib/ru/fe_value.rb +23 -12
  29. data/lib/ru/flowexpression.rb +26 -4
  30. data/lib/ru/logging.rb +2 -0
  31. data/lib/ru/participant.rb +2 -0
  32. data/lib/ru/participantmap.rb +2 -0
  33. data/lib/ru/participants.rb +2 -0
  34. data/lib/ru/rudefinitions.rb +9 -2
  35. data/lib/ru/ruutils.rb +3 -1
  36. data/lib/ru/scheduler.rb +2 -0
  37. data/lib/ru/schedulers.rb +2 -0
  38. data/lib/ru/service.rb +2 -0
  39. data/lib/test.rb +2 -0
  40. data/lib/utils.rb +49 -0
  41. data/lib/workitem.rb +9 -10
  42. data/lib/worklistclient.rb +18 -8
  43. data/test/flowtestbase.rb +7 -0
  44. data/test/ft_2_concurrence.rb +14 -2
  45. data/test/ft_6_lambda.rb +40 -0
  46. data/test/ft_7_losfor.rb +123 -0
  47. data/test/fulltest.rb +14 -0
  48. data/test/misctest.rb +30 -0
  49. data/test/{runtest.rb → quicktest.rb} +2 -2
  50. data/test/timetest.rb +2 -2
  51. metadata +54 -41
data/test/flowtestbase.rb CHANGED
@@ -31,6 +31,13 @@ class FlowTestBase < Test::Unit::TestCase
31
31
 
32
32
  protected
33
33
 
34
+ def test_name
35
+ s = caller(1)[0]
36
+ i = s.index('`')
37
+ s = s[i+1..s.length-2]
38
+ return s
39
+ end
40
+
34
41
  def dotest (flowDef, expectedTrace, sleepTime=0)
35
42
 
36
43
  engine = OpenWFEru::Engine.new()
@@ -18,9 +18,9 @@ class FlowTest2 < FlowTestBase
18
18
  #def teardown
19
19
  #end
20
20
 
21
- def test_concurrence
21
+ def test_con_0
22
22
  dotest(\
23
- '''<process-definition name="n" revision="0">
23
+ '''<process-definition name="con" revision="0">
24
24
  <concurrence>
25
25
  <print>a</print>
26
26
  <print>b</print>
@@ -30,5 +30,17 @@ b''', '''b
30
30
  a''' ], 0.1 )
31
31
  end
32
32
 
33
+ def test_con_1
34
+ dotest(\
35
+ '''<process-definition name="con" revision="1">
36
+ <concurrence
37
+ count="1"
38
+ >
39
+ <print>a</print>
40
+ <print>b</print>
41
+ </concurrence>
42
+ </process-definition>''', [ "a", "b" ], 0.1 )
43
+ end
44
+
33
45
  end
34
46
 
@@ -0,0 +1,40 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Mon Dec 11 09:49:18 JST 2006
8
+ # Narita terminal 1
9
+ #
10
+
11
+ require 'flowtestbase'
12
+
13
+
14
+ class FlowTest6 < FlowTestBase
15
+
16
+ #def setup
17
+ #end
18
+
19
+ #def teardown
20
+ #end
21
+
22
+ def test_lambda_0
23
+ dotest(\
24
+ '''<process-definition name="lambda_0" revision="0">
25
+ <sequence>
26
+ <set variable="inside1">
27
+ <process-definition>
28
+ <print>bonjour ${name}</print>
29
+ </process-definition>
30
+ </set>
31
+
32
+ <inside1 name="world" />
33
+ <print>over</print>
34
+ </sequence>
35
+ </process-definition>''', """bonjour world
36
+ over""", 3)
37
+ end
38
+
39
+ end
40
+
@@ -0,0 +1,123 @@
1
+
2
+ #
3
+ # Testing OpenWFEru
4
+ #
5
+ # John Mettraux at openwfe.org
6
+ #
7
+ # Mon Dec 25 14:27:48 JST 2006
8
+ #
9
+
10
+ require 'flowtestbase'
11
+
12
+
13
+ class FlowTest7 < FlowTestBase
14
+
15
+ #def setup
16
+ #end
17
+
18
+ #def teardown
19
+ #end
20
+
21
+ def test_test_name
22
+ dotest(\
23
+ """<process-definition name='#{test_name}' revision='0'>
24
+ <print>#{test_name}</print>
25
+ </process-definition>""", "test_test_name")
26
+ end
27
+
28
+ #def test_lose_0
29
+ def xxxx_lose_0
30
+ dotest(\
31
+ '<process-definition name="'+test_name+'''" revision="0">
32
+ <sequence>
33
+
34
+ <concurrence count="1">
35
+ <lose>
36
+ <sequence>
37
+ <sleep for="2s" />
38
+ <print>I should not be printed</print>
39
+ </sequence>
40
+ </lose>
41
+ <sequence>
42
+ <print>ok</print>
43
+ </sequence>
44
+ </concurrence>
45
+
46
+ <print>- - -</print>
47
+
48
+ <concurrence count="1">
49
+ <lose>
50
+ <sequence>
51
+ <print>ok too</print>
52
+ <set variable="v0" value="true" />
53
+ </sequence>
54
+ </lose>
55
+ <sequence>
56
+ <sleep for="252" />
57
+ <!-- 250 or less is bad : the default scheduler precision
58
+ is 1/4 of second -->
59
+ <print>ok</print>
60
+ </sequence>
61
+ </concurrence>
62
+
63
+ <print>v0 : ${v0}</print>
64
+ <if>
65
+ <equals field-value="v0" other-value="true" />
66
+ <print>ok</print>
67
+ </if>
68
+
69
+ <print>- - -</print>
70
+
71
+ <concurrence count="1">
72
+ <lose>
73
+ <sequence>
74
+ <sleep for="252" />
75
+ <print>ok too</print>
76
+ <set variable="v1" value="true" />
77
+ </sequence>
78
+ </lose>
79
+ <sequence>
80
+ <print>ok</print>
81
+ </sequence>
82
+ </concurrence>
83
+
84
+ <print>v1 : ${v1}</print>
85
+ <if>
86
+ <equals field-value="v1" other-value="true" />
87
+ <print>ok</print>
88
+ </if>
89
+
90
+ <print>done.</print>
91
+
92
+ </sequence>
93
+ </process-definition>''', """ok
94
+ - - -
95
+ ok too
96
+ ok
97
+ v0 : true
98
+ ok
99
+ - - -
100
+ ok
101
+ v1 :
102
+ done.""", 9)
103
+ end
104
+
105
+ def test_lose_1
106
+ #def xxxx_lose_1
107
+ dotest(\
108
+ '<process-definition name="'+test_name+'''" revision="0">
109
+ <concurrence
110
+ count="1"
111
+ >
112
+ <lose>
113
+ <print>a</print>
114
+ </lose>
115
+ <print>b</print>
116
+ </concurrence>
117
+ </process-definition>''',
118
+ [ "a", "b" ],
119
+ 0.1 )
120
+ end
121
+
122
+ end
123
+
data/test/fulltest.rb ADDED
@@ -0,0 +1,14 @@
1
+ #
2
+ # Testing OpenWFEru
3
+ #
4
+ # John Mettraux at openwfe.org
5
+ #
6
+ # Mon Oct 9 22:19:44 JST 2006
7
+ #
8
+
9
+ #require 'test/unit'
10
+
11
+ require 'quicktest'
12
+ require 'ft_5_time'
13
+ require 'timetest'
14
+
data/test/misctest.rb CHANGED
@@ -8,6 +8,7 @@
8
8
  #
9
9
 
10
10
  require 'test/unit'
11
+ require 'utils'
11
12
  require 'ru/ruutils'
12
13
  require 'ru/expressionmap'
13
14
  require 'ru/fe_define'
@@ -43,4 +44,33 @@ class MiscTest < Test::Unit::TestCase
43
44
  "process-definition should be considered as a definition"
44
45
  end
45
46
 
47
+ def test_dup
48
+ a0 = A.new
49
+ a0.a = 1
50
+ a0.b = 2
51
+ a1 = OpenWFE::dup(a0)
52
+
53
+ #puts a0
54
+ #puts a1
55
+
56
+ assert \
57
+ a0.equals(a1),
58
+ "dup() utility not working"
59
+ end
60
+
61
+ private
62
+
63
+ class A
64
+ attr_accessor :a, :b
65
+
66
+ def equals (other)
67
+ return false if not other.kind_of?(A)
68
+ return (self.a == other.a and self.b == other.b)
69
+ end
70
+
71
+ def to_s
72
+ "A : a='#{a}', b='#{b}'"
73
+ end
74
+ end
75
+
46
76
  end
@@ -12,10 +12,10 @@ require 'ft_2_concurrence'
12
12
  require 'feitest'
13
13
  require 'dollartest'
14
14
  require 'misctest'
15
- require 'timetest'
16
15
  require 'ft_0'
17
16
  require 'ft_1_unset'
18
17
  require 'ft_3_equals'
19
18
  require 'ft_4_misc'
20
- require 'ft_5_time'
19
+ require 'ft_6_lambda'
20
+ require 'ft_7_losfor'
21
21
 
data/test/timetest.rb CHANGED
@@ -104,8 +104,8 @@ class TimeTest < Test::Unit::TestCase
104
104
 
105
105
  def pts (time_string, seconds)
106
106
  assert \
107
- (OpenWFE::parse_time_string(time_string) == seconds),
108
- "'#{time_string}' did not map to #{seconds} seconds"
107
+ ((OpenWFE::parse_time_string(time_string) == seconds),
108
+ "'#{time_string}' did not map to #{seconds} seconds")
109
109
  end
110
110
 
111
111
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: openwferu
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.0
7
- date: 2006-11-29 00:00:00 +09:00
6
+ version: 0.9.1
7
+ date: 2006-12-26 00:00:00 +09:00
8
8
  summary: An OpenWFE-compatible workflow engine in Ruby
9
9
  require_paths:
10
10
  - lib
@@ -28,64 +28,69 @@ cert_chain:
28
28
  post_install_message:
29
29
  authors:
30
30
  - John Mettraux
31
+ - Alain Hoang
31
32
  files:
33
+ - bin/validate-workflow.rb
32
34
  - lib/ru
33
- - lib/exception.rb
34
- - lib/codec.rb
35
- - lib/otime.rb
36
- - lib/worklistclient.rb
37
35
  - lib/controlclient.rb
38
- - lib/test.rb
39
- - lib/utils.rb
40
- - lib/workitem.rb
36
+ - lib/codec.rb
41
37
  - lib/flowexpressionid.rb
42
- - lib/osocket.rb
43
38
  - lib/definitions.rb
39
+ - lib/exception.rb
44
40
  - lib/restclient.rb
45
41
  - lib/openwferu.rb
46
- - lib/ru/participant.rb
47
- - lib/ru/dollar.rb
48
- - lib/ru/rudefinitions.rb
49
- - lib/ru/scheduler.rb
50
- - lib/ru/fe_concurrence.rb
51
- - lib/ru/fe_base.rb
52
- - lib/ru/expressionstorage.rb
53
- - lib/ru/contextual.rb
54
- - lib/ru/fe_value.rb
55
- - lib/ru/logging.rb
56
- - lib/ru/flowexpression.rb
57
- - lib/ru/fe_participant.rb
42
+ - lib/osocket.rb
43
+ - lib/otime.rb
44
+ - lib/workitem.rb
45
+ - lib/test.rb
46
+ - lib/utils.rb
47
+ - lib/worklistclient.rb
58
48
  - lib/ru/expressionpool.rb
49
+ - lib/ru/contextual.rb
50
+ - lib/ru/dollar.rb
51
+ - lib/ru/engine.rb
52
+ - lib/ru/environment.rb
59
53
  - lib/ru/expressionmap.rb
60
- - lib/ru/service.rb
61
- - lib/ru/participants.rb
62
- - lib/ru/schedulers.rb
63
- - lib/ru/fe_subprocess.rb
64
- - lib/ru/fe_raw.rb
54
+ - lib/ru/expressionstorage.rb
55
+ - lib/ru/fe_base.rb
56
+ - lib/ru/fe_concurrence.rb
65
57
  - lib/ru/fe_define.rb
66
- - lib/ru/environment.rb
67
58
  - lib/ru/fe_misc.rb
68
- - lib/ru/engine.rb
69
- - lib/ru/ruutils.rb
59
+ - lib/ru/fe_participant.rb
60
+ - lib/ru/fe_raw.rb
61
+ - lib/ru/fe_subprocess.rb
70
62
  - lib/ru/fe_time.rb
71
63
  - lib/ru/fe_utils.rb
64
+ - lib/ru/fe_value.rb
65
+ - lib/ru/flowexpression.rb
66
+ - lib/ru/logging.rb
67
+ - lib/ru/participant.rb
72
68
  - lib/ru/participantmap.rb
69
+ - lib/ru/participants.rb
70
+ - lib/ru/rudefinitions.rb
71
+ - lib/ru/ruutils.rb
72
+ - lib/ru/scheduler.rb
73
+ - lib/ru/schedulers.rb
74
+ - lib/ru/service.rb
73
75
  - test/ft_2_concurrence.rb
74
76
  - test/dollartest.rb
75
- - test/timetest.rb
76
- - test/flowtestbase.rb
77
77
  - test/feitest.rb
78
- - test/runtest.rb
79
- - test/ft_3_equals.rb
80
- - test/rutest_utils.rb
78
+ - test/flowtestbase.rb
79
+ - test/ft_0.rb
81
80
  - test/ft_1_unset.rb
81
+ - test/ft_3_equals.rb
82
82
  - test/ft_4_misc.rb
83
- - test/ft_0.rb
84
83
  - test/ft_5_time.rb
84
+ - test/ft_6_lambda.rb
85
+ - test/fulltest.rb
85
86
  - test/misctest.rb
87
+ - test/quicktest.rb
88
+ - test/rutest_utils.rb
89
+ - test/timetest.rb
90
+ - test/ft_7_losfor.rb
86
91
  - README
87
92
  test_files:
88
- - test/runtest.rb
93
+ - test/quicktest.rb
89
94
  rdoc_options: []
90
95
 
91
96
  extra_rdoc_files:
@@ -94,7 +99,15 @@ executables: []
94
99
 
95
100
  extensions: []
96
101
 
97
- requirements: []
98
-
99
- dependencies: []
100
-
102
+ requirements:
103
+ - libxml-ruby
104
+ dependencies:
105
+ - !ruby/object:Gem::Dependency
106
+ name: libxml-ruby
107
+ version_requirement:
108
+ version_requirements: !ruby/object:Gem::Version::Requirement
109
+ requirements:
110
+ - - ">"
111
+ - !ruby/object:Gem::Version
112
+ version: 0.0.0
113
+ version: