taverna-t2flow 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,50 @@
1
+ module TestHelper
2
+
3
+ def generic_model_test(model)
4
+ assert !model.nil?, "Model is nil!"
5
+
6
+ assert !(model.name.nil? || model.name.strip.empty?), "Model#name is empty/nil!"
7
+
8
+ assert !(model.main.name.nil? || model.main.name.strip.empty?), "Model#main#name is empty/nil!"
9
+ assert_type(model.main, T2Flow::Dataflow, "Model#main")
10
+
11
+ # Model
12
+ assert_type(model.dependencies, Array, "Model#dependencies")
13
+ assert_type(model.processors, Array, "Model#processors")
14
+ assert_type(model.sources, Array, "Model#sources")
15
+ assert_type(model.sinks, Array, "Model#sinks")
16
+ assert_type(model.coordinations, Array, "Model#coordinations")
17
+ assert_type(model.datalinks, Array, "Model#datalinks")
18
+
19
+ assert_type(model.all_processors, Array, "Model#all_processors")
20
+ assert_type(model.all_sources, Array, "Model#all_sources")
21
+ assert_type(model.all_sinks, Array, "Model#all_sinks")
22
+ assert_type(model.all_coordinations, Array, "Model#all_coordinations")
23
+ assert_type(model.all_datalinks, Array, "Model#all_datalinks")
24
+
25
+ assert_type(model.annotations, T2Flow::DataflowAnnotation, "Model#annotations")
26
+ assert_type(model.annotations.titles, Array, "Model#annotations#titles")
27
+ assert_type(model.annotations.authors, Array, "Model#annotations#authors")
28
+ assert_type(model.annotations.descriptions, Array, "Model#annotations#descriptions")
29
+ assert_type(model.annotations.name, String, "Model#annotations#name")
30
+
31
+ assert_type(model.beanshells, Array, "Model#beanshells")
32
+ assert_type(model.web_services, Array, "Model#web_services")
33
+ assert_type(model.local_workers, Array, "Model#local_workers")
34
+
35
+ # ProcessorLinks
36
+ processor_links = model.get_processor_links(model.processors[0])
37
+ assert_type(processor_links, T2Flow::ProcessorLinks, "Model#get_processor_links")
38
+ assert_type(processor_links.sinks, Array, "ProcessorLinks#sinks")
39
+ assert_type(processor_links.sources, Array, "ProcessorLinks#sources")
40
+ end
41
+
42
+ def assert_type(object, required_class, caption)
43
+ assert object.is_a?(required_class), "#{caption} has an incorrect type: #{object.class.name} -- #{required_class} expected"
44
+ end
45
+
46
+ def assert_count(list, required_size, caption)
47
+ assert_equal required_size, list.size, "#{caption} has incorrect count: #{list.size} -- #{required_size} expected"
48
+ end
49
+
50
+ end
@@ -0,0 +1,132 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ require File.expand_path(File.join(__FILE__, "..", "..", "lib", "t2flow", "model.rb"))
5
+ require File.expand_path(File.join(__FILE__, "..", "..", "lib", "t2flow", "parser.rb"))
6
+
7
+ require File.expand_path(File.join(__FILE__, "..", "test_helper.rb"))
8
+
9
+ class StarterPackWorkflowsTest < Test::Unit::TestCase
10
+
11
+ include TestHelper
12
+
13
+ def setup
14
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "996.t2flow"))
15
+ @emboss_tutorial_wf = T2Flow::Parser.new.parse(File.new(path))
16
+
17
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "997.t2flow"))
18
+ @biomart_emboss_analysis_wf = T2Flow::Parser.new.parse(File.new(path))
19
+
20
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "998.t2flow"))
21
+ @iteration_demo_wf = T2Flow::Parser.new.parse(File.new(path))
22
+
23
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "999.t2flow"))
24
+ @interproscan_wf = T2Flow::Parser.new.parse(File.new(path))
25
+
26
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "1000.t2flow"))
27
+ @pdb_fetch_wf = T2Flow::Parser.new.parse(File.new(path))
28
+
29
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "1001.t2flow"))
30
+ @comic_wf = T2Flow::Parser.new.parse(File.new(path))
31
+
32
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "1002.t2flow"))
33
+ @gbseq_wf = T2Flow::Parser.new.parse(File.new(path))
34
+
35
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "1003.t2flow"))
36
+ @pipeline_list_wf = T2Flow::Parser.new.parse(File.new(path))
37
+
38
+ path = File.expand_path(File.join(__FILE__, "..", "fixtures", "1004.t2flow"))
39
+ @retrieve_seq_wf = T2Flow::Parser.new.parse(File.new(path))
40
+ end
41
+
42
+ def test_emboss_tutorial_wf
43
+ generic_model_test(@emboss_tutorial_wf)
44
+
45
+ assert_count(@emboss_tutorial_wf.processors, 15, "@emboss_tutorial_wf.processors")
46
+ assert_count(@emboss_tutorial_wf.sources, 0, "@emboss_tutorial_wf.sources")
47
+ assert_count(@emboss_tutorial_wf.sinks, 3, "@emboss_tutorial_wf.sinks")
48
+ assert_count(@emboss_tutorial_wf.datalinks, 17, "@emboss_tutorial_wf.datalinks")
49
+ assert_count(@emboss_tutorial_wf.coordinations, 0, "@emboss_tutorial_wf.coordinations")
50
+ end
51
+
52
+ def test_biomart_emboss_analysis_wf
53
+ generic_model_test(@biomart_emboss_analysis_wf)
54
+
55
+ assert_count(@biomart_emboss_analysis_wf.processors, 10, "@biomart_emboss_analysis_wf.processors")
56
+ assert_count(@biomart_emboss_analysis_wf.sources, 0, "@biomart_emboss_analysis_wf.sources")
57
+ assert_count(@biomart_emboss_analysis_wf.sinks, 4, "@biomart_emboss_analysis_wf.sinks")
58
+ assert_count(@biomart_emboss_analysis_wf.datalinks, 17, "@biomart_emboss_analysis_wf.datalinks")
59
+ assert_count(@biomart_emboss_analysis_wf.coordinations, 0, "@biomart_emboss_analysis_wf.coordinations")
60
+ end
61
+
62
+ def test_iteration_demo_wf
63
+ generic_model_test(@iteration_demo_wf)
64
+
65
+ assert_count(@iteration_demo_wf.processors, 8, "@iteration_demo_wf.processors")
66
+ assert_count(@iteration_demo_wf.sources, 0, "@iteration_demo_wf.sources")
67
+ assert_count(@iteration_demo_wf.sinks, 1, "@iteration_demo_wf.sinks")
68
+ assert_count(@iteration_demo_wf.datalinks, 8, "@iteration_demo_wf.datalinks")
69
+ assert_count(@iteration_demo_wf.coordinations, 0, "@iteration_demo_wf.coordinations")
70
+ end
71
+
72
+ def test_interproscan_wf
73
+ generic_model_test(@interproscan_wf)
74
+
75
+ assert_count(@interproscan_wf.processors, 17, "@interproscan_wf.processors")
76
+ assert_count(@interproscan_wf.sources, 2, "@interproscan_wf.sources")
77
+ assert_count(@interproscan_wf.sinks, 5, "@interproscan_wf.sinks")
78
+ assert_count(@interproscan_wf.datalinks, 23, "@interproscan_wf.datalinks")
79
+ assert_count(@interproscan_wf.coordinations, 2, "@interproscan_wf.coordinations")
80
+ end
81
+
82
+ def test_pdb_fetch_wf
83
+ generic_model_test(@pdb_fetch_wf)
84
+
85
+ assert_count(@pdb_fetch_wf.processors, 5, "@pdb_fetch_wf.processors")
86
+ assert_count(@pdb_fetch_wf.sources, 1, "@pdb_fetch_wf.sources")
87
+ assert_count(@pdb_fetch_wf.sinks, 1, "@pdb_fetch_wf.sinks")
88
+ assert_count(@pdb_fetch_wf.datalinks, 6, "@pdb_fetch_wf.datalinks")
89
+ assert_count(@pdb_fetch_wf.coordinations, 0, "@pdb_fetch_wf.coordinations")
90
+ end
91
+
92
+ def test_comic_wf
93
+ generic_model_test(@comic_wf)
94
+
95
+ assert_count(@comic_wf.processors, 6, "@comic_wf.processors")
96
+ assert_count(@comic_wf.sources, 0, "@comic_wf.sources")
97
+ assert_count(@comic_wf.sinks, 1, "@comic_wf.sinks")
98
+ assert_count(@comic_wf.datalinks, 7, "@comic_wf.datalinks")
99
+ assert_count(@comic_wf.coordinations, 0, "@comic_wf.coordinations")
100
+ end
101
+
102
+ def test_gbseq_wf
103
+ generic_model_test(@gbseq_wf)
104
+
105
+ assert_count(@gbseq_wf.processors, 10, "@gbseq_wf.processors")
106
+ assert_count(@gbseq_wf.sources, 0, "@gbseq_wf.sources")
107
+ assert_count(@gbseq_wf.sinks, 8, "@gbseq_wf.sinks")
108
+ assert_count(@gbseq_wf.datalinks, 16, "@gbseq_wf.datalinks")
109
+ assert_count(@gbseq_wf.coordinations, 0, "@gbseq_wf.coordinations")
110
+ end
111
+
112
+ def test_pipeline_list_wf
113
+ generic_model_test(@pipeline_list_wf)
114
+
115
+ assert_count(@pipeline_list_wf.processors, 8, "@pipeline_list_wf.processors")
116
+ assert_count(@pipeline_list_wf.sources,1, "@pipeline_list_wf.sources")
117
+ assert_count(@pipeline_list_wf.sinks, 1, "@pipeline_list_wf.sinks")
118
+ assert_count(@pipeline_list_wf.datalinks, 9, "@pipeline_list_wf.datalinks")
119
+ assert_count(@pipeline_list_wf.coordinations, 0, "@pipeline_list_wf.coordinations")
120
+ end
121
+
122
+ def test_retrieve_seq_wf
123
+ generic_model_test(@retrieve_seq_wf)
124
+
125
+ assert_count(@retrieve_seq_wf.processors, 4, "@retrieve_seq_wf.processors")
126
+ assert_count(@retrieve_seq_wf.sources, 0, "@retrieve_seq_wf.sources")
127
+ assert_count(@retrieve_seq_wf.sinks, 1, "@retrieve_seq_wf.sinks")
128
+ assert_count(@retrieve_seq_wf.datalinks, 4, "@retrieve_seq_wf.datalinks")
129
+ assert_count(@retrieve_seq_wf.coordinations, 0, "@retrieve_seq_wf.coordinations")
130
+ end
131
+
132
+ end
metadata CHANGED
@@ -1,94 +1,146 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: taverna-t2flow
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
13
- - Mannie Tagarira
7
+ authors:
8
+ - Robert Haines
14
9
  - David Withers
15
- autorequire: t2flow
10
+ - Mannie Tagarira
11
+ autorequire:
16
12
  bindir: bin
17
- cert_chain:
18
- date: 2010-07-27 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: libxml-ruby
13
+ cert_chain: []
14
+ date: 2012-05-02 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rake
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2
24
+ type: :development
23
25
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
26
+ version_requirements: !ruby/object:Gem::Requirement
25
27
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 21
30
- segments:
31
- - 1
32
- - 1
33
- - 3
34
- version: 1.1.3
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: 0.9.2
32
+ - !ruby/object:Gem::Dependency
33
+ name: rdoc
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: 3.9.4
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 3.9.4
48
+ - !ruby/object:Gem::Dependency
49
+ name: jeweler
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: 1.8.3
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 1.8.3
64
+ - !ruby/object:Gem::Dependency
65
+ name: libxml-ruby
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: 1.1.4
35
72
  type: :runtime
36
- version_requirements: *id001
37
- description: This a gem developed by myGrid for the purpose of interacting with Taverna 2 workflows. An example use would be the image genaration for the model representing Taverna 2 workflows as used in myExperiment.
38
- email: mannie@mygrid.org.uk
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 1.1.4
80
+ description: This a gem developed by myGrid for the purpose of interacting with Taverna
81
+ 2 workflows. An example use would be the image genaration for the model representing
82
+ Taverna 2 workflows as used in myExperiment.
83
+ email:
84
+ - rhaines@manchester.ac.uk
39
85
  executables: []
40
-
41
86
  extensions: []
42
-
43
- extra_rdoc_files:
87
+ extra_rdoc_files:
88
+ - CHANGES.rdoc
89
+ - LICENCE
44
90
  - README.rdoc
91
+ files:
92
+ - CHANGES.rdoc
45
93
  - LICENCE
46
- - ChangeLog.rdoc
47
- files:
94
+ - README.rdoc
95
+ - Rakefile
48
96
  - lib/t2flow/dot.rb
49
97
  - lib/t2flow/model.rb
50
98
  - lib/t2flow/parser.rb
51
- - README.rdoc
52
- - LICENCE
53
- - ChangeLog.rdoc
54
- has_rdoc: true
55
- homepage: http://www.mygrid.org.uk/
99
+ - taverna-t2flow.gemspec
100
+ - test/fixtures/1000.t2flow
101
+ - test/fixtures/1001.t2flow
102
+ - test/fixtures/1002.t2flow
103
+ - test/fixtures/1003.t2flow
104
+ - test/fixtures/1004.t2flow
105
+ - test/fixtures/996.t2flow
106
+ - test/fixtures/997.t2flow
107
+ - test/fixtures/998.t2flow
108
+ - test/fixtures/999.t2flow
109
+ - test/fixtures/basic.t2flow
110
+ - test/fixtures/coordinated.t2flow
111
+ - test/fixtures/linked.t2flow
112
+ - test/fixtures/nested.t2flow
113
+ - test/fixtures/processors.t2flow
114
+ - test/run_tests.rb
115
+ - test/test_bogus_workflows.rb
116
+ - test/test_helper.rb
117
+ - test/test_starter_pack_workflows.rb
118
+ homepage: http://www.taverna.org.uk/
56
119
  licenses: []
57
-
58
120
  post_install_message:
59
- rdoc_options:
121
+ rdoc_options:
60
122
  - -N
61
123
  - --tab-width=2
62
124
  - --main=README.rdoc
63
- - --exclude='t2flow.gemspec|test'
64
- require_paths:
125
+ require_paths:
65
126
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
127
+ required_ruby_version: !ruby/object:Gem::Requirement
67
128
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 21
72
- segments:
73
- - 1
74
- - 0
75
- - 1
76
- version: 1.0.1
77
- required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
134
  none: false
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- hash: 3
83
- segments:
84
- - 0
85
- version: "0"
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
86
139
  requirements: []
87
-
88
140
  rubyforge_project:
89
- rubygems_version: 1.3.7
141
+ rubygems_version: 1.8.21
90
142
  signing_key:
91
- specification_version: 1
92
- summary: Support for interacting with the Taverna 2 workflow system (T2Flow).
93
- test_files: []
94
-
143
+ specification_version: 3
144
+ summary: Support for interacting with Taverna 2 workflows.
145
+ test_files:
146
+ - test/run_tests.rb
data/ChangeLog.rdoc DELETED
@@ -1,7 +0,0 @@
1
- = Version 0.2.0
2
- Released:: Tuesday, July 27, 2010
3
-
4
- == Changes
5
- - Updated the unit tests which can now be run by entering "ruby tests/run_tests.rb"
6
- - Misc. bug fixes.
7
- - Added the following methods to the T2Flow::Model class: coordinates, all_coordinates, name