robot_remote_server 2.5.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,5 @@
1
+ v2.5.4.1. Update README with correct info
2
+
3
+ v2.5.4. Bump version to match Robot Framework
4
+
5
+ v0.0.1. Initial copy of robotremoteserver.rb from Robot Framework's source code
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gem "echoe"
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ echoe (4.3.1)
5
+ gemcutter
6
+ rubyforge
7
+ gemcutter (0.6.1)
8
+ json_pure (1.4.6)
9
+ rubyforge (2.0.4)
10
+ json_pure (>= 1.1.7)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ echoe
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/Manifest ADDED
@@ -0,0 +1,9 @@
1
+ CHANGELOG
2
+ Gemfile
3
+ Gemfile.lock
4
+ LICENSE
5
+ Manifest
6
+ README.rdoc
7
+ Rakefile
8
+ lib/robot_remote_server.rb
9
+ robot_remote_server.gemspec
data/README.rdoc ADDED
@@ -0,0 +1,28 @@
1
+ = Robot Remote Server for the Robot Framework in Ruby
2
+
3
+ This is a Ruby gem for the Ruby implementation of RobotRemoteServer that comes with RobotFramework.
4
+
5
+ == Overview
6
+
7
+ Per its official documentation, "Robot Framework is a generic keyword-driven test automation framework." Natively, it supports testing libraries in Python and Java. However, Robot Framework also provides a "Remote Library" which allows for two things (again, per the official documentation):
8
+
9
+ * It is possible to have test libraries running on different machines than where Robot Framework itself is executed. This allows interesting possibilities for distributed testing.
10
+ * Test libraries can be implemented using any language that supports XML-RPC protocol. Robot Framework currently contains generic remote servers for Python/Jython and Ruby, and the plan is to implement generic servers for other languages like Java and Perl in the future.
11
+
12
+ == Installation
13
+
14
+ The simplest method of installation is to install the gem directly from Rubygems.org:
15
+
16
+ gem install robot_remote_server
17
+
18
+ If at some point this project is taken on by Robot Framework and they supply their own gem, that gem will be taken down from Rubygems.org. In that event, if you still want the code for this project hosted on Github, follow the following instructions.
19
+
20
+ If you want to build the gem manually with the <tt>gem</tt> command:
21
+
22
+ gem build robot_remote_server
23
+ gem install robot_remote_server-{version}.gem
24
+
25
+ If you want a simpler interface, install the <tt>echoe</tt> gem (or just run this projects Gemfile with <tt>bundle install</tt>) and execute the following:
26
+
27
+ rake build
28
+ rake install
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('robot_remote_server') do |p|
6
+ p.description = "Remote server for Robot Framework in Ruby"
7
+ p.url = "http://github.com/semperos/robot-remote-server"
8
+ p.author = "Daniel Gregoire"
9
+ p.ignore_pattern = ["tmp/*", "script/*"]
10
+ p.development_dependencies = []
11
+ end
@@ -0,0 +1,108 @@
1
+ # Copyright 2008-2009 Nokia Siemens Networks Oyj
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ require 'xmlrpc/server'
17
+ require 'xmlrpc/utils'
18
+ require 'stringio'
19
+
20
+
21
+ class RobotRemoteServer < XMLRPC::Server
22
+
23
+ def initialize(library, host='localhost', port=8270)
24
+ @library = library
25
+ super(port, host) # TODO: Disable logging to stdout
26
+ add_handler('get_keyword_names') { get_keyword_names }
27
+ add_handler('run_keyword') { |name,args| run_keyword(name, args) }
28
+ add_handler('get_keyword_arguments') { |name| get_keyword_arguments(name) }
29
+ add_handler('get_keyword_documentation') { |name| get_keyword_documentation(name) }
30
+ add_handler('stop_remote_server') { shutdown }
31
+ puts "Robot Framework remote library started at #{host}:#{port}"
32
+ serve
33
+ end
34
+
35
+ def get_keyword_names
36
+ # Implicit methods can't be used as keywords
37
+ @library.methods - Object.new.methods
38
+ end
39
+
40
+ def run_keyword(name, args)
41
+ intercept_stdout()
42
+ result = {:status=>'PASS', :return=>'', :output=>'',
43
+ :error=>'', :traceback=>''}
44
+ begin
45
+ return_value = @library.send(name, *args)
46
+ result[:return] = handle_return_value(return_value)
47
+ rescue Exception => exception
48
+ result[:status] = 'FAIL'
49
+ result[:error] = exception.message
50
+ result[:traceback] = "Traceback:\n" + exception.backtrace.join("\n")
51
+ end
52
+ result[:output] = restore_stdout
53
+ return result
54
+ end
55
+
56
+ def get_keyword_arguments(name)
57
+ # This algorithm doesn't return correct number of maximum arguments when
58
+ # args have default values. It seems that there's no easy way to get that
59
+ # information in Ruby, see e.g. http://www.ruby-forum.com/topic/147614.
60
+ # Additionally, it would be much better to return real argument names
61
+ # because that information could be used to create library documentation.
62
+ arity = @library.method(name).arity
63
+ if arity >= 0
64
+ return ['arg'] * arity
65
+ else
66
+ return ['arg'] * (arity.abs - 1) + ['*args']
67
+ end
68
+ end
69
+
70
+ def get_keyword_documentation(name)
71
+ # Is there a way to implement this? Would mainly allow creating a library
72
+ # documentation, but if real argument names are not got that's probably
73
+ # not so relevant.
74
+ ''
75
+ end
76
+
77
+ private
78
+
79
+ def handle_return_value(ret)
80
+ if [String, Integer, Fixnum, Float, TrueClass, FalseClass].include?(ret.class)
81
+ return ret
82
+ elsif ret.class == Array
83
+ return ret.collect { |item| handle_return_value(item) }
84
+ elsif ret.class == Hash
85
+ new_ret = {}
86
+ ret.each_pair { |key,value|
87
+ new_ret[key.to_s] = handle_return_value(value)
88
+ }
89
+ return new_ret
90
+ else
91
+ return ret.to_s
92
+ end
93
+ end
94
+
95
+ def intercept_stdout
96
+ $original_stdout = $stdout.dup
97
+ @output = ''
98
+ $stdout = StringIO.new(@output)
99
+ end
100
+
101
+ def restore_stdout
102
+ $save_for_close = $stdout
103
+ $stdout = $original_stdout
104
+ $save_for_close.close
105
+ return @output
106
+ end
107
+
108
+ end
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{robot_remote_server}
5
+ s.version = "2.5.4.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Daniel Gregoire"]
9
+ s.date = %q{2010-12-04}
10
+ s.description = %q{Remote server for Robot Framework in Ruby}
11
+ s.email = %q{}
12
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/robot_remote_server.rb"]
13
+ s.files = ["CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "lib/robot_remote_server.rb", "robot_remote_server.gemspec"]
14
+ s.homepage = %q{http://github.com/semperos/robot-remote-server}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Robot_remote_server", "--main", "README.rdoc"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{robot_remote_server}
18
+ s.rubygems_version = %q{1.3.7}
19
+ s.summary = %q{Remote server for Robot Framework in Ruby}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ else
27
+ end
28
+ else
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: robot_remote_server
3
+ version: !ruby/object:Gem::Version
4
+ hash: 85
5
+ prerelease: false
6
+ segments:
7
+ - 2
8
+ - 5
9
+ - 4
10
+ - 1
11
+ version: 2.5.4.1
12
+ platform: ruby
13
+ authors:
14
+ - Daniel Gregoire
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2010-12-04 00:00:00 -05:00
20
+ default_executable:
21
+ dependencies: []
22
+
23
+ description: Remote server for Robot Framework in Ruby
24
+ email: ""
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files:
30
+ - CHANGELOG
31
+ - LICENSE
32
+ - README.rdoc
33
+ - lib/robot_remote_server.rb
34
+ files:
35
+ - CHANGELOG
36
+ - Gemfile
37
+ - Gemfile.lock
38
+ - LICENSE
39
+ - Manifest
40
+ - README.rdoc
41
+ - Rakefile
42
+ - lib/robot_remote_server.rb
43
+ - robot_remote_server.gemspec
44
+ has_rdoc: true
45
+ homepage: http://github.com/semperos/robot-remote-server
46
+ licenses: []
47
+
48
+ post_install_message:
49
+ rdoc_options:
50
+ - --line-numbers
51
+ - --inline-source
52
+ - --title
53
+ - Robot_remote_server
54
+ - --main
55
+ - README.rdoc
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 11
73
+ segments:
74
+ - 1
75
+ - 2
76
+ version: "1.2"
77
+ requirements: []
78
+
79
+ rubyforge_project: robot_remote_server
80
+ rubygems_version: 1.3.7
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: Remote server for Robot Framework in Ruby
84
+ test_files: []
85
+