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.
Files changed (71) hide show
  1. data/config/sut_parameters.rb +21 -8
  2. data/config/tdriver_custom_error_recovery.rb +83 -0
  3. data/ext/extconf.rb +3 -2
  4. data/ext/native_extensions.c +60 -2
  5. data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +2 -105
  6. data/lib/tdriver/base/behaviour/factory.rb +154 -89
  7. data/lib/tdriver/base/behaviour/factory_new.rb +409 -0
  8. data/lib/tdriver/base/errors.rb +3 -3
  9. data/lib/tdriver/base/state_object.rb +85 -22
  10. data/lib/tdriver/base/sut/adapter.rb +26 -0
  11. data/lib/tdriver/base/sut/controller.rb +1 -1
  12. data/lib/tdriver/base/sut/generic/behaviours/application.rb +89 -118
  13. data/lib/tdriver/base/sut/generic/behaviours/find.rb +67 -62
  14. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +296 -187
  15. data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +7 -7
  16. data/lib/tdriver/base/sut/generic/commands/application.rb +366 -295
  17. data/lib/tdriver/base/sut/sut.rb +19 -3
  18. data/lib/tdriver/base/test_object/abstract.rb +41 -21
  19. data/lib/tdriver/base/test_object/adapter.rb +62 -9
  20. data/lib/tdriver/base/test_object/behaviours/syncronization.rb +10 -6
  21. data/lib/tdriver/base/test_object/behaviours/test_object.rb +84 -47
  22. data/lib/tdriver/base/test_object/factory.rb +124 -68
  23. data/lib/tdriver/base/test_object/loader.rb +3 -4
  24. data/lib/tdriver/base/test_object/verification.rb +3 -3
  25. data/lib/tdriver/base/test_object/xml/adapter.rb +734 -0
  26. data/lib/tdriver/loader.rb +12 -0
  27. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +3 -2
  28. data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +14 -14
  29. data/lib/tdriver/report/report.rb +4 -8
  30. data/lib/tdriver/report/report_api.rb +9 -0
  31. data/lib/tdriver/report/report_crash_file_capture.rb +4 -4
  32. data/lib/tdriver/report/report_creator.rb +57 -35
  33. data/lib/tdriver/report/report_cucumber.rb +1 -1
  34. data/lib/tdriver/report/report_cucumber_listener.rb +5 -158
  35. data/lib/tdriver/report/report_cucumber_reporter.rb +7 -161
  36. data/lib/tdriver/report/report_execution_statistics.rb +4 -4
  37. data/lib/tdriver/report/report_file_capture.rb +5 -5
  38. data/lib/tdriver/report/report_grouping.rb +24 -22
  39. data/lib/tdriver/report/report_junit_xml.rb +5 -5
  40. data/lib/tdriver/report/report_test_case_run.rb +31 -22
  41. data/lib/tdriver/report/report_test_run.rb +107 -104
  42. data/lib/tdriver/report/report_writer.rb +150 -83
  43. data/lib/tdriver/tdriver.rb +147 -103
  44. data/lib/tdriver/util/common/boolean.rb +51 -0
  45. data/lib/tdriver/util/common/crc16.rb +110 -68
  46. data/lib/tdriver/util/common/hash.rb +63 -7
  47. data/lib/tdriver/util/common/kernel.rb +46 -1
  48. data/lib/tdriver/util/common/loader.rb +1 -0
  49. data/lib/tdriver/util/common/object.rb +20 -8
  50. data/lib/tdriver/util/common/string.rb +21 -2
  51. data/lib/tdriver/util/logger/logger.rb +4 -4
  52. data/lib/tdriver/util/parameter/loader.rb +2 -19
  53. data/lib/tdriver/util/parameter/parameter.rb +874 -177
  54. data/lib/tdriver/util/plugin/service.rb +1 -1
  55. data/lib/tdriver/util/recorder/recorder.rb +7 -1
  56. data/lib/tdriver/util/xml/abstraction.rb +13 -1
  57. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +63 -10
  58. data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +8 -2
  59. data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +16 -3
  60. data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +36 -32
  61. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +19 -22
  62. data/lib/tdriver/util/xml/xml.rb +147 -32
  63. data/lib/tdriver/verify/verify.rb +1112 -289
  64. data/lib/tdriver/version.rb +1 -1
  65. data/xml/templates/generic.xml +14 -2
  66. metadata +51 -24
  67. data/lib/tdriver/util/parameter/parameter_hash.rb +0 -104
  68. data/lib/tdriver/util/parameter/parameter_new.rb +0 -869
  69. data/lib/tdriver/util/parameter/parameter_template.rb +0 -120
  70. data/lib/tdriver/util/parameter/parameter_user_api.rb +0 -116
  71. 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.log "behaviour", "PASS;TDriver attempting reconnect"
103
+ $logger.behaviour "PASS;TDriver attempting reconnect"
104
104
  self.connect(self.id)
105
- $logger.log "behaviour", "PASS;TDriver connected"
105
+ $logger.behaviour "PASS;TDriver connected"
106
106
  else
107
- $logger.log "behaviour", "PASS;ATS4 handling reconnection"
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.log "behaviour", "PASS;Executing powerdown command #{foobox_command}"
141
+ $logger.behaviour "PASS;Executing powerdown command #{foobox_command}"
142
142
  std_out = system(foobox_command)
143
- $logger.log "behaviour", "PASS;Powerdown command #{foobox_command} executed"
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.log "behaviour", "PASS;Executing powerup command #{foobox_command}"
178
+ $logger.behaviour "PASS;Executing powerup command #{foobox_command}"
179
179
  std_out = system(foobox_command)
180
- $logger.log "behaviour", "PASS;Ppowerup command #{foobox_command} executed"
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
- :_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,
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
- self.command( command )
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
- self.name( arguments[ :application_name ] )
77
- self.uid( arguments[ :application_uid ] )
78
- self.sut( arguments[ :sut ] )
79
- self.arguments( arguments[ :arguments ] )
80
- self.events_to_listen( arguments[ :events_to_listen ] )
81
- self.signals_to_listen( arguments[ :signals_to_listen ] )
82
- self.environment( arguments[ :environment ] )
83
- self.working_directory( arguments[ :working_directory ] )
84
- self.flags( arguments[ :flags ] )
85
- self.start_command( arguments[ :start_command ] )
86
- self.refresh_args( arguments[ :refresh_arguments ] )
87
- self.attribute_filter( arguments[ :attribute_filter ] )
88
-
89
- self
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
- # Store the args for possible future use
94
- def refresh_args(refresh_args={})
95
- @_refresh_args = refresh_args
96
- end
97
-
98
- def get_refresh_args
99
- @_refresh_args
100
- end
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
- # Defines the type of command this Application CommandData object represents
104
- # == params
105
- # command_type:: Symbol, defines the command to perform on the application
106
- # == returns
107
- # Application:: This CommandData object
108
- # == raises
109
- # ArgumentError:: When the supplied command_type is invalid.
110
- def command( command_type )
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
- @_command = command_type
183
+ @_command = command_type
113
184
 
114
- self
185
+ self
115
186
 
116
- end
187
+ end
117
188
 
118
- # Defines the used SUT to be able to access parameters when creating messages
119
- # == params
120
- # sut:: SUT, creator of the command.
121
- # == returns
122
- # Application:: This CommandData object
123
- # == raises
124
- # ArgumentError:: When sut is not nil or a SUT
125
- def sut( sut )
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
- raise ArgumentError.new( "The given sut must be nil or a SUT." ) unless sut == nil || sut.kind_of?( MobyBase::SUT )
128
- @_sut = sut
129
- self
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
- end
202
+ end
132
203
 
133
- # Defines the name of the application this Application CommandData object is associated with
134
- # == params
135
- # app_name:: String, name of application to perform this command on
136
- # == returns
137
- # Application:: This CommandData object
138
- # == raises
139
- # ArgumentError:: When app_name is not nil or a String
140
- def name( app_name )
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
- raise ArgumentError.new( "The given application name must be nil or a String." ) unless app_name == nil || app_name.kind_of?( String )
143
- @_application_name = app_name
144
- self
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
- end
217
+ end
147
218
 
148
- def arguments( arguments )
219
+ def arguments( arguments )
149
220
 
150
- raise ArgumentError.new( "The given application arguments must be nil or a String." ) unless arguments == nil || arguments.kind_of?( String )
151
- @_arguments = arguments
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
- end
224
+ end
154
225
 
155
- def flags( flags )
226
+ def flags( flags )
156
227
 
157
- raise ArgumentError.new( "The given application flags must be nil or a Hash." ) unless flags == nil || flags.kind_of?( Hash )
158
- @_flags = flags
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
- end
231
+ end
161
232
 
162
- def environment( environment )
233
+ def environment( environment )
163
234
 
164
- raise ArgumentError.new( "The given application environment must be nil or a String." ) unless environment == nil || environment.kind_of?( String )
165
- @_environment = environment
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
- end
238
+ end
168
239
 
169
- def working_directory( working_directory )
170
-
171
- raise ArgumentError.new( "The given application working directory must be nil or a String." ) unless working_directory == nil || working_directory.kind_of?( String )
172
- @_working_directory = working_directory
173
-
174
- end
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
- def events_to_listen( events )
247
+ def events_to_listen( events )
177
248
 
178
- raise ArgumentError.new( "The events to listen must be nil or a String." ) unless events == nil || events.kind_of?( String )
179
- @_events_to_listen = events
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
- end
252
+ end
182
253
 
183
- def signals_to_listen( signals )
254
+ def signals_to_listen( signals )
184
255
 
185
- raise ArgumentError.new( "The signals to listen must be nil or a String." ) unless signals == nil || signals.kind_of?( String )
186
- @_signals_to_listen = signals
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
- end
189
-
190
- def start_command( start_command )
259
+ end
260
+
261
+ def start_command( start_command )
191
262
 
192
- raise ArgumentError.new( "The start_command must be nil or a String." ) unless start_command == nil || start_command.kind_of?( String )
193
- @_start_command = start_command
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
- end
266
+ end
196
267
 
197
- # Defines the uid of the application this Application CommandData object is associated with
198
- # == params
199
- # app_uid:: FixNum, uid of application to perform this command on
200
- # == returns
201
- # Application:: This CommandData object
202
- # == raises
203
- # ArgumentError:: When app_name is not nil or a String
204
- def uid( app_uid )
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
- 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 )
207
- @_application_uid = app_uid
208
- @_application_uid = @_application_uid.to_i unless @_application_uid == nil
209
- self
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
- end
282
+ end
212
283
 
213
- def get_command
284
+ def get_command
214
285
 
215
- @_command
286
+ @_command
216
287
 
217
- end
288
+ end
218
289
 
219
- def get_application
290
+ def get_application
220
291
 
221
- @_application_name
292
+ @_application_name
222
293
 
223
- end
294
+ end
224
295
 
225
- def get_uid
296
+ def get_uid
226
297
 
227
- @_application_uid
298
+ @_application_uid
228
299
 
229
- end
300
+ end
230
301
 
231
- def get_flags
302
+ def get_flags
232
303
 
233
- @_flags
304
+ @_flags
234
305
 
235
- end
306
+ end
236
307
 
237
- def attribute_filter(attribute_string)
308
+ def attribute_filter(attribute_string)
238
309
 
239
- @_attribute_csv_string = attribute_string
310
+ @_attribute_csv_string = attribute_string
240
311
 
241
- end
312
+ end
242
313
 
243
- def get_attribute_filter
314
+ def get_attribute_filter
244
315
 
245
- @_attribute_csv_string
316
+ @_attribute_csv_string
246
317
 
247
- end
318
+ end
248
319
 
249
- # enable hooking for performance measurement & debug logging
250
- TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
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
- class Application < MobyCommand::CommandData
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
- raise ArgumentError.new( "The given sut must be nil or a SUT." ) unless sut == nil || sut.kind_of?( MobyBase::SUT )
335
- @_sut = sut
336
- self
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
- end
370
+ end
339
371
 
340
- # Defines the name of the application this Application CommandData object is associated with
341
- # == params
342
- # app_name:: String, name of application to perform this command on
343
- # == returns
344
- # Application:: This CommandData object
345
- # == raises
346
- # ArgumentError:: When app_name is not nil or a String
347
- def name( app_name )
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
- end
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
- def arguments( arguments )
391
+ @_command = command_type
392
+ self
356
393
 
357
- raise ArgumentError.new( "The given application arguments must be nil or a String." ) unless arguments == nil || arguments.kind_of?( String )
358
- @_arguments = arguments
394
+ end
359
395
 
360
- end
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
- def flags( flags )
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
- raise ArgumentError.new( "The given application flags must be nil or a Hash." ) unless flags == nil || flags.kind_of?( Hash )
365
- @_flags = flags
409
+ end
366
410
 
367
- end
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
- def environment( environment )
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
- raise ArgumentError.new( "The given application environment must be nil or a String." ) unless environment == nil || environment.kind_of?( String )
372
- @_environment = environment
424
+ end
373
425
 
374
- end
426
+ def arguments( arguments )
375
427
 
376
- def working_directory( working_directory )
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
- def events_to_listen( events )
431
+ end
384
432
 
385
- raise ArgumentError.new( "The events to listen must be nil or a String." ) unless events == nil || events.kind_of?( String )
386
- @_events_to_listen = events
433
+ def flags( flags )
387
434
 
388
- end
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
- def signals_to_listen( signals )
438
+ end
391
439
 
392
- raise ArgumentError.new( "The signals to listen must be nil or a String." ) unless signals == nil || signals.kind_of?( String )
393
- @_signals_to_listen = signals
440
+ def environment( environment )
394
441
 
395
- end
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
- raise ArgumentError.new( "The start_command must be nil or a String." ) unless start_command == nil || start_command.kind_of?( String )
400
- @_start_command = start_command
445
+ end
401
446
 
402
- end
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
- # Defines the uid of the application this Application CommandData object is associated with
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
- 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 )
414
- @_application_uid = app_uid
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
- end
459
+ end
419
460
 
420
- def get_command
461
+ def signals_to_listen( signals )
421
462
 
422
- @_command
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
- end
466
+ end
467
+
468
+ def start_command( start_command )
425
469
 
426
- def get_application
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
- @_application_name
473
+ end
429
474
 
430
- end
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
- def get_uid
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
- @_application_uid
489
+ end
490
+
491
+ def get_command
492
+
493
+ @_command
494
+
495
+ end
435
496
 
436
- end
497
+ def get_application
437
498
 
438
- def get_flags
499
+ @_application_name
439
500
 
440
- @_flags
501
+ end
441
502
 
442
- end
503
+ def get_uid
443
504
 
444
- def attribute_filter(attribute_string)
505
+ @_application_uid
445
506
 
446
- @_attribute_csv_string = attribute_string
507
+ end
447
508
 
448
- end
509
+ def get_flags
449
510
 
450
- def get_attribute_filter
511
+ @_flags
451
512
 
452
- @_attribute_csv_string
513
+ end
453
514
 
454
- end
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
- # enable hooking for performance measurement & debug logging
457
- TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
527
+ # enable hooking for performance measurement & debug logging
528
+ TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
458
529
 
459
- end # Application
530
+ end # Application
460
531
  =end
461
532
 
462
533
  end # MobyCommand