spectools 1.0.0
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/CHANGELOG.txt +1 -0
- data/Manifest.txt +80 -0
- data/README.txt +33 -0
- data/README.vnmsh.txt +39 -0
- data/Rakefile +42 -0
- data/TODO +5 -0
- data/lib/spectools.rb +588 -0
- data/lib/spectools/version.rb +9 -0
- data/lib/vnmsh.rb +1930 -0
- data/test/data/connect.success +8 -0
- data/test/data/create.alarm +2 -0
- data/test/data/create.association +1 -0
- data/test/data/create.model +1 -0
- data/test/data/create.model.ip +1 -0
- data/test/data/destroy.alarm +1 -0
- data/test/data/destroy.association +1 -0
- data/test/data/destroy.model +9 -0
- data/test/data/seek +2 -0
- data/test/data/seek.-s +17 -0
- data/test/data/show.alarms +10 -0
- data/test/data/show.alarms-a +11 -0
- data/test/data/show.alarms-a-x +22 -0
- data/test/data/show.alarms-x +20 -0
- data/test/data/show.alarms.mh +1 -0
- data/test/data/show.associations +160 -0
- data/test/data/show.attributes +909 -0
- data/test/data/show.attributes.attr +2 -0
- data/test/data/show.attributes.attriid +2 -0
- data/test/data/show.attributes.attrname +6 -0
- data/test/data/show.attributes.attrr +14 -0
- data/test/data/show.attributes.enum +2 -0
- data/test/data/show.attributes.flags +16 -0
- data/test/data/show.attributes.mth +242 -0
- data/test/data/show.attributes.mth.attrr +12 -0
- data/test/data/show.children +47 -0
- data/test/data/show.children.rel +14 -0
- data/test/data/show.devices +21 -0
- data/test/data/show.enumerations +142383 -0
- data/test/data/show.enumerations.attr +4 -0
- data/test/data/show.enumerations.mth +149 -0
- data/test/data/show.events +2001 -0
- data/test/data/show.events-a +10001 -0
- data/test/data/show.events-n5 +6 -0
- data/test/data/show.events-x-n5 +21 -0
- data/test/data/show.inheritance +12 -0
- data/test/data/show.landscapes +3 -0
- data/test/data/show.models +2252 -0
- data/test/data/show.models.mhr +18 -0
- data/test/data/show.models.mname +4 -0
- data/test/data/show.models.mth +4 -0
- data/test/data/show.parents +6 -0
- data/test/data/show.relations +151 -0
- data/test/data/show.rules +5838 -0
- data/test/data/show.types +4210 -0
- data/test/data/show.types.flags +3137 -0
- data/test/data/show.types.mthr +55 -0
- data/test/data/show.types.mtname +2 -0
- data/test/data/show.watch +9 -0
- data/test/data/test.reconnect +1 -0
- data/test/data/update.alarm +1 -0
- data/test/data/update.model +3 -0
- data/test/test_helper.rb +2 -0
- data/test/test_spectools.rb +403 -0
- data/test/test_vnmsh.rb +1537 -0
- data/test/testcmds/ack +1 -0
- data/test/testcmds/connect +32 -0
- data/test/testcmds/create +34 -0
- data/test/testcmds/destroy +36 -0
- data/test/testcmds/disconnect +7 -0
- data/test/testcmds/seek +18 -0
- data/test/testcmds/show +243 -0
- data/test/testcmds/update +12 -0
- data/test/vnmsh/ack +1 -0
- data/test/vnmsh/connect +5 -0
- data/test/vnmsh/create +1 -0
- data/test/vnmsh/destroy +1 -0
- data/test/vnmsh/disconnect +1 -0
- data/test/vnmsh/seek +3 -0
- data/test/vnmsh/show +1 -0
- data/test/vnmsh/update +1 -0
- metadata +134 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
Handle Name Flags
|
2
|
+
0x13d0005 Top_Sw V,I,N,U,R
|
3
|
+
0x13d0008 Create_MF V,D
|
4
|
+
0x13d000a Project V,I
|
5
|
+
0x13d000b BusinessFunc V,I
|
6
|
+
0x13d000c SwApplication V,I,D
|
7
|
+
0x13d000d RollUp_MF V,D
|
8
|
+
0x13d000e Top_Project V,I,N,U,R
|
9
|
+
0x13d000f Top_BFunc V,I,N,U,R
|
10
|
+
0x13d0010 BusinessProc V,I
|
11
|
+
0x13d0011 ICS_GmbH V,D
|
12
|
+
0x13d0013 ReqResource V,I,D
|
13
|
+
0x13d0014 ProjectMember V,I
|
14
|
+
0x13d0017 TopSwConnector V,D
|
15
|
+
0x13d0018 Service V,I,D
|
16
|
+
0x13d0019 Top_Service V,I,N,U,R
|
17
|
+
0x13d001a Destroy_MF V,D
|
18
|
+
0x13d001b SLA V,I
|
19
|
+
0x13d001c Top_SLA V,I,N,U,R
|
20
|
+
0x13d001d SLA_Container V,I
|
21
|
+
0x13d001e CondTimer_MF V,D
|
22
|
+
0x13d001f MirrorService V,I
|
23
|
+
0x13d0020 Monitor V,D
|
24
|
+
0x13d0021 ServiceCatalog V,I,N,U,R
|
25
|
+
0x13d0022 CService V,I
|
26
|
+
0x13d0023 ResourceMgr V
|
27
|
+
0x13d0024 ICSMAP_MF V,D
|
28
|
+
0x13d0025 Mirror_MF V,D
|
29
|
+
0x13d0026 AlarmCountMon V,I
|
30
|
+
0x13d0027 DownTimeMon V,I
|
31
|
+
0x13d0028 TTRMonitor V,I
|
32
|
+
0x13d0029 CostMonitor V,I
|
33
|
+
0x13d002a BCM_S_Bas_Lic V,D
|
34
|
+
0x13d002b BCM_M_Bas_Lic V,D
|
35
|
+
0x13d002c BCM_S_Bus_Lic V,D
|
36
|
+
0x13d002d BCM_M_Bus_Lic V,D
|
37
|
+
0x13d002e BCM_S_BVC_Lic V,D
|
38
|
+
0x13d002f BCM_M_BVC_Lic V,D
|
39
|
+
0x13d0030 IcsAppl_MF V,D
|
40
|
+
0x13d0032 SubAgent V,D
|
41
|
+
0x13d0033 ICSRequires V,D
|
42
|
+
0x13d0034 ICSSLARels V
|
43
|
+
0x13d0035 ICSCollectsSw V
|
44
|
+
0x13d0038 IcsSecurity_NotUsedAnymore V
|
45
|
+
0x13d0039 Top_Customer V,I,N,U,R
|
46
|
+
0x13d003a Top_Provider V,I,N,U,R
|
47
|
+
0x13d003b Top_Supplier V,I,N,U,R
|
48
|
+
0x13d003c Customer V,I
|
49
|
+
0x13d003d Provider V,I
|
50
|
+
0x13d003e Supplier V,I
|
51
|
+
0x13d003f ProjectMF V,D
|
52
|
+
0x13d0040 Activity V,I
|
53
|
+
0x13d0041 MaintenanceMF V,D
|
54
|
+
0x13d0042 Capacity_MF V,D
|
55
|
+
0x13d007f BIMLAB V,D
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Watch_Id Watch_Name Watch_Type Watch_Status
|
2
|
+
0x13d0190 TotalRedTime PollLog/Calc ACTIVE
|
3
|
+
0x13d01aa TotalOrangeTime PollLog/Calc ACTIVE
|
4
|
+
0x13d0323 LoggedCapacity PollLog/Calc ACTIVE
|
5
|
+
0x13d018c TotalGreenTime PollLog/Calc ACTIVE
|
6
|
+
0x13d0194 TotalUnknownTime PollLog/Calc ACTIVE
|
7
|
+
0x13d008d QoS PollLog/Calc ACTIVE
|
8
|
+
0x13d018e TotalYellowTime PollLog/Calc ACTIVE
|
9
|
+
0x13d01ae TotalMaintTime PollLog/Calc ACTIVE
|
@@ -0,0 +1 @@
|
|
1
|
+
reconnect
|
@@ -0,0 +1 @@
|
|
1
|
+
update: successful
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,403 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
require 'tmpdir.rb'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
class TestSpectool < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
ENV['TESTDATA'] = Dir.pwd + '/test/data/'
|
9
|
+
@attrid = "0x00000"
|
10
|
+
@attrname = "Test Attribute"
|
11
|
+
@attriid = 1
|
12
|
+
@attrvalue = "Test Attr Value"
|
13
|
+
@attrenums = [ 'Good', 'Bad' ]
|
14
|
+
@attrtype = "Text String"
|
15
|
+
@attrexternal = true
|
16
|
+
@attrreadable = true
|
17
|
+
@attrwriteable = true
|
18
|
+
@attrshared = true
|
19
|
+
@attrlist = true
|
20
|
+
@attrguaranteed = true
|
21
|
+
@attrglobal = true
|
22
|
+
@attrpolled = true
|
23
|
+
@attrlogged = true
|
24
|
+
@attrmemory = true
|
25
|
+
@attrdatabase = true
|
26
|
+
@attrpreserve = true
|
27
|
+
@attrvalue_table = { '1.1','test_val1','1','test_val2' }
|
28
|
+
@modelname = "Test Model"
|
29
|
+
@modelhandle = "0x10000"
|
30
|
+
@mtname = "Test Model Type"
|
31
|
+
@mthandle = "0x20000"
|
32
|
+
@mtvisible = true
|
33
|
+
@mtderivable = true
|
34
|
+
@mtinstantiable = true
|
35
|
+
@mtdestroy = false
|
36
|
+
@mtunique = true
|
37
|
+
@mtrequired = true
|
38
|
+
@mtinheritance = 'Base'
|
39
|
+
@relname = "Test Relation"
|
40
|
+
@reltype = "ONE_TO_MANY"
|
41
|
+
@alarmid = "0x30000"
|
42
|
+
@alarmtime = Time.local(2007,1,2,11,59,30)
|
43
|
+
@alarmcauseid = "0x40000"
|
44
|
+
@alarmseverity = "MINOR"
|
45
|
+
@alarmack = true
|
46
|
+
@alarmstale = true
|
47
|
+
@alarmassign = "Test Person"
|
48
|
+
@alarmstatus = "Test Status"
|
49
|
+
@alarmcause = "Test Cause"
|
50
|
+
@alarmurl = "http://www.test.com"
|
51
|
+
@alarmticket = "ticket12345"
|
52
|
+
@ssname = "test.ss.com"
|
53
|
+
@lscapeprecedence = 10
|
54
|
+
@lscapeport = "0xbeef"
|
55
|
+
@lscapeservice = "0x10101"
|
56
|
+
@lscapehandle = "0x400000"
|
57
|
+
@eventtime = Time.local(2007,2,3,11,59,30)
|
58
|
+
@eventtype = "0x800000"
|
59
|
+
@eventmessage = "Test Message"
|
60
|
+
@watchid = '0x100000'
|
61
|
+
@watchname = 'Test watch'
|
62
|
+
@watchtype = 'Calc'
|
63
|
+
@watchstatus = 'INITIAL'
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_default_access_method
|
70
|
+
assert_nil SpecTools::Config.default_access_method
|
71
|
+
assert SpecTools::Config.default_access_method = :test_access_method
|
72
|
+
assert_equal :test_access_method, SpecTools::Config.default_access_method
|
73
|
+
assert_nil SpecTools::Config.default_access_method = nil
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
def test_valid_hex
|
80
|
+
assert_equal false, "Test String".hex?
|
81
|
+
assert_equal true, "0xfffff".hex?
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_init_attr
|
85
|
+
sattr = SpecTools::Attr.new
|
86
|
+
assert_nil sattr.id
|
87
|
+
assert_nil sattr.name
|
88
|
+
assert_nil sattr.value
|
89
|
+
assert_nil sattr.type
|
90
|
+
assert_nil sattr.enums
|
91
|
+
assert_nil sattr.value_table
|
92
|
+
assert_equal false, sattr.external
|
93
|
+
assert_equal false, sattr.readable
|
94
|
+
assert_equal false, sattr.writeable
|
95
|
+
assert_equal false, sattr.shared
|
96
|
+
assert_equal false, sattr.list
|
97
|
+
assert_equal false, sattr.guaranteed
|
98
|
+
assert_equal false, sattr.global
|
99
|
+
assert_equal false, sattr.memory
|
100
|
+
assert_equal false, sattr.database
|
101
|
+
assert_equal false, sattr.polled
|
102
|
+
assert_equal false, sattr.preserve
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_init_attr_args
|
106
|
+
sattr = SpecTools::Attr.new(@attrid,@attrname,nil,@attrvalue_table,@attrenums,@attrlist,@attrtype,@attrexternal,@attrreadable,@attrwriteable,@attrshared,@attrguaranteed,@attrglobal,@attrmemory,@attrdatabase,@attrpolled,@attrlogged,@attrpreserve)
|
107
|
+
assert_equal @attrid, sattr.id
|
108
|
+
assert_equal @attrname, sattr.name
|
109
|
+
assert_equal @attrvalue_table, sattr.value_table
|
110
|
+
assert_same @attrenums, sattr.enums
|
111
|
+
assert_equal @attrtype, sattr.type
|
112
|
+
assert_equal @attrexternal, sattr.external
|
113
|
+
assert_equal @attrreadable, sattr.readable
|
114
|
+
assert_equal @attrwriteable, sattr.writeable
|
115
|
+
assert_equal @attrshared, sattr.shared
|
116
|
+
assert_equal @attrlist, sattr.list
|
117
|
+
assert_equal @attrguaranteed, sattr.guaranteed
|
118
|
+
assert_equal @attrglobal, sattr.global
|
119
|
+
assert_equal @attrmemory, sattr.memory
|
120
|
+
assert_equal @attrdatabase, sattr.database
|
121
|
+
assert_equal @attrpolled, sattr.polled
|
122
|
+
assert_equal @attrlogged, sattr.logged
|
123
|
+
assert_equal @attrpreserve, sattr.preserve
|
124
|
+
assert_raise ArgumentError do
|
125
|
+
SpecTools::Attr.new("bogus")
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_attr_value_table
|
130
|
+
specattr = SpecTools::Attr.new
|
131
|
+
assert_nothing_raised do
|
132
|
+
specattr.list=true
|
133
|
+
specattr.value_table = @attrvalue_table
|
134
|
+
assert_same @attrvalue_table, specattr.value_table
|
135
|
+
assert_equal 'test_val1', specattr.value_table['1.1']
|
136
|
+
assert_equal 'test_val2', specattr.value
|
137
|
+
end
|
138
|
+
|
139
|
+
specattr = SpecTools::Attr.new
|
140
|
+
assert_raise SpecTools::InvalidValueTypeError do
|
141
|
+
specattr.value_table = @attrvalue_table
|
142
|
+
end
|
143
|
+
assert_raise SpecTools::InvalidValueTypeError do
|
144
|
+
specattr.list = true
|
145
|
+
specattr.value = 'bogus'
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
|
150
|
+
def test_attr_enumerations
|
151
|
+
specattr = SpecTools::Attr.new
|
152
|
+
specattr.value = '1'
|
153
|
+
assert_equal '1',specattr.enumerate
|
154
|
+
specattr.enumerate!
|
155
|
+
assert_equal '1',specattr.value
|
156
|
+
specattr.enums = { '1','test_enum' }
|
157
|
+
assert_equal 'test_enum',specattr.enumerate
|
158
|
+
specattr.enumerate!
|
159
|
+
assert_equal 'test_enum',specattr.value
|
160
|
+
|
161
|
+
end
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
def test_arbitrary_method
|
166
|
+
specattr = SpecTools::Attr.new
|
167
|
+
assert_raise NoMethodError do
|
168
|
+
specattr.test_method
|
169
|
+
end
|
170
|
+
SpecTools::Config.default_access_method = :test
|
171
|
+
assert_raise NoMethodError do
|
172
|
+
specattr.test_method
|
173
|
+
end
|
174
|
+
SpecTools::Config.default_access_method = nil
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
def test_init_mtype
|
179
|
+
mtype = SpecTools::MType.new
|
180
|
+
assert_nil mtype.name
|
181
|
+
assert_nil mtype.handle
|
182
|
+
assert_equal false, mtype.visible
|
183
|
+
assert_equal false, mtype.instantiable
|
184
|
+
assert_equal false, mtype.derivable
|
185
|
+
assert_equal true, mtype.destroyable
|
186
|
+
assert_equal false, mtype.unique
|
187
|
+
assert_equal false, mtype.required
|
188
|
+
assert_nil mtype.inheritance
|
189
|
+
assert_instance_of Hash, mtype.attrs
|
190
|
+
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_init_mtype_args
|
194
|
+
attr1 = SpecTools::Attr.new('0x01','test')
|
195
|
+
attr2 = SpecTools::Attr.new(@attrid,@attrname)
|
196
|
+
mtype = SpecTools::MType.new(@mthandle,@mtname,[attr1,attr2],@mtvisible,@mtinstantiable,@mtderivable,@mtdestroy,@mtunique,@mtrequired,@mtinheritance)
|
197
|
+
assert_equal @mthandle, mtype.handle
|
198
|
+
assert_equal @mtname, mtype.name
|
199
|
+
assert_equal @mtvisible, mtype.visible
|
200
|
+
assert_equal @mtinstantiable, mtype.instantiable
|
201
|
+
assert_equal @mtderivable, mtype.derivable
|
202
|
+
assert_equal @mtdestroy, mtype.destroyable
|
203
|
+
assert_equal @mtunique, mtype.unique
|
204
|
+
assert_equal @mtrequired, mtype.required
|
205
|
+
assert_equal @mtinheritance, mtype.inheritance
|
206
|
+
assert_same attr1, mtype.attrs[attr1.id]
|
207
|
+
assert_same attr2, mtype.attrs[attr2.id]
|
208
|
+
assert_raise ArgumentError do
|
209
|
+
SpecTools::MType.new("bogus")
|
210
|
+
end
|
211
|
+
assert_raise ArgumentError do
|
212
|
+
SpecTools::MType.new(nil,nil,["notanattr"])
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_set_mtype_attrs
|
217
|
+
mtype = MType.new
|
218
|
+
attr1 = SpecTools::Attr.new('0x01','test')
|
219
|
+
attr2 = SpecTools::Attr.new(@attrid,@attrname)
|
220
|
+
mtype.attrs = [attr1,attr2]
|
221
|
+
assert_same attr1, mtype.attrs[attr1.id]
|
222
|
+
assert_same attr2, mtype.attrs[attr2.id]
|
223
|
+
assert_raise ArgumentError do
|
224
|
+
mtype.attrs = 'bogus'
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
def test_init_model
|
232
|
+
smodel = SpecTools::Model.new
|
233
|
+
assert_nil smodel.name
|
234
|
+
assert_nil smodel.handle
|
235
|
+
assert_instance_of SpecTools::MType, smodel.type
|
236
|
+
assert_equal Hash.new, smodel.attrs
|
237
|
+
end
|
238
|
+
|
239
|
+
def test_init_model_args
|
240
|
+
attr1 = SpecTools::Attr.new
|
241
|
+
attr2 = SpecTools::Attr.new(@attrid,@attrname)
|
242
|
+
mtype = SpecTools::MType.new(@mthandle,@mtname)
|
243
|
+
smodel = SpecTools::Model.new(@modelhandle, @modelname, mtype, attr1, attr2)
|
244
|
+
assert_equal @modelhandle, smodel.handle
|
245
|
+
assert_same mtype, smodel.type
|
246
|
+
assert_same attr1, smodel.attrs[attr1.id]
|
247
|
+
assert_same attr2, smodel.attrs[attr2.id]
|
248
|
+
end
|
249
|
+
|
250
|
+
def test_init_relation
|
251
|
+
relation = SpecTools::Relation.new
|
252
|
+
assert_nil relation.name
|
253
|
+
assert_nil relation.type
|
254
|
+
end
|
255
|
+
|
256
|
+
def test_init_relation_args
|
257
|
+
relation = SpecTools::Relation.new(@relname,@reltype)
|
258
|
+
assert_equal @relname, relation.name
|
259
|
+
assert_equal @reltype, relation.type
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_init_association
|
263
|
+
association = SpecTools::Association.new
|
264
|
+
assert_instance_of SpecTools::Model, association.left_model
|
265
|
+
assert_instance_of SpecTools::Model, association.right_model
|
266
|
+
assert_instance_of SpecTools::Relation, association.relation
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_init_association_args
|
270
|
+
leftmodel = SpecTools::Model.new(@modelhandle,@modelname)
|
271
|
+
rightmodel = SpecTools::Model.new(@modelhandle,@modelname)
|
272
|
+
relation = SpecTools::Relation.new(@relname)
|
273
|
+
association = SpecTools::Association.new(leftmodel, rightmodel, relation)
|
274
|
+
assert_same leftmodel, association.left_model
|
275
|
+
assert_same rightmodel, association.right_model
|
276
|
+
assert_same relation, association.relation
|
277
|
+
end
|
278
|
+
|
279
|
+
def test_init_alarm
|
280
|
+
alarm = SpecTools::Alarm.new
|
281
|
+
assert_nil alarm.id
|
282
|
+
assert_nil alarm.time
|
283
|
+
assert_nil alarm.causeid
|
284
|
+
assert_instance_of SpecTools::Model, alarm.model
|
285
|
+
assert_nil alarm.severity
|
286
|
+
assert_equal false, alarm.ack
|
287
|
+
assert_equal false, alarm.stale
|
288
|
+
assert_nil alarm.assignment
|
289
|
+
assert_nil alarm.status
|
290
|
+
assert_nil alarm.message
|
291
|
+
assert_nil alarm.url
|
292
|
+
assert_nil alarm.ticket
|
293
|
+
end
|
294
|
+
|
295
|
+
def test_init_alarm_args
|
296
|
+
testmodel = SpecTools::Model.new(@modelhandle, @modelname, SpecTools::MType.new(nil,@mtname))
|
297
|
+
alarm = SpecTools::Alarm.new(@alarmid, @alarmtime, @alarmcauseid, testmodel, @alarmseverity, @alarmack, @alarmstale, @alarmassign, @alarmstatus,@alarmcause,@alarmurl,@alarmticket)
|
298
|
+
assert_equal @alarmid, alarm.id
|
299
|
+
assert_equal @alarmtime, alarm.time
|
300
|
+
assert_equal @alarmcauseid, alarm.causeid
|
301
|
+
assert_same testmodel,alarm.model
|
302
|
+
assert_equal @alarmseverity, alarm.severity
|
303
|
+
assert_equal @alarmack, alarm.ack
|
304
|
+
assert_equal @alarmstale, alarm.stale
|
305
|
+
assert_equal @alarmassign, alarm.assignment
|
306
|
+
assert_equal @alarmstatus, alarm.status
|
307
|
+
assert_equal @alarmcause, alarm.message
|
308
|
+
assert_equal @alarmurl, alarm.url
|
309
|
+
assert_equal @alarmticket, alarm.ticket
|
310
|
+
assert_raise ArgumentError do
|
311
|
+
SpecTools::Alarm.new(nil,nil,"bogus")
|
312
|
+
end
|
313
|
+
assert_raise ArgumentError do
|
314
|
+
SpecTools::Alarm.new(nil,nil,nil,"bogus")
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
def test_init_landscape
|
319
|
+
landscape = SpecTools::Landscape.new
|
320
|
+
assert_nil landscape.ss
|
321
|
+
assert_nil landscape.precedence
|
322
|
+
assert_nil landscape.port
|
323
|
+
assert_nil landscape.service
|
324
|
+
assert_nil landscape.handle
|
325
|
+
end
|
326
|
+
|
327
|
+
def test_init_landscape_args
|
328
|
+
landscape = SpecTools::Landscape.new(@lscapehandle,@ssname,@lscapeprecedence,@lscapeport,@lscapeservice)
|
329
|
+
assert_equal @ssname, landscape.ss
|
330
|
+
assert_equal @lscapeprecedence, landscape.precedence
|
331
|
+
assert_equal @lscapeport, landscape.port
|
332
|
+
assert_equal @lscapeservice, landscape.service
|
333
|
+
assert_equal @lscapehandle, landscape.handle
|
334
|
+
assert_raise ArgumentError do
|
335
|
+
SpecTools::Landscape.new("bogus",nil,nil,nil,nil)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
def test_init_event
|
340
|
+
event = SpecTools::Event.new
|
341
|
+
assert_nil event.time
|
342
|
+
assert_nil event.type
|
343
|
+
assert_equal '', event.message
|
344
|
+
assert_instance_of SpecTools::Model, event.model
|
345
|
+
end
|
346
|
+
|
347
|
+
def test_init_event_args
|
348
|
+
model = SpecTools::Model.new(@modelhandle,@modelname)
|
349
|
+
event = SpecTools::Event.new(@eventtime,@eventtype,model,@eventmessage)
|
350
|
+
assert_equal @eventtime, event.time
|
351
|
+
assert_equal @eventtype, event.type
|
352
|
+
assert_equal @eventmessage, event.message
|
353
|
+
assert_same model, event.model
|
354
|
+
assert_raise ArgumentError do
|
355
|
+
SpecTools::Event.new(nil,"bogus")
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
def test_init_rule
|
360
|
+
rule = SpecTools::Rule.new
|
361
|
+
assert_instance_of SpecTools::MType, rule.left_mtype
|
362
|
+
assert_instance_of SpecTools::MType, rule.right_mtype
|
363
|
+
end
|
364
|
+
|
365
|
+
def test_init_rule_args
|
366
|
+
mtype1 = SpecTools::MType.new
|
367
|
+
mtype2 = SpecTools::MType.new
|
368
|
+
rule = SpecTools::Rule.new(mtype1,mtype2)
|
369
|
+
assert_same mtype1, rule.left_mtype
|
370
|
+
assert_same mtype2, rule.right_mtype
|
371
|
+
end
|
372
|
+
|
373
|
+
def test_watch_init
|
374
|
+
watch = SpecTools::Watch.new
|
375
|
+
assert_nil watch.id
|
376
|
+
assert_nil watch.type
|
377
|
+
assert_nil watch.status
|
378
|
+
end
|
379
|
+
|
380
|
+
def test_watch_init_args
|
381
|
+
watch = SpecTools::Watch.new(@watchid,@watchname,@watchtype,@watchstatus)
|
382
|
+
assert_equal @watchid, watch.id
|
383
|
+
assert_equal @watchname, watch.name
|
384
|
+
assert_equal @watchtype, watch.type
|
385
|
+
assert_equal @watchstatus, watch.status
|
386
|
+
end
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
end
|