sirius-client 2013.4.1.0 → 2013.4.30.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +25 -9
- data/Rakefile +39 -2
- data/lib/sirius.rb +3 -2
- data/lib/sirius/internal.rb +12 -0
- data/lib/sirius/internal/InternalService.rb +17 -0
- data/lib/sirius/internal/InternalServiceClient.rb +28 -0
- data/lib/sirius/internal/InternalServiceDriver.rb +49 -0
- data/lib/sirius/internal/InternalServiceMappingRegistry.rb +48 -0
- metadata +23 -2
data/README.rdoc
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
{<img src="https://badge.fury.io/rb/sirius-client.png" alt="Gem Version" />}[http://badge.fury.io/rb/sirius-client]
|
2
|
+
|
1
3
|
= Sirius Ruby Client Overview
|
2
4
|
|
3
5
|
This is the client library for Sirius test automation platform for Ruby programming language.
|
@@ -7,14 +9,28 @@ This is the client library for Sirius test automation platform for Ruby programm
|
|
7
9
|
Ruby client library is delivered as GEM package and can be installed using the following command:
|
8
10
|
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
+
gem install sirius-client
|
13
|
+
|
12
14
|
|
13
15
|
After that the library can be accessible and can be included using
|
14
16
|
|
17
|
+
reguire 'sirius.rb'
|
18
|
+
|
19
|
+
= Dependencies
|
20
|
+
|
21
|
+
Sirius Client module is the main entry point for all other client sub-modules it includes all of them as dependencies. At the moment once you install Sirius Client module the following modules are installed as well:
|
15
22
|
|
16
|
-
|
23
|
+
* {Sirius Ruby Core Client}[https://github.com/mkolisnyk/Sirius/tree/master/sirius-ruby-client-core#sirius-ruby-core-client-overview]
|
24
|
+
* {Sirius Ruby Win32 Client}[https://github.com/mkolisnyk/Sirius/tree/master/sirius-ruby-client-win32#sirius-ruby-win32-client-overview]
|
25
|
+
* {Sirius Ruby Web Client}[https://github.com/mkolisnyk/Sirius/tree/master/sirius-ruby-web-client#sirius-ruby-web-client-overview]
|
17
26
|
|
27
|
+
That's reflected with the following Ruby gem modules installed:
|
28
|
+
|
29
|
+
* sirius-client-core
|
30
|
+
* sirius-client-win32
|
31
|
+
* sirius-client-web
|
32
|
+
|
33
|
+
Additionally main client module provides the access to internal Sirius Server endpoint which is responsible for major Server side operations handling.
|
18
34
|
|
19
35
|
= Sample usage
|
20
36
|
|
@@ -22,21 +38,21 @@ Once you have an access to Sirius Client classes you can use them as an ordinary
|
|
22
38
|
Typically you just have to initialize the connection to Sirius Server. It's done while creating new
|
23
39
|
instance of any library object. For example:
|
24
40
|
|
25
|
-
|
41
|
+
@file_client = Sirius::Client::Core::System::FileOperations.new
|
26
42
|
|
27
43
|
If you need to connect to specific instance of Sirius Server you can specify which host and port it listens to:
|
28
44
|
|
29
|
-
|
45
|
+
@file_client = Sirius::Client::Core::System::FileOperations.new "my_host","8080"
|
30
46
|
|
31
47
|
That instruction will connect to the server instance listening the http://my_host:8080 host.
|
32
48
|
|
33
49
|
By default the connection is set up for the following URL: http://localhost:21212
|
34
50
|
|
35
|
-
= Authors
|
36
|
-
|
37
|
-
Myk Kolisnyk ({kolesnik.nickolay@gmail.com}[mailto://kolesnik.nickolay@gmail.com])
|
38
|
-
|
39
51
|
= Links
|
40
52
|
|
41
53
|
* {GitHub project}[https://github.com/mkolisnyk/Sirius]
|
42
54
|
* {Dedicated blog entries}[http://mkolisnyk.blogspot.co.uk/search/label/Sirius]
|
55
|
+
|
56
|
+
= Authors
|
57
|
+
|
58
|
+
Myk Kolisnyk ({kolesnik.nickolay@gmail.com}[mailto://kolesnik.nickolay@gmail.com])
|
data/Rakefile
CHANGED
@@ -2,6 +2,10 @@ require 'rubygems'
|
|
2
2
|
require 'rubygems/package_task'
|
3
3
|
require 'cucumber'
|
4
4
|
require 'cucumber/rake/task.rb'
|
5
|
+
require 'rubygems/tasks'
|
6
|
+
require 'rubocop'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'fileutils'
|
5
9
|
|
6
10
|
spec = Gem::Specification.new do |s|
|
7
11
|
s.platform = Gem::Platform::RUBY
|
@@ -20,11 +24,44 @@ spec = Gem::Specification.new do |s|
|
|
20
24
|
s.email="kolesnik.nickolay@gmail.com"
|
21
25
|
s.add_dependency('sirius-client-core', '>= 0.0')
|
22
26
|
s.add_dependency('sirius-client-win32', '>= 0.0')
|
27
|
+
s.add_dependency('sirius-client-web', '>= 0.0')
|
23
28
|
end
|
24
29
|
|
25
|
-
|
30
|
+
task :clean do |t|
|
31
|
+
FileUtils.rm_r 'pkg', :force => true
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::TestTask.new(:install_test) do |task|
|
35
|
+
task.name = 'install_test'
|
36
|
+
task.libs << "test"
|
37
|
+
task.test_files = FileList['tests/install/**/*.rb']
|
38
|
+
task.verbose = true
|
26
39
|
end
|
27
40
|
|
28
41
|
Cucumber::Rake::Task.new(:test) do |t|
|
29
42
|
t.cucumber_opts = "tests/features --format pretty --guess"
|
30
|
-
end
|
43
|
+
end
|
44
|
+
|
45
|
+
task :rubocop do |t|
|
46
|
+
includes = Dir['lib/**/*']
|
47
|
+
excludes = Dir['lib/sirius/internal/**/*']
|
48
|
+
|
49
|
+
file_list = (includes - excludes ).reject {|fn| File.directory?(fn)}
|
50
|
+
|
51
|
+
file_list.each do |path|
|
52
|
+
sh "call rubocop -c .rubocop.yml -e #{path}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
task :saikuro do |t|
|
57
|
+
sh 'call saikuro -c -t -i lib -y 0 -w 11 -e 16 -o out/'
|
58
|
+
end
|
59
|
+
|
60
|
+
Gem::PackageTask.new(spec) do |pkg|
|
61
|
+
end
|
62
|
+
|
63
|
+
task :push => [:package] do |t|
|
64
|
+
sh "call gem push -k sirius_api_key -V pkg/#{spec.name}-#{spec.version}.gem"
|
65
|
+
end
|
66
|
+
|
67
|
+
task :all => [:clean,:rubocop,:package,:install_test]
|
data/lib/sirius.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'sirius/internal/InternalServiceDriver.rb'
|
2
|
+
|
3
|
+
module Sirius
|
4
|
+
module Client
|
5
|
+
class InternalClient
|
6
|
+
attr_accessor :internal
|
7
|
+
def initialize(host = 'localhost', port = '21212')
|
8
|
+
@internal = Internal::Internal.new("http://#{host}:#{port}/internal")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'xsd/qname'
|
2
|
+
|
3
|
+
module Sirius; module Client; module Internal
|
4
|
+
|
5
|
+
|
6
|
+
# {http:server.sirius.org/}stop
|
7
|
+
class Stop
|
8
|
+
def initialize
|
9
|
+
end
|
10
|
+
end
|
11
|
+
# {http:server.sirius.org/}stopResponse
|
12
|
+
class StopResponse
|
13
|
+
def initialize
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end; end; end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'sirius/internal/InternalServiceDriver.rb'
|
3
|
+
|
4
|
+
|
5
|
+
Sirius::Client::Internal
|
6
|
+
|
7
|
+
endpoint_url = ARGV.shift
|
8
|
+
obj = Internal.new(endpoint_url)
|
9
|
+
|
10
|
+
# run ruby with -d to see SOAP wiredumps.
|
11
|
+
obj.wiredump_dev = STDERR if $DEBUG
|
12
|
+
|
13
|
+
# SYNOPSIS
|
14
|
+
# stop(parameters)
|
15
|
+
#
|
16
|
+
# ARGS
|
17
|
+
# parameters Stop - {http://server.sirius.org/}stop
|
18
|
+
#
|
19
|
+
# RETURNS
|
20
|
+
# parameters StopResponse - {http://server.sirius.org/}stopResponse
|
21
|
+
#
|
22
|
+
parameters = nil
|
23
|
+
puts obj.stop(parameters)
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
Sirius::Client::Internal
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'sirius/internal/InternalService.rb'
|
2
|
+
require 'sirius/internal/InternalServiceMappingRegistry.rb'
|
3
|
+
require 'soap/rpc/driver.rb'
|
4
|
+
|
5
|
+
module Sirius::Client::Internal
|
6
|
+
class Internal < SOAP::RPC::Driver
|
7
|
+
|
8
|
+
DefaultEndpointUrl = "http://localhost:21212/internal"
|
9
|
+
Methods = [
|
10
|
+
[ "",
|
11
|
+
"stop",
|
12
|
+
[ [SOAP::RPC::SOAPMethod::IN, "parameters", ["::SOAP::SOAPElement", "http://server.sirius.org/", "stop"]],
|
13
|
+
[ SOAP::RPC::SOAPMethod::OUT, "parameters", ["::SOAP::SOAPElement", "http://server.sirius.org/", "stopResponse"]] ],
|
14
|
+
{ :request_style => :document, :request_use => :literal,
|
15
|
+
:response_style => :document, :response_use => :literal,
|
16
|
+
:faults => {} }
|
17
|
+
]
|
18
|
+
]
|
19
|
+
|
20
|
+
def initialize(endpoint_url = nil)
|
21
|
+
endpoint_url ||= DefaultEndpointUrl
|
22
|
+
super(endpoint_url, nil)
|
23
|
+
self.mapping_registry = InternalServiceMappingRegistry::EncodedRegistry
|
24
|
+
self.literal_mapping_registry = InternalServiceMappingRegistry::LiteralRegistry
|
25
|
+
init_methods
|
26
|
+
end
|
27
|
+
private
|
28
|
+
|
29
|
+
def init_methods
|
30
|
+
Methods.each do |definitions|
|
31
|
+
opt = definitions.last
|
32
|
+
if opt[:request_style] == :document
|
33
|
+
add_document_operation(*definitions)
|
34
|
+
else
|
35
|
+
add_rpc_operation(*definitions)
|
36
|
+
qname = definitions[0]
|
37
|
+
name = definitions[2]
|
38
|
+
if qname.name != name and qname.name.capitalize == name.capitalize
|
39
|
+
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
|
40
|
+
__send__(name, *arg)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'sirius/internal/InternalService.rb'
|
2
|
+
require 'soap/mapping'
|
3
|
+
|
4
|
+
module Sirius
|
5
|
module Client
|
1
6
|
module Internal
|
7
|
+
module InternalServiceMappingRegistry
|
8
|
+
EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
|
9
|
+
LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
|
10
|
+
NsServerSiriusOrg = "http://server.sirius.org/"
|
11
|
+
EncodedRegistry.register(
|
12
|
+
:class => Sirius::Client::Internal::Stop,
|
13
|
+
:schema_type => XSD::QName.new(NsServerSiriusOrg, "stop"),
|
14
|
+
:schema_element => []
|
15
|
+
)
|
16
|
+
|
17
|
+
EncodedRegistry.register(
|
18
|
+
:class => Sirius::Client::Internal::StopResponse,
|
19
|
+
:schema_type => XSD::QName.new(NsServerSiriusOrg, "stopResponse"),
|
20
|
+
:schema_element => []
|
21
|
+
)
|
22
|
+
|
23
|
+
LiteralRegistry.register(
|
24
|
+
:class => Sirius::Client::Internal::Stop,
|
25
|
+
:schema_type => XSD::QName.new(NsServerSiriusOrg, "stop"),
|
26
|
+
:schema_element => []
|
27
|
+
)
|
28
|
+
|
29
|
+
LiteralRegistry.register(
|
30
|
+
:class => Sirius::Client::Internal::StopResponse,
|
31
|
+
:schema_type => XSD::QName.new(NsServerSiriusOrg, "stopResponse"),
|
32
|
+
:schema_element => []
|
33
|
+
)
|
34
|
+
|
35
|
+
LiteralRegistry.register(
|
36
|
+
:class => Sirius::Client::Internal::Stop,
|
37
|
+
:schema_name => XSD::QName.new(NsServerSiriusOrg, "stop"),
|
38
|
+
:schema_element => []
|
39
|
+
)
|
40
|
+
|
41
|
+
LiteralRegistry.register(
|
42
|
+
:class => Sirius::Client::Internal::StopResponse,
|
43
|
+
:schema_name => XSD::QName.new(NsServerSiriusOrg, "stopResponse"),
|
44
|
+
:schema_element => []
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sirius-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2013.4.
|
4
|
+
version: 2013.4.30.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sirius-client-core
|
@@ -43,12 +43,33 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sirius-client-web
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.0'
|
46
62
|
description: ! "\n The core ruby client part for Sirius system. \n "
|
47
63
|
email: kolesnik.nickolay@gmail.com
|
48
64
|
executables: []
|
49
65
|
extensions: []
|
50
66
|
extra_rdoc_files: []
|
51
67
|
files:
|
68
|
+
- lib/sirius/internal/InternalService.rb
|
69
|
+
- lib/sirius/internal/InternalServiceClient.rb
|
70
|
+
- lib/sirius/internal/InternalServiceDriver.rb
|
71
|
+
- lib/sirius/internal/InternalServiceMappingRegistry.rb
|
72
|
+
- lib/sirius/internal.rb
|
52
73
|
- lib/sirius.rb
|
53
74
|
- Rakefile
|
54
75
|
- README.rdoc
|