testability-driver 1.1.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/config/sut_parameters.rb +21 -8
- data/config/tdriver_custom_error_recovery.rb +83 -0
- data/ext/extconf.rb +3 -2
- data/ext/native_extensions.c +60 -2
- data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +2 -105
- data/lib/tdriver/base/behaviour/factory.rb +154 -89
- data/lib/tdriver/base/behaviour/factory_new.rb +409 -0
- data/lib/tdriver/base/errors.rb +3 -3
- data/lib/tdriver/base/state_object.rb +85 -22
- data/lib/tdriver/base/sut/adapter.rb +26 -0
- data/lib/tdriver/base/sut/controller.rb +1 -1
- data/lib/tdriver/base/sut/generic/behaviours/application.rb +89 -118
- data/lib/tdriver/base/sut/generic/behaviours/find.rb +67 -62
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +296 -187
- data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +7 -7
- data/lib/tdriver/base/sut/generic/commands/application.rb +366 -295
- data/lib/tdriver/base/sut/sut.rb +19 -3
- data/lib/tdriver/base/test_object/abstract.rb +41 -21
- data/lib/tdriver/base/test_object/adapter.rb +62 -9
- data/lib/tdriver/base/test_object/behaviours/syncronization.rb +10 -6
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +84 -47
- data/lib/tdriver/base/test_object/factory.rb +124 -68
- data/lib/tdriver/base/test_object/loader.rb +3 -4
- data/lib/tdriver/base/test_object/verification.rb +3 -3
- data/lib/tdriver/base/test_object/xml/adapter.rb +734 -0
- data/lib/tdriver/loader.rb +12 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +3 -2
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +14 -14
- data/lib/tdriver/report/report.rb +4 -8
- data/lib/tdriver/report/report_api.rb +9 -0
- data/lib/tdriver/report/report_crash_file_capture.rb +4 -4
- data/lib/tdriver/report/report_creator.rb +57 -35
- data/lib/tdriver/report/report_cucumber.rb +1 -1
- data/lib/tdriver/report/report_cucumber_listener.rb +5 -158
- data/lib/tdriver/report/report_cucumber_reporter.rb +7 -161
- data/lib/tdriver/report/report_execution_statistics.rb +4 -4
- data/lib/tdriver/report/report_file_capture.rb +5 -5
- data/lib/tdriver/report/report_grouping.rb +24 -22
- data/lib/tdriver/report/report_junit_xml.rb +5 -5
- data/lib/tdriver/report/report_test_case_run.rb +31 -22
- data/lib/tdriver/report/report_test_run.rb +107 -104
- data/lib/tdriver/report/report_writer.rb +150 -83
- data/lib/tdriver/tdriver.rb +147 -103
- data/lib/tdriver/util/common/boolean.rb +51 -0
- data/lib/tdriver/util/common/crc16.rb +110 -68
- data/lib/tdriver/util/common/hash.rb +63 -7
- data/lib/tdriver/util/common/kernel.rb +46 -1
- data/lib/tdriver/util/common/loader.rb +1 -0
- data/lib/tdriver/util/common/object.rb +20 -8
- data/lib/tdriver/util/common/string.rb +21 -2
- data/lib/tdriver/util/logger/logger.rb +4 -4
- data/lib/tdriver/util/parameter/loader.rb +2 -19
- data/lib/tdriver/util/parameter/parameter.rb +874 -177
- data/lib/tdriver/util/plugin/service.rb +1 -1
- data/lib/tdriver/util/recorder/recorder.rb +7 -1
- data/lib/tdriver/util/xml/abstraction.rb +13 -1
- data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +63 -10
- data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +8 -2
- data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +16 -3
- data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +36 -32
- data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +19 -22
- data/lib/tdriver/util/xml/xml.rb +147 -32
- data/lib/tdriver/verify/verify.rb +1112 -289
- data/lib/tdriver/version.rb +1 -1
- data/xml/templates/generic.xml +14 -2
- metadata +51 -24
- data/lib/tdriver/util/parameter/parameter_hash.rb +0 -104
- data/lib/tdriver/util/parameter/parameter_new.rb +0 -869
- data/lib/tdriver/util/parameter/parameter_template.rb +0 -120
- data/lib/tdriver/util/parameter/parameter_user_api.rb +0 -116
- data/lib/tdriver/util/parameter/parameter_xml.rb +0 -261
@@ -100,11 +100,11 @@ module MobyBehaviour
|
|
100
100
|
MobyUtil::Retryable.until( :timeout => 60, :retry_timeout => 5 ) {
|
101
101
|
system(str_commands_after_powerup) if str_commands_after_powerup != nil
|
102
102
|
if $parameters[ :ats4_error_recovery_enabled, false ]!='true'
|
103
|
-
$logger.
|
103
|
+
$logger.behaviour "PASS;TDriver attempting reconnect"
|
104
104
|
self.connect(self.id)
|
105
|
-
$logger.
|
105
|
+
$logger.behaviour "PASS;TDriver connected"
|
106
106
|
else
|
107
|
-
$logger.
|
107
|
+
$logger.behaviour "PASS;ATS4 handling reconnection"
|
108
108
|
end
|
109
109
|
|
110
110
|
}
|
@@ -138,9 +138,9 @@ module MobyBehaviour
|
|
138
138
|
|
139
139
|
#execute switchbox command
|
140
140
|
str_command_arr.each do |foobox_command|
|
141
|
-
$logger.
|
141
|
+
$logger.behaviour "PASS;Executing powerdown command #{foobox_command}"
|
142
142
|
std_out = system(foobox_command)
|
143
|
-
$logger.
|
143
|
+
$logger.behaviour "PASS;Powerdown command #{foobox_command} executed"
|
144
144
|
sleep switchbox_sequence_timeout.to_i
|
145
145
|
Kernel::raise BehaviourError.new("power_down", "Failed to power down") unless std_out.to_s.downcase.include?(str_result.to_s.downcase)
|
146
146
|
end
|
@@ -175,9 +175,9 @@ module MobyBehaviour
|
|
175
175
|
|
176
176
|
#execute switchbox command
|
177
177
|
str_command_arr.each do |foobox_command|
|
178
|
-
$logger.
|
178
|
+
$logger.behaviour "PASS;Executing powerup command #{foobox_command}"
|
179
179
|
std_out = system(foobox_command)
|
180
|
-
$logger.
|
180
|
+
$logger.behaviour "PASS;Ppowerup command #{foobox_command} executed"
|
181
181
|
sleep switchbox_sequence_timeout.to_i
|
182
182
|
Kernel::raise BehaviourError.new("power_up", "Failed to power up") unless std_out.to_s.downcase.include?(str_result.to_s.downcase)
|
183
183
|
end
|
@@ -39,19 +39,19 @@ module MobyCommand
|
|
39
39
|
:attribute_csv_string
|
40
40
|
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
42
|
+
:_arguments,
|
43
|
+
:_environment,
|
44
|
+
:_working_directory,
|
45
|
+
:_events_to_listen,
|
46
|
+
:_start_command,
|
47
|
+
:_application_uid,
|
48
|
+
:_application_name,
|
49
|
+
:_command,
|
50
|
+
:_application_name,
|
51
|
+
:_application_uid,
|
52
|
+
:_flags,
|
53
|
+
:_attribute_csv_string,
|
54
|
+
:_signals_to_listen,
|
55
55
|
:_sut,
|
56
56
|
:_refresh_args
|
57
57
|
|
@@ -69,394 +69,465 @@ module MobyCommand
|
|
69
69
|
arguments.default = nil
|
70
70
|
|
71
71
|
@command_arguments = arguments
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
|
73
|
+
@_command = command
|
74
|
+
|
75
|
+
@_application_name = nil
|
76
|
+
@_application_uid = nil
|
77
|
+
@_sut = nil
|
78
|
+
@_arguments = nil
|
79
|
+
@_events_to_listen = nil
|
80
|
+
@_signals_to_listen = nil
|
81
|
+
@_environment = nil
|
82
|
+
@_working_directory = nil
|
83
|
+
@_flags = nil
|
84
|
+
@_start_command = nil
|
85
|
+
@_refresh_args = nil
|
86
|
+
@_attribute_csv_string = nil
|
87
|
+
@_checksum = nil
|
88
|
+
|
89
|
+
=begin
|
75
90
|
# store values from arguments
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
91
|
+
self.name( arguments[ :application_name ] )
|
92
|
+
self.uid( arguments[ :application_uid ] )
|
93
|
+
self.sut( arguments[ :sut ] )
|
94
|
+
self.arguments( arguments[ :arguments ] )
|
95
|
+
self.events_to_listen( arguments[ :events_to_listen ] )
|
96
|
+
self.signals_to_listen( arguments[ :signals_to_listen ] )
|
97
|
+
self.environment( arguments[ :environment ] )
|
98
|
+
self.working_directory( arguments[ :working_directory ] )
|
99
|
+
self.flags( arguments[ :flags ] )
|
100
|
+
self.start_command( arguments[ :start_command ] )
|
101
|
+
self.refresh_args( arguments[ :refresh_arguments ] )
|
102
|
+
self.attribute_filter( arguments[ :attribute_filter ] )
|
103
|
+
=end
|
104
|
+
|
105
|
+
# store values from arguments - call setter method only when required
|
106
|
+
arguments.each_pair{ | key, value |
|
107
|
+
|
108
|
+
# skip if value is nil (default)
|
109
|
+
next if value.nil?
|
110
|
+
|
111
|
+
case key
|
112
|
+
|
113
|
+
when :application_name
|
114
|
+
name( value )
|
115
|
+
|
116
|
+
when :application_uid
|
117
|
+
uid( value )
|
118
|
+
|
119
|
+
when :sut
|
120
|
+
sut( value )
|
121
|
+
|
122
|
+
when :arguments
|
123
|
+
arguments( value )
|
124
|
+
|
125
|
+
when :events_to_listen
|
126
|
+
events_to_listen( value )
|
127
|
+
|
128
|
+
when :signals_to_listen
|
129
|
+
signals_to_listen( value )
|
130
|
+
|
131
|
+
when :environment
|
132
|
+
environment( value )
|
133
|
+
|
134
|
+
when :working_directory
|
135
|
+
working_directory( value )
|
136
|
+
|
137
|
+
when :flags
|
138
|
+
flags( value )
|
139
|
+
|
140
|
+
when :start_command
|
141
|
+
start_command( value )
|
142
|
+
|
143
|
+
when :refresh_arguments
|
144
|
+
refresh_args( value )
|
145
|
+
|
146
|
+
when :attribute_filter
|
147
|
+
attribute_filter( value )
|
148
|
+
|
149
|
+
when :checksum
|
150
|
+
@_checksum = value
|
151
|
+
|
152
|
+
else
|
153
|
+
|
154
|
+
# show warning/exception?
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
}
|
159
|
+
|
160
|
+
self
|
90
161
|
|
91
162
|
end
|
92
163
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
164
|
+
# Store the args for possible future use
|
165
|
+
def refresh_args(refresh_args={})
|
166
|
+
@_refresh_args = refresh_args
|
167
|
+
end
|
168
|
+
|
169
|
+
def get_refresh_args
|
170
|
+
@_refresh_args
|
171
|
+
end
|
101
172
|
|
102
173
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
174
|
+
# Defines the type of command this Application CommandData object represents
|
175
|
+
# == params
|
176
|
+
# command_type:: Symbol, defines the command to perform on the application
|
177
|
+
# == returns
|
178
|
+
# Application:: This CommandData object
|
179
|
+
# == raises
|
180
|
+
# ArgumentError:: When the supplied command_type is invalid.
|
181
|
+
def command( command_type )
|
111
182
|
|
112
|
-
|
183
|
+
@_command = command_type
|
113
184
|
|
114
|
-
|
185
|
+
self
|
115
186
|
|
116
|
-
|
187
|
+
end
|
117
188
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
189
|
+
# Defines the used SUT to be able to access parameters when creating messages
|
190
|
+
# == params
|
191
|
+
# sut:: SUT, creator of the command.
|
192
|
+
# == returns
|
193
|
+
# Application:: This CommandData object
|
194
|
+
# == raises
|
195
|
+
# ArgumentError:: When sut is not nil or a SUT
|
196
|
+
def sut( sut )
|
126
197
|
|
127
|
-
|
128
|
-
|
129
|
-
|
198
|
+
raise ArgumentError.new( "The given sut must be nil or a SUT." ) unless sut == nil || sut.kind_of?( MobyBase::SUT )
|
199
|
+
@_sut = sut
|
200
|
+
self
|
130
201
|
|
131
|
-
|
202
|
+
end
|
132
203
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
204
|
+
# Defines the name of the application this Application CommandData object is associated with
|
205
|
+
# == params
|
206
|
+
# app_name:: String, name of application to perform this command on
|
207
|
+
# == returns
|
208
|
+
# Application:: This CommandData object
|
209
|
+
# == raises
|
210
|
+
# ArgumentError:: When app_name is not nil or a String
|
211
|
+
def name( app_name )
|
141
212
|
|
142
|
-
|
143
|
-
|
144
|
-
|
213
|
+
raise ArgumentError.new( "The given application name must be nil or a String." ) unless app_name == nil || app_name.kind_of?( String )
|
214
|
+
@_application_name = app_name
|
215
|
+
self
|
145
216
|
|
146
|
-
|
217
|
+
end
|
147
218
|
|
148
|
-
|
219
|
+
def arguments( arguments )
|
149
220
|
|
150
|
-
|
151
|
-
|
221
|
+
raise ArgumentError.new( "The given application arguments must be nil or a String." ) unless arguments == nil || arguments.kind_of?( String )
|
222
|
+
@_arguments = arguments
|
152
223
|
|
153
|
-
|
224
|
+
end
|
154
225
|
|
155
|
-
|
226
|
+
def flags( flags )
|
156
227
|
|
157
|
-
|
158
|
-
|
228
|
+
raise ArgumentError.new( "The given application flags must be nil or a Hash." ) unless flags == nil || flags.kind_of?( Hash )
|
229
|
+
@_flags = flags
|
159
230
|
|
160
|
-
|
231
|
+
end
|
161
232
|
|
162
|
-
|
233
|
+
def environment( environment )
|
163
234
|
|
164
|
-
|
165
|
-
|
235
|
+
raise ArgumentError.new( "The given application environment must be nil or a String." ) unless environment == nil || environment.kind_of?( String )
|
236
|
+
@_environment = environment
|
166
237
|
|
167
|
-
|
238
|
+
end
|
168
239
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
240
|
+
def working_directory( working_directory )
|
241
|
+
|
242
|
+
raise ArgumentError.new( "The given application working directory must be nil or a String." ) unless working_directory == nil || working_directory.kind_of?( String )
|
243
|
+
@_working_directory = working_directory
|
244
|
+
|
245
|
+
end
|
175
246
|
|
176
|
-
|
247
|
+
def events_to_listen( events )
|
177
248
|
|
178
|
-
|
179
|
-
|
249
|
+
raise ArgumentError.new( "The events to listen must be nil or a String." ) unless events == nil || events.kind_of?( String )
|
250
|
+
@_events_to_listen = events
|
180
251
|
|
181
|
-
|
252
|
+
end
|
182
253
|
|
183
|
-
|
254
|
+
def signals_to_listen( signals )
|
184
255
|
|
185
|
-
|
186
|
-
|
256
|
+
raise ArgumentError.new( "The signals to listen must be nil or a String." ) unless signals == nil || signals.kind_of?( String )
|
257
|
+
@_signals_to_listen = signals
|
187
258
|
|
188
|
-
|
189
|
-
|
190
|
-
|
259
|
+
end
|
260
|
+
|
261
|
+
def start_command( start_command )
|
191
262
|
|
192
|
-
|
193
|
-
|
263
|
+
raise ArgumentError.new( "The start_command must be nil or a String." ) unless start_command == nil || start_command.kind_of?( String )
|
264
|
+
@_start_command = start_command
|
194
265
|
|
195
|
-
|
266
|
+
end
|
196
267
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
268
|
+
# Defines the uid of the application this Application CommandData object is associated with
|
269
|
+
# == params
|
270
|
+
# app_uid:: FixNum, uid of application to perform this command on
|
271
|
+
# == returns
|
272
|
+
# Application:: This CommandData object
|
273
|
+
# == raises
|
274
|
+
# ArgumentError:: When app_name is not nil or a String
|
275
|
+
def uid( app_uid )
|
205
276
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
277
|
+
raise ArgumentError.new( "The given application uid must be nil, a String or an Integer." ) unless app_uid == nil || app_uid.kind_of?( String ) || app_uid.kind_of?( Fixnum )
|
278
|
+
@_application_uid = app_uid
|
279
|
+
@_application_uid = @_application_uid.to_i unless @_application_uid == nil
|
280
|
+
self
|
210
281
|
|
211
|
-
|
282
|
+
end
|
212
283
|
|
213
|
-
|
284
|
+
def get_command
|
214
285
|
|
215
|
-
|
286
|
+
@_command
|
216
287
|
|
217
|
-
|
288
|
+
end
|
218
289
|
|
219
|
-
|
290
|
+
def get_application
|
220
291
|
|
221
|
-
|
292
|
+
@_application_name
|
222
293
|
|
223
|
-
|
294
|
+
end
|
224
295
|
|
225
|
-
|
296
|
+
def get_uid
|
226
297
|
|
227
|
-
|
298
|
+
@_application_uid
|
228
299
|
|
229
|
-
|
300
|
+
end
|
230
301
|
|
231
|
-
|
302
|
+
def get_flags
|
232
303
|
|
233
|
-
|
304
|
+
@_flags
|
234
305
|
|
235
|
-
|
306
|
+
end
|
236
307
|
|
237
|
-
|
308
|
+
def attribute_filter(attribute_string)
|
238
309
|
|
239
|
-
|
310
|
+
@_attribute_csv_string = attribute_string
|
240
311
|
|
241
|
-
|
312
|
+
end
|
242
313
|
|
243
|
-
|
314
|
+
def get_attribute_filter
|
244
315
|
|
245
|
-
|
316
|
+
@_attribute_csv_string
|
246
317
|
|
247
|
-
|
318
|
+
end
|
248
319
|
|
249
|
-
|
250
|
-
|
320
|
+
# enable hooking for performance measurement & debug logging
|
321
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
251
322
|
|
252
323
|
end
|
253
324
|
|
254
325
|
=begin
|
255
326
|
|
256
|
-
|
257
|
-
|
258
|
-
#Application command types
|
259
|
-
#Launch application = :Run
|
260
|
-
#Close application = :Close
|
261
|
-
#List of running applications = :List
|
262
|
-
#Current state of the UI = :State
|
263
|
-
#Kill = :Kill
|
264
|
-
#Kill All = :KillAll
|
265
|
-
#
|
266
|
-
# Constructs a new Application CommandData object
|
267
|
-
# == params
|
268
|
-
# command_type:: (optional) Symbol, defines the command to perform on the application
|
269
|
-
# app_name:: (optional) String, name of application to perform this command on
|
270
|
-
# app_uid::
|
271
|
-
# sut:: (optional) SUT, creator of the command. Can be used to access parameters when creating messages.
|
272
|
-
# arguments:: (optional) Arguments given to the application on start up. Comma separated list if more the one.
|
273
|
-
# environment:: (optional) Environment given to the application on start up. Comma separated list if more the one.
|
274
|
-
# working_directory:: (optional) Working directory for the application (not used on Symbian)
|
275
|
-
# == returns
|
276
|
-
# Application:: New CommandData object
|
277
|
-
# == raises
|
278
|
-
# ArgumentError:: When the supplied command_type is invalid.
|
279
|
-
def initialize( command_type = nil, app_name = nil, app_uid = nil, sut = nil, arguments = nil, environment = nil, working_directory = nil, events_to_listen = nil, signals_to_listen = nil, flags = nil, start_command = nil)
|
280
|
-
# Set status value to nil (not executed)
|
281
|
-
|
282
|
-
self.command( command_type )
|
283
|
-
self.name( app_name )
|
284
|
-
self.uid( app_uid )
|
285
|
-
self.sut( sut )
|
286
|
-
self.arguments( arguments )
|
287
|
-
self.events_to_listen( events_to_listen )
|
288
|
-
self.signals_to_listen( signals_to_listen )
|
289
|
-
self.environment( environment )
|
290
|
-
self.working_directory( working_directory )
|
291
|
-
self.flags( flags )
|
292
|
-
self.start_command( start_command )
|
293
|
-
self.refresh_args
|
294
|
-
|
295
|
-
@_attribute_csv_string = nil
|
296
|
-
|
297
|
-
self
|
298
|
-
|
299
|
-
end
|
300
|
-
|
301
|
-
# Store the args for possible future use
|
302
|
-
def refresh_args(refresh_args={})
|
303
|
-
@_refresh_args = refresh_args
|
304
|
-
end
|
305
|
-
|
306
|
-
def get_refresh_args
|
307
|
-
@_refresh_args
|
308
|
-
end
|
309
|
-
|
310
|
-
|
311
|
-
# Defines the type of command this Application CommandData object represents
|
312
|
-
# == params
|
313
|
-
# command_type:: Symbol, defines the command to perform on the application
|
314
|
-
# == returns
|
315
|
-
# Application:: This CommandData object
|
316
|
-
# == raises
|
317
|
-
# ArgumentError:: When the supplied command_type is invalid.
|
318
|
-
def command( command_type )
|
319
|
-
|
320
|
-
@_command = command_type
|
321
|
-
self
|
322
|
-
|
323
|
-
end
|
324
|
-
|
325
|
-
# Defines the used SUT to be able to access parameters when creating messages
|
326
|
-
# == params
|
327
|
-
# sut:: SUT, creator of the command.
|
328
|
-
# == returns
|
329
|
-
# Application:: This CommandData object
|
330
|
-
# == raises
|
331
|
-
# ArgumentError:: When sut is not nil or a SUT
|
332
|
-
def sut( sut )
|
327
|
+
class Application < MobyCommand::CommandData
|
333
328
|
|
334
|
-
|
335
|
-
|
336
|
-
|
329
|
+
#Application command types
|
330
|
+
#Launch application = :Run
|
331
|
+
#Close application = :Close
|
332
|
+
#List of running applications = :List
|
333
|
+
#Current state of the UI = :State
|
334
|
+
#Kill = :Kill
|
335
|
+
#Kill All = :KillAll
|
336
|
+
#
|
337
|
+
# Constructs a new Application CommandData object
|
338
|
+
# == params
|
339
|
+
# command_type:: (optional) Symbol, defines the command to perform on the application
|
340
|
+
# app_name:: (optional) String, name of application to perform this command on
|
341
|
+
# app_uid::
|
342
|
+
# sut:: (optional) SUT, creator of the command. Can be used to access parameters when creating messages.
|
343
|
+
# arguments:: (optional) Arguments given to the application on start up. Comma separated list if more the one.
|
344
|
+
# environment:: (optional) Environment given to the application on start up. Comma separated list if more the one.
|
345
|
+
# working_directory:: (optional) Working directory for the application (not used on Symbian)
|
346
|
+
# == returns
|
347
|
+
# Application:: New CommandData object
|
348
|
+
# == raises
|
349
|
+
# ArgumentError:: When the supplied command_type is invalid.
|
350
|
+
def initialize( command_type = nil, app_name = nil, app_uid = nil, sut = nil, arguments = nil, environment = nil, working_directory = nil, events_to_listen = nil, signals_to_listen = nil, flags = nil, start_command = nil)
|
351
|
+
# Set status value to nil (not executed)
|
352
|
+
|
353
|
+
self.command( command_type )
|
354
|
+
self.name( app_name )
|
355
|
+
self.uid( app_uid )
|
356
|
+
self.sut( sut )
|
357
|
+
self.arguments( arguments )
|
358
|
+
self.events_to_listen( events_to_listen )
|
359
|
+
self.signals_to_listen( signals_to_listen )
|
360
|
+
self.environment( environment )
|
361
|
+
self.working_directory( working_directory )
|
362
|
+
self.flags( flags )
|
363
|
+
self.start_command( start_command )
|
364
|
+
self.refresh_args
|
365
|
+
|
366
|
+
@_attribute_csv_string = nil
|
367
|
+
|
368
|
+
self
|
337
369
|
|
338
|
-
|
370
|
+
end
|
339
371
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
372
|
+
# Store the args for possible future use
|
373
|
+
def refresh_args(refresh_args={})
|
374
|
+
@_refresh_args = refresh_args
|
375
|
+
end
|
376
|
+
|
377
|
+
def get_refresh_args
|
378
|
+
@_refresh_args
|
379
|
+
end
|
348
380
|
|
349
|
-
raise ArgumentError.new( "The given application name must be nil or a String." ) unless app_name == nil || app_name.kind_of?( String )
|
350
|
-
@_application_name = app_name
|
351
|
-
self
|
352
381
|
|
353
|
-
|
382
|
+
# Defines the type of command this Application CommandData object represents
|
383
|
+
# == params
|
384
|
+
# command_type:: Symbol, defines the command to perform on the application
|
385
|
+
# == returns
|
386
|
+
# Application:: This CommandData object
|
387
|
+
# == raises
|
388
|
+
# ArgumentError:: When the supplied command_type is invalid.
|
389
|
+
def command( command_type )
|
354
390
|
|
355
|
-
|
391
|
+
@_command = command_type
|
392
|
+
self
|
356
393
|
|
357
|
-
|
358
|
-
@_arguments = arguments
|
394
|
+
end
|
359
395
|
|
360
|
-
|
396
|
+
# Defines the used SUT to be able to access parameters when creating messages
|
397
|
+
# == params
|
398
|
+
# sut:: SUT, creator of the command.
|
399
|
+
# == returns
|
400
|
+
# Application:: This CommandData object
|
401
|
+
# == raises
|
402
|
+
# ArgumentError:: When sut is not nil or a SUT
|
403
|
+
def sut( sut )
|
361
404
|
|
362
|
-
|
405
|
+
raise ArgumentError.new( "The given sut must be nil or a SUT." ) unless sut == nil || sut.kind_of?( MobyBase::SUT )
|
406
|
+
@_sut = sut
|
407
|
+
self
|
363
408
|
|
364
|
-
|
365
|
-
@_flags = flags
|
409
|
+
end
|
366
410
|
|
367
|
-
|
411
|
+
# Defines the name of the application this Application CommandData object is associated with
|
412
|
+
# == params
|
413
|
+
# app_name:: String, name of application to perform this command on
|
414
|
+
# == returns
|
415
|
+
# Application:: This CommandData object
|
416
|
+
# == raises
|
417
|
+
# ArgumentError:: When app_name is not nil or a String
|
418
|
+
def name( app_name )
|
368
419
|
|
369
|
-
|
420
|
+
raise ArgumentError.new( "The given application name must be nil or a String." ) unless app_name == nil || app_name.kind_of?( String )
|
421
|
+
@_application_name = app_name
|
422
|
+
self
|
370
423
|
|
371
|
-
|
372
|
-
@_environment = environment
|
424
|
+
end
|
373
425
|
|
374
|
-
|
426
|
+
def arguments( arguments )
|
375
427
|
|
376
|
-
|
377
|
-
|
378
|
-
raise ArgumentError.new( "The given application working directory must be nil or a String." ) unless working_directory == nil || working_directory.kind_of?( String )
|
379
|
-
@_working_directory = working_directory
|
380
|
-
|
381
|
-
end
|
428
|
+
raise ArgumentError.new( "The given application arguments must be nil or a String." ) unless arguments == nil || arguments.kind_of?( String )
|
429
|
+
@_arguments = arguments
|
382
430
|
|
383
|
-
|
431
|
+
end
|
384
432
|
|
385
|
-
|
386
|
-
@_events_to_listen = events
|
433
|
+
def flags( flags )
|
387
434
|
|
388
|
-
|
435
|
+
raise ArgumentError.new( "The given application flags must be nil or a Hash." ) unless flags == nil || flags.kind_of?( Hash )
|
436
|
+
@_flags = flags
|
389
437
|
|
390
|
-
|
438
|
+
end
|
391
439
|
|
392
|
-
|
393
|
-
@_signals_to_listen = signals
|
440
|
+
def environment( environment )
|
394
441
|
|
395
|
-
|
396
|
-
|
397
|
-
def start_command( start_command )
|
442
|
+
raise ArgumentError.new( "The given application environment must be nil or a String." ) unless environment == nil || environment.kind_of?( String )
|
443
|
+
@_environment = environment
|
398
444
|
|
399
|
-
|
400
|
-
@_start_command = start_command
|
445
|
+
end
|
401
446
|
|
402
|
-
|
447
|
+
def working_directory( working_directory )
|
448
|
+
|
449
|
+
raise ArgumentError.new( "The given application working directory must be nil or a String." ) unless working_directory == nil || working_directory.kind_of?( String )
|
450
|
+
@_working_directory = working_directory
|
451
|
+
|
452
|
+
end
|
403
453
|
|
404
|
-
|
405
|
-
# == params
|
406
|
-
# app_uid:: FixNum, uid of application to perform this command on
|
407
|
-
# == returns
|
408
|
-
# Application:: This CommandData object
|
409
|
-
# == raises
|
410
|
-
# ArgumentError:: When app_name is not nil or a String
|
411
|
-
def uid( app_uid )
|
454
|
+
def events_to_listen( events )
|
412
455
|
|
413
|
-
|
414
|
-
|
415
|
-
@_application_uid = @_application_uid.to_i unless @_application_uid == nil
|
416
|
-
self
|
456
|
+
raise ArgumentError.new( "The events to listen must be nil or a String." ) unless events == nil || events.kind_of?( String )
|
457
|
+
@_events_to_listen = events
|
417
458
|
|
418
|
-
|
459
|
+
end
|
419
460
|
|
420
|
-
|
461
|
+
def signals_to_listen( signals )
|
421
462
|
|
422
|
-
|
463
|
+
raise ArgumentError.new( "The signals to listen must be nil or a String." ) unless signals == nil || signals.kind_of?( String )
|
464
|
+
@_signals_to_listen = signals
|
423
465
|
|
424
|
-
|
466
|
+
end
|
467
|
+
|
468
|
+
def start_command( start_command )
|
425
469
|
|
426
|
-
|
470
|
+
raise ArgumentError.new( "The start_command must be nil or a String." ) unless start_command == nil || start_command.kind_of?( String )
|
471
|
+
@_start_command = start_command
|
427
472
|
|
428
|
-
|
473
|
+
end
|
429
474
|
|
430
|
-
|
475
|
+
# Defines the uid of the application this Application CommandData object is associated with
|
476
|
+
# == params
|
477
|
+
# app_uid:: FixNum, uid of application to perform this command on
|
478
|
+
# == returns
|
479
|
+
# Application:: This CommandData object
|
480
|
+
# == raises
|
481
|
+
# ArgumentError:: When app_name is not nil or a String
|
482
|
+
def uid( app_uid )
|
431
483
|
|
432
|
-
|
484
|
+
raise ArgumentError.new( "The given application uid must be nil, a String or an Integer." ) unless app_uid == nil || app_uid.kind_of?( String ) || app_uid.kind_of?( Fixnum )
|
485
|
+
@_application_uid = app_uid
|
486
|
+
@_application_uid = @_application_uid.to_i unless @_application_uid == nil
|
487
|
+
self
|
433
488
|
|
434
|
-
|
489
|
+
end
|
490
|
+
|
491
|
+
def get_command
|
492
|
+
|
493
|
+
@_command
|
494
|
+
|
495
|
+
end
|
435
496
|
|
436
|
-
|
497
|
+
def get_application
|
437
498
|
|
438
|
-
|
499
|
+
@_application_name
|
439
500
|
|
440
|
-
|
501
|
+
end
|
441
502
|
|
442
|
-
|
503
|
+
def get_uid
|
443
504
|
|
444
|
-
|
505
|
+
@_application_uid
|
445
506
|
|
446
|
-
|
507
|
+
end
|
447
508
|
|
448
|
-
|
509
|
+
def get_flags
|
449
510
|
|
450
|
-
|
511
|
+
@_flags
|
451
512
|
|
452
|
-
|
513
|
+
end
|
453
514
|
|
454
|
-
|
515
|
+
def attribute_filter(attribute_string)
|
516
|
+
|
517
|
+
@_attribute_csv_string = attribute_string
|
518
|
+
|
519
|
+
end
|
520
|
+
|
521
|
+
def get_attribute_filter
|
522
|
+
|
523
|
+
@_attribute_csv_string
|
524
|
+
|
525
|
+
end
|
455
526
|
|
456
|
-
|
457
|
-
|
527
|
+
# enable hooking for performance measurement & debug logging
|
528
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
458
529
|
|
459
|
-
|
530
|
+
end # Application
|
460
531
|
=end
|
461
532
|
|
462
533
|
end # MobyCommand
|