testability-driver-qt-sut-plugin 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +7 -6
  2. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +190 -182
  3. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +2 -2
  4. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +17 -17
  5. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +6 -6
  6. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +6 -6
  7. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +2 -2
  8. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +10 -14
  9. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb +7 -7
  10. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +387 -338
  11. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +177 -5
  12. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +5 -5
  13. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +2 -1
  14. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +34 -7
  15. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +4 -4
  16. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +4 -4
  17. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +6 -6
  18. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +8 -12
  19. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/settings.rb +8 -8
  20. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +171 -115
  21. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +2 -2
  22. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +11 -7
  23. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +2 -2
  24. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/view_item.rb +5 -5
  25. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/webkit.rb +13 -13
  26. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +54 -63
  27. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/find_object.rb +45 -28
  28. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/version.rb +34 -0
  29. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/widget.rb +2 -2
  30. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb +174 -121
  31. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +35 -26
  32. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/version.rb +56 -0
  33. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +64 -16
  34. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +138 -40
  35. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +91 -83
  36. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/find_object_generator.rb +222 -44
  37. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/message_composer.rb +176 -10
  38. data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +2 -2
  39. data/xml/behaviour/qt.xml +12 -0
  40. metadata +7 -5
@@ -106,12 +106,12 @@ module MobyBehaviour
106
106
 
107
107
  rescue Exception => e
108
108
 
109
- $logger.log "behaviour" , "FAIL;Failed set settings \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
109
+ $logger.behaviour "FAIL;Failed set settings \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
110
110
  Kernel::raise e
111
111
 
112
112
  end
113
113
 
114
- $logger.log "behaviour" , "PASS;Operation set settings executed successfully \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
114
+ $logger.behaviour "PASS;Operation set settings executed successfully \"#{identifiers.to_s}\", \"#{values.to_s}\".;set_settings;"
115
115
 
116
116
  nil
117
117
  end
@@ -159,12 +159,12 @@ module MobyBehaviour
159
159
 
160
160
  rescue Exception => e
161
161
 
162
- $logger.log "behaviour" , "FAIL;Failed remove settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
162
+ $logger.behaviour "FAIL;Failed remove settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
163
163
  Kernel::raise e
164
164
 
165
165
  end
166
166
 
167
- $logger.log "behaviour" , "PASS;Operation remove settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
167
+ $logger.behaviour "PASS;Operation remove settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;remove_settings;"
168
168
 
169
169
  nil
170
170
 
@@ -213,12 +213,12 @@ module MobyBehaviour
213
213
 
214
214
  rescue Exception => e
215
215
 
216
- $logger.log "behaviour" , "FAIL;Failed read settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
216
+ $logger.behaviour "FAIL;Failed read settings \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
217
217
  Kernel::raise e
218
218
 
219
219
  end
220
220
 
221
- $logger.log "behaviour" , "PASS;Operation read settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
221
+ $logger.behaviour "PASS;Operation read settings executed successfully \"#{identifiers.to_s}\", \"#{setting_keys.to_s}\".;read_settings;"
222
222
 
223
223
  hash
224
224
 
@@ -260,12 +260,12 @@ module MobyBehaviour
260
260
 
261
261
  rescue Exception => e
262
262
 
263
- $logger.log "behaviour" , "FAIL;Failed read all settings \"#{identifiers.to_s}\".;read_all_settings;"
263
+ $logger.behaviour "FAIL;Failed read all settings \"#{identifiers.to_s}\".;read_all_settings;"
264
264
  Kernel::raise e
265
265
 
266
266
  end
267
267
 
268
- $logger.log "behaviour" , "PASS;Operation read all settings executed successfully \"#{identifiers.to_s}\".;read_all_settings;"
268
+ $logger.behaviour "PASS;Operation read all settings executed successfully \"#{identifiers.to_s}\".;read_all_settings;"
269
269
 
270
270
  hash
271
271
 
@@ -18,7 +18,8 @@
18
18
  ##
19
19
  ############################################################################
20
20
 
21
- require 'nokogiri'
21
+ # use tdrivers own xml api instead of nokogiri
22
+ #require 'nokogiri'
22
23
 
23
24
  module MobyBehaviour
24
25
 
@@ -84,12 +85,12 @@ module MobyBehaviour
84
85
  begin
85
86
  # execute the application control service request
86
87
  apps = execute_command( MobyCommand::Application.new( :ListApps ) )
87
- $logger.log "behaviour", "PASS;Successfully listed applications.;#{ id };sut;{};list_apps;"
88
+ $logger.behaviour "PASS;Successfully listed applications.;#{ id };sut;{};list_apps;"
88
89
 
89
90
  rescue Exception => e
90
91
 
91
- $logger.log "behaviour", "FAIL;Failed to list applications.;#{ id };sut;{};list_apps;"
92
- Kernel::raise RuntimeError.new( "Unable to list applications: Exception: #{ e.message } (#{ e.class })" )
92
+ $logger.behaviour "FAIL;Failed to list applications.;#{ id };sut;{};list_apps;"
93
+ raise RuntimeError, "Unable to list applications: Exception: #{ e.message } (#{ e.class })"
93
94
 
94
95
  end
95
96
 
@@ -97,6 +98,39 @@ module MobyBehaviour
97
98
 
98
99
  end
99
100
 
101
+ # == description
102
+ # Returns XML list of processes running in the target.
103
+ # \n
104
+ # == arguments
105
+ #
106
+ # == returns
107
+ # String
108
+ # description: tasMessage XML
109
+ #
110
+ # == exceptions
111
+ # RuntimeError
112
+ # description: if getting applications list throws any exception it's converted to RuntimeError with descriptive message
113
+ def list_processes
114
+
115
+ apps = nil
116
+
117
+ begin
118
+ # execute the application control service request
119
+ apps = execute_command( MobyCommand::Application.new( :ListRunningProcesses ) )
120
+ $logger.behaviour "PASS;Successfully listed processes.;#{ id };sut;{};list_processes;"
121
+
122
+ rescue Exception => e
123
+
124
+ $logger.behaviour "FAIL;Failed to list processes.;#{ id };sut;{};list_processes;"
125
+ Kernel::raise RuntimeError.new( "Unable to list processes: Exception: #{ e.message } (#{ e.class })" )
126
+
127
+ end
128
+
129
+ apps
130
+
131
+ end
132
+
133
+
100
134
  # == description
101
135
  # Returns XML list of applications and start times for applications started by qttasserver
102
136
  # \n
@@ -117,12 +151,12 @@ module MobyBehaviour
117
151
  begin
118
152
  # execute the application control service request
119
153
  apps = execute_command( MobyCommand::Application.new( :ListStartedApps ) )
120
- $logger.log "behaviour", "PASS;Successfully listed applications.;#{ id };sut;{};list_started_apps;"
154
+ $logger.behaviour "PASS;Successfully listed applications.;#{ id };sut;{};list_started_apps;"
121
155
 
122
156
  rescue Exception => e
123
157
 
124
- $logger.log "behaviour", "FAIL;Failed to list applications.;#{ id };sut;{};list_started_apps;"
125
- Kernel::raise RuntimeError.new( "Unable to list started applications: Exception: #{ e.message } (#{ e.class })" )
158
+ $logger.behaviour "FAIL;Failed to list applications.;#{ id };sut;{};list_started_apps;"
159
+ raise RuntimeError, "Unable to list started applications: Exception: #{ e.message } (#{ e.class })"
126
160
 
127
161
  end
128
162
 
@@ -143,10 +177,10 @@ module MobyBehaviour
143
177
  begin
144
178
  # execute the application control service request
145
179
  apps = execute_command( MobyCommand::Application.new( :ListCrashedApps ) )
146
- $logger.log "behaviour", "PASS;Successfully listed crashed applications.;#{ id };sut;{};list_crashed_apps;"
180
+ $logger.behaviour "PASS;Successfully listed crashed applications.;#{ id };sut;{};list_crashed_apps;"
147
181
  rescue Exception => e
148
- $logger.log "behaviour", "FAIL;Failed to list crashed applications.;#{ id };sut;{};list_crashed_apps;"
149
- Kernel::raise RuntimeError.new( "Unable to list crashed applications: Exception: #{ e.message } (#{ e.class })" )
182
+ $logger.behaviour "FAIL;Failed to list crashed applications.;#{ id };sut;{};list_crashed_apps;"
183
+ raise RuntimeError, "Unable to list crashed applications: Exception: #{ e.message } (#{ e.class })"
150
184
  end
151
185
 
152
186
  apps
@@ -191,8 +225,8 @@ module MobyBehaviour
191
225
  # description: Timeout of %s seconds reached. %s
192
226
  def execute_shell_command(command, param = { :detached => "false"} )
193
227
 
194
- Kernel::raise ArgumentError.new("The command argument must be a non empty String.") unless ( command.kind_of?( String ) and !command.empty? )
195
- Kernel::raise ArgumentError.new("The parameters argumet must be a Hash.") unless ( param.kind_of?(Hash) )
228
+ raise ArgumentError, "The command argument must be a non empty String." unless command.kind_of?( String ) and !command.empty?
229
+ raise ArgumentError, "The parameters argumet must be a Hash." unless param.kind_of?( Hash )
196
230
 
197
231
  if param[:detached].nil?
198
232
  param[:detached] = "false"
@@ -207,23 +241,28 @@ module MobyBehaviour
207
241
  #pid = execute_command( MobyCommand::Application.new( :Shell, command, nil, nil, nil, nil, nil, nil, param ) ).to_i
208
242
 
209
243
  pid = execute_command( MobyCommand::Application.new( :Shell, { :application_name => command, :flags => param } ) ).to_i
210
-
244
+
211
245
  data = ""
212
246
  if pid != 0
213
247
  time = Time.new + timeout
214
248
  while true
249
+
215
250
  obj = shell_command(pid)
251
+
216
252
  sleep 1
217
- data += obj['output']
253
+
254
+ data += obj['output'].to_s # cast to string in case of output is nil
255
+
218
256
  if Time.new > time
219
- command_params = {:kill => 'true'}
220
- command_output = shell_command(pid, command_params)['output']
221
- Kernel::raise RuntimeError.new( "Timeout of #{timeout.to_s} seconds reached. #{command_output}")
257
+ command_params = {:kill => 'true'}
258
+ command_output = shell_command(pid, command_params)['output']
259
+ raise RuntimeError, "Timeout of #{timeout.to_s} seconds reached. #{command_output}"
222
260
  elsif obj['status'] == "RUNNING"
223
- next
261
+ next
224
262
  else
225
- break
263
+ break
226
264
  end
265
+
227
266
  end
228
267
  end
229
268
  return data
@@ -266,77 +305,99 @@ module MobyBehaviour
266
305
  # ArgumentError
267
306
  # description: The command argument was not a non empty String
268
307
  #
269
- def shell_command(pid, param = {} )
270
- Kernel::raise ArgumentError.new("pid argument should be positive integer.") unless pid.to_i > 0
308
+ def shell_command( pid, param = {} )
309
+
310
+ raise ArgumentError, "pid argument should be positive integer." unless pid.to_i > 0
311
+
271
312
  param[ :status ] = 'true'
272
313
 
273
- #xml_source = execute_command( MobyCommand::Application.new( :Shell, pid.to_s, nil, nil, nil, nil, nil, nil, nil, param ) ).to_s
274
-
275
- xml_source = execute_command( MobyCommand::Application.new( :Shell, { :application_name => pid.to_s, :flags => param } ) ).to_s
314
+ xml_source = execute_command(
315
+ MobyCommand::Application.new(
316
+ :Shell,
317
+ {
318
+ :application_name => pid.to_s,
319
+ :flags => param
320
+ }
321
+ )
322
+ ).to_s
323
+
324
+ if param[ :kill ].nil?
276
325
 
277
- if param[:kill].nil?
278
- xml = Nokogiri::XML(xml_source)
279
326
  data = {}
280
- object_xml_data, unused_rule = TDriver::TestObjectAdapter.get_objects( xml, { :type => 'Response'}, true )
281
- object_xml_data.collect{ |element|
282
- data.merge!(TDriver::TestObjectAdapter.test_object_attributes(element))
283
- }
284
- return data
285
- else
286
- # Killed processes have no relevant data.
327
+
328
+ object_xml_data, unused_rule = @test_object_adapter.get_objects( MobyUtil::XML.parse_string( xml_source ), { :type => 'Response' }, true )
329
+
330
+ object_xml_data.collect{ | element |
331
+
332
+ data.merge!(
333
+
334
+ @test_object_adapter.test_object_attributes( element )
335
+
336
+ )
337
+
338
+ }
339
+
340
+ data
341
+
342
+ else
343
+
344
+ # Killed processes have no relevant data.
287
345
  data = {
288
- :status => "KILLED",
289
- :output => xml_source
346
+ :status => "KILLED",
347
+ :output => xml_source
290
348
  }
349
+
291
350
  end
351
+
292
352
  end
293
353
 
294
354
 
295
- # == description
296
- # launches application in symbian device based on UID and return launched application if succesfull.
297
- #
298
- # == arguments
299
- # hash_application
300
- # Hash
301
- # description: Hash defining required expected attributes of the application
302
- # example: { :UID => '' }
303
- #
304
- # == returns
305
- # MobyBase::Application
306
- # description: launched application that matched the uid
307
- # example: -
308
- #
309
- # == exceptions
310
- # TypeError
311
- # description: Wrong argument type %s for attributes (expected Hash)
312
- #
313
- def launch_with_uid( hash_uid = {} )
314
-
315
- begin
316
-
317
- raise TypeError.new( "Input parameter not of Type: Hash.\nIt is: #{ hash_uid.class }" ) unless hash_uid.kind_of?( Hash )
318
- the_uid = "failed with uid:" + hash_uid[:UID].to_s
319
- fullname = @sut.fixture("launch","launch_with_uid",hash_uid)
320
-
321
- if(fullname == the_uid)
322
- raise fullname
323
- end
324
- full_shortname = fullname.rpartition('\\')[-1]
325
- shortname = full_shortname.rpartition('.')[0]
326
- app_child = @sut.application(:name=>shortname)
355
+ # == description
356
+ # launches application in symbian device based on UID and return launched application if succesfull.
357
+ #
358
+ # == arguments
359
+ # hash_application
360
+ # Hash
361
+ # description: Hash defining required expected attributes of the application
362
+ # example: { :UID => '' }
363
+ #
364
+ # == returns
365
+ # MobyBase::Application
366
+ # description: launched application that matched the uid
367
+ # example: -
368
+ #
369
+ # == exceptions
370
+ # TypeError
371
+ # description: Wrong argument type %s for attributes (expected Hash)
372
+ #
373
+ def launch_with_uid( hash_uid = {} )
374
+
375
+ begin
327
376
 
328
- rescue Exception => e
377
+ raise TypeError.new( "Input parameter not of Type: Hash.\nIt is: #{ hash_uid.class }" ) unless hash_uid.kind_of?( Hash )
378
+ the_uid = "failed with uid:" + hash_uid[:UID].to_s
379
+ fullname = @sut.fixture("launch","launch_with_uid",hash_uid)
380
+
381
+ if(fullname == the_uid)
382
+ raise fullname
383
+ end
384
+ full_shortname = fullname.rpartition('\\')[-1]
385
+ shortname = full_shortname.rpartition('.')[0]
386
+ app_child = @sut.application(:name=>shortname)
329
387
 
330
- $logger.log "behaviour" , "FAIL;Failed to find application.;#{id.to_s};sut;{};application;" << (hash_uid.kind_of?(Hash) ? hash_uid.inspect : hash_uid.class.to_s)
331
- Kernel::raise e
388
+ rescue Exception
332
389
 
333
- end
390
+ $logger.behaviour "FAIL;Failed to find application.;#{id.to_s};sut;{};application;" << (hash_uid.kind_of?( Hash ) ? hash_uid.inspect : hash_uid.class.to_s)
334
391
 
335
- $logger.log "behaviour" , "PASS;Application found.;#{id.to_s};sut;{};application;" << hash_uid.inspect
392
+ raise
336
393
 
337
- app_child
394
+ end
338
395
 
339
- end
396
+ $logger.behaviour "PASS;Application found.;#{id.to_s};sut;{};application;" << hash_uid.inspect
397
+
398
+ app_child
399
+
400
+ end
340
401
 
341
402
  # == description
342
403
  # Returns details about the tested target. The data is platform/device specific which will make your scripts platform dependant. For devices with mobility apis the data available from them is returned and could be somewhat similar across platforms. Memory details are returned in a fixed format so they can be used and still maintain compatibility cross platforms. However it should be noted that platforms which do not support memory details will return -1 (scripts will not break but data will not be usable).
@@ -349,10 +410,13 @@ module MobyBehaviour
349
410
  def system_information
350
411
 
351
412
  # xml_source = execute_command( MobyCommand::Application.new( :SystemInfo, nil) )
413
+ # @sut.state_object( xml_source )
352
414
 
353
- xml_source = execute_command( MobyCommand::Application.new( :SystemInfo ) )
354
-
355
- MobyBase::StateObject.new( xml_source )
415
+ @sut.state_object(
416
+ execute_command(
417
+ MobyCommand::Application.new( :SystemInfo )
418
+ )
419
+ )
356
420
 
357
421
  end
358
422
 
@@ -439,10 +503,11 @@ module MobyBehaviour
439
503
  begin
440
504
  execute_command( command )
441
505
  nil
442
- rescue Exception => e
506
+ rescue Exception
443
507
 
444
- $logger.log "behaviour" , "FAIL;Failed tap_screen on coords \"#{x}:#{y}\";"
445
- Kernel::raise e
508
+ $logger.behaviour "FAIL;Failed tap_screen on coords \"#{ x }:#{ y }\";"
509
+
510
+ raise
446
511
 
447
512
  end
448
513
 
@@ -462,10 +527,10 @@ module MobyBehaviour
462
527
  begin
463
528
  # execute the application control service request
464
529
  execute_command( MobyCommand::Application.new( :CloseQttas ) )
465
- $logger.log "behaviour", "PASS;Successfully closed qttas.;#{ id };sut;{};close_qttas;"
530
+ $logger.behaviour "PASS;Successfully closed qttas.;#{ id };sut;{};close_qttas;"
466
531
  rescue Exception => e
467
- $logger.log "behaviour", "FAIL;Failed to close qttas.;#{ id };sut;{};close_qttas;"
468
- Kernel::raise RuntimeError.new( "Unable to close qttas: Exception: #{ e.message } (#{ e.class })" )
532
+ $logger.behaviour "FAIL;Failed to close qttas.;#{ id };sut;{};close_qttas;"
533
+ raise RuntimeError, "Unable to close qttas: Exception: #{ e.message } (#{ e.class })"
469
534
  end
470
535
  nil
471
536
  end
@@ -527,12 +592,12 @@ module MobyBehaviour
527
592
  )
528
593
  )
529
594
 
530
- $logger.log "behaviour", "PASS;Successfully started process memory logging.;#{ id };sut;{};log_process_mem_start;"
595
+ $logger.behaviour "PASS;Successfully started process memory logging.;#{ id };sut;{};log_process_mem_start;"
531
596
 
532
597
  rescue Exception => e
533
598
 
534
- $logger.log "behaviour", "FAIL;Failed to start process memory logging.;#{ id };sut;{};log_process_mem_start;"
535
- Kernel::raise RuntimeError.new( "Unable to start process memory logging: Exception: #{ e.message } (#{ e.class })" )
599
+ $logger.behaviour "FAIL;Failed to start process memory logging.;#{ id };sut;{};log_process_mem_start;"
600
+ raise RuntimeError, "Unable to start process memory logging: Exception: #{ e.message } (#{ e.class })"
536
601
 
537
602
  end
538
603
 
@@ -568,15 +633,6 @@ module MobyBehaviour
568
633
  log = nil
569
634
  begin
570
635
 
571
- =begin
572
- log = execute_command(
573
- MobyCommand::Application.new(
574
- :ProcessMemLoggingStop,
575
- thread_name,
576
- nil, nil, nil, nil, nil, nil,
577
- {:return_data => return_data} ) )
578
- =end
579
-
580
636
  log = execute_command(
581
637
  MobyCommand::Application.new(
582
638
  :ProcessMemLoggingStop,
@@ -584,10 +640,10 @@ module MobyBehaviour
584
640
  )
585
641
  )
586
642
 
587
- $logger.log "behaviour", "PASS;Successfully stopped process memory logging.;#{ id };sut;{};log_process_mem_stop;"
643
+ $logger.behaviour "PASS;Successfully stopped process memory logging.;#{ id };sut;{};log_process_mem_stop;"
588
644
  rescue Exception => e
589
- $logger.log "behaviour", "FAIL;Failed to stop process memory logging.;#{ id };sut;{};log_process_mem_stop;"
590
- Kernel::raise RuntimeError.new( "Unable to stop process memory logging: Exception: #{ e.message } (#{ e.class })" )
645
+ $logger.behaviour "FAIL;Failed to stop process memory logging.;#{ id };sut;{};log_process_mem_stop;"
646
+ raise RuntimeError, "Unable to stop process memory logging: Exception: #{ e.message } (#{ e.class })"
591
647
  end
592
648
  log
593
649
  end
@@ -627,13 +683,13 @@ module MobyBehaviour
627
683
  )
628
684
  )
629
685
 
630
- $logger.log "behaviour", "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
686
+ $logger.behaviour "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
631
687
 
632
688
  rescue Exception => e
633
689
 
634
- $logger.log "behaviour", "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
690
+ $logger.behaviour "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
635
691
 
636
- Kernel::raise RuntimeError.new( "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })" )
692
+ raise RuntimeError, "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })"
637
693
 
638
694
  end
639
695
 
@@ -652,10 +708,10 @@ module MobyBehaviour
652
708
  def cpu_load_stop
653
709
  begin
654
710
  status = execute_command(MobyCommand::Application.new(:CpuLoadStop) )
655
- $logger.log "behaviour", "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
711
+ $logger.behaviour "PASS;Successfully started generating CPU load.;#{ id };sut;{};cpu_load_start;"
656
712
  rescue Exception => e
657
- $logger.log "behaviour", "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
658
- Kernel::raise RuntimeError.new( "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })" )
713
+ $logger.behaviour "FAIL;Failed to start generating CPU load.;#{ id };sut;{};cpu_load_start;"
714
+ raise RuntimeError, "Unable to start generating CPU load: Exception: #{ e.message } (#{ e.class })"
659
715
  end
660
716
  end
661
717
 
@@ -686,31 +742,31 @@ module MobyBehaviour
686
742
  interval_millis = interval*1000 # to millis
687
743
 
688
744
  # make one refresh before execution then freeze
689
- find_object_state = self.parameter[ :use_find_object, false ]
690
- self.parameter[ :use_find_object] = false
745
+ find_object_state = self.parameter[ :use_find_object, false ]
746
+ self.parameter[ :use_find_object] = false
691
747
 
692
748
  app.force_refresh({:id => get_application_id})
693
749
  self.freeze
694
750
 
695
751
  #disable sleep to avoid unnecessary sleeping
696
- self.parameter[ :sleep_disabled ] = true
752
+ self.parameter[ :sleep_disabled ] = true
697
753
 
698
754
  ret = execute_command( MobyCommand::Group.new(interval_millis.to_i, app, block ) )
699
755
 
700
- self.parameter[ :sleep_disabled ] = false
701
- self.parameter[ :use_find_object] = find_object_state
756
+ self.parameter[ :sleep_disabled ] = false
757
+ self.parameter[ :use_find_object] = find_object_state
702
758
 
703
759
  self.unfreeze
704
760
 
705
761
  # the behaviour returns the amout of behaviours
706
- # sleep to avoid sending messages to the app untill the
762
+ # sleep to avoid sending messages to the app until the
707
763
  # commands have been executed
708
764
  sleep ( ret * interval )
709
765
 
710
- $logger.log "behaviour", "PASS;Successfully executed grouped behaviours.;#{ id };sut;{};group_behaviours;"
766
+ $logger.behaviour "PASS;Successfully executed grouped behaviours.;#{ id };sut;{};group_behaviours;"
711
767
  rescue Exception => e
712
- $logger.log "behaviour", "FAIL;Failed to execute grouped behaviours.;#{ id };sut;{};group_behaviours;"
713
- Kernel::raise RuntimeError.new( "Unable to execute grouped behaviours: Exception: #{ e.message } (#{ e.class })" )
768
+ $logger.behaviour "FAIL;Failed to execute grouped behaviours.;#{ id };sut;{};group_behaviours;"
769
+ raise RuntimeError, "Unable to execute grouped behaviours: Exception: #{ e.message } (#{ e.class })"
714
770
  end
715
771
  nil
716
772
  end
@@ -743,8 +799,8 @@ module MobyBehaviour
743
799
 
744
800
  # == nodoc
745
801
  # {:name => '', id => '', applicationUid => ''},[ {:objectName => '' , :className => , :text =>} ,..]
746
- def find_object( app_details = nil, objects = nil )
747
- execute_command( MobyCommand::FindObjectCommand.new( self, app_details, objects ) )
802
+ def find_object( app_details = nil, objects = nil, checksum = nil )
803
+ execute_command( MobyCommand::FindObjectCommand.new( self, app_details, objects, checksum ) )
748
804
  end
749
805
 
750
806
  # enable hooking for performance measurement & debug logging