win32-service 0.6.1-x86-mswin32-60
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.
- data/CHANGES +217 -0
- data/MANIFEST +18 -0
- data/README +44 -0
- data/doc/daemon.txt +155 -0
- data/doc/service.txt +365 -0
- data/lib/win32/daemon.so +0 -0
- data/lib/win32/service.rb +1579 -0
- data/test/tc_daemon.rb +55 -0
- data/test/tc_service.rb +260 -0
- data/test/tc_service_create.rb +83 -0
- data/test/tc_service_info.rb +170 -0
- data/test/tc_service_status.rb +108 -0
- metadata +80 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
########################################################################
|
2
|
+
# tc_service_status.rb
|
3
|
+
#
|
4
|
+
# Test case for the Struct::ServiceStatus struct.
|
5
|
+
########################################################################
|
6
|
+
require 'win32/service'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Struct_ServiceStatus < Test::Unit::TestCase
|
10
|
+
def setup
|
11
|
+
@service_name = 'Schedule'
|
12
|
+
@service_stat = Win32::Service.status(@service_name)
|
13
|
+
|
14
|
+
@types = [
|
15
|
+
'file system driver',
|
16
|
+
'kernel driver',
|
17
|
+
'own process',
|
18
|
+
'share process',
|
19
|
+
'recognizer token',
|
20
|
+
'driver',
|
21
|
+
'win32',
|
22
|
+
'all',
|
23
|
+
'own process, interactive',
|
24
|
+
'share process, interactive',
|
25
|
+
nil
|
26
|
+
]
|
27
|
+
|
28
|
+
@states = [
|
29
|
+
'continue pending',
|
30
|
+
'pause pending',
|
31
|
+
'paused',
|
32
|
+
'running',
|
33
|
+
'start pending',
|
34
|
+
'stop pending',
|
35
|
+
'stopped',
|
36
|
+
nil
|
37
|
+
]
|
38
|
+
|
39
|
+
@controls = [
|
40
|
+
'netbind change',
|
41
|
+
'param change',
|
42
|
+
'pause continue',
|
43
|
+
'shutdown',
|
44
|
+
'stop',
|
45
|
+
'hardware profile change',
|
46
|
+
'power event',
|
47
|
+
'session change',
|
48
|
+
nil
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_service_status_service_type
|
53
|
+
assert_respond_to(@service_stat, :service_type)
|
54
|
+
assert(@types.include?(@service_stat.service_type))
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_service_status_current_state
|
58
|
+
assert_respond_to(@service_stat, :current_state)
|
59
|
+
assert(@states.include?(@service_stat.current_state))
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_service_status_controls_accepted
|
63
|
+
assert_respond_to(@service_stat, :controls_accepted)
|
64
|
+
assert(@controls.include?(@service_stat.controls_accepted))
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_service_status_win32_exit_code
|
68
|
+
assert_respond_to(@service_stat, :win32_exit_code)
|
69
|
+
assert_kind_of(Fixnum, @service_stat.win32_exit_code)
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_service_status_service_specific_exit_code
|
73
|
+
assert_respond_to(@service_stat, :service_specific_exit_code)
|
74
|
+
assert_kind_of(Fixnum, @service_stat.service_specific_exit_code)
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_service_status_check_point
|
78
|
+
assert_respond_to(@service_stat, :check_point)
|
79
|
+
assert_kind_of(Fixnum, @service_stat.check_point)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_service_status_wait_hint
|
83
|
+
assert_respond_to(@service_stat, :wait_hint)
|
84
|
+
assert_kind_of(Fixnum, @service_stat.wait_hint)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_service_status_interactive
|
88
|
+
assert_respond_to(@service_stat, :interactive)
|
89
|
+
assert([true, false].include?(@service_stat.interactive))
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_service_status_pid
|
93
|
+
assert_respond_to(@service_stat, :pid)
|
94
|
+
assert_kind_of(Fixnum, @service_stat.pid)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_service_status_service_flags
|
98
|
+
assert_respond_to(@service_stat, :service_flags)
|
99
|
+
assert_kind_of(Fixnum, @service_stat.service_flags)
|
100
|
+
end
|
101
|
+
|
102
|
+
def teardown
|
103
|
+
@service_stat = nil
|
104
|
+
@types = nil
|
105
|
+
@states = nil
|
106
|
+
@controls = nil
|
107
|
+
end
|
108
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: win32-service
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.1
|
5
|
+
platform: x86-mswin32-60
|
6
|
+
authors:
|
7
|
+
- Daniel J. Berger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-01-01 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: windows-pr
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.7.3
|
23
|
+
version:
|
24
|
+
description: An library for controlling and creating MS Windows services
|
25
|
+
email: djberg96@gmail.com
|
26
|
+
executables: []
|
27
|
+
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files:
|
31
|
+
- CHANGES
|
32
|
+
- README
|
33
|
+
- MANIFEST
|
34
|
+
- doc/service.txt
|
35
|
+
- doc/daemon.txt
|
36
|
+
files:
|
37
|
+
- doc/daemon.txt
|
38
|
+
- doc/service.txt
|
39
|
+
- test/tc_daemon.rb
|
40
|
+
- test/tc_service.rb
|
41
|
+
- test/tc_service_create.rb
|
42
|
+
- test/tc_service_info.rb
|
43
|
+
- test/tc_service_status.rb
|
44
|
+
- lib/win32/daemon.so
|
45
|
+
- lib/win32/service.rb
|
46
|
+
- CHANGES
|
47
|
+
- README
|
48
|
+
- MANIFEST
|
49
|
+
has_rdoc: true
|
50
|
+
homepage: http://www.rubyforge.org/projects/win32utils
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.8.2
|
61
|
+
version:
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
version:
|
68
|
+
requirements: []
|
69
|
+
|
70
|
+
rubyforge_project: win32utils
|
71
|
+
rubygems_version: 1.0.1
|
72
|
+
signing_key:
|
73
|
+
specification_version: 2
|
74
|
+
summary: An library for controlling and creating MS Windows services
|
75
|
+
test_files:
|
76
|
+
- test/tc_daemon.rb
|
77
|
+
- test/tc_service.rb
|
78
|
+
- test/tc_service_create.rb
|
79
|
+
- test/tc_service_info.rb
|
80
|
+
- test/tc_service_status.rb
|