testability-driver 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/ext/native_extensions.c +53 -25
  2. data/lib/matti.rb +0 -5
  3. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +4 -4
  4. data/lib/tdriver/base/behaviour/factory.rb +120 -7
  5. data/lib/tdriver/base/errors.rb +1 -1
  6. data/lib/tdriver/base/state_object.rb +3 -2
  7. data/lib/tdriver/base/sut/controller.rb +2 -2
  8. data/lib/tdriver/base/sut/factory.rb +207 -201
  9. data/lib/tdriver/base/sut/generic/behaviours/application.rb +3 -6
  10. data/lib/tdriver/base/sut/generic/behaviours/find.rb +1 -1
  11. data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +14 -14
  12. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +5 -5
  13. data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +14 -14
  14. data/lib/tdriver/base/sut/generic/behaviours/verification.rb +3 -18
  15. data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +6 -6
  16. data/lib/tdriver/base/sut/generic/plugin.rb +4 -9
  17. data/lib/tdriver/base/sut/sut.rb +2 -6
  18. data/lib/tdriver/base/test_object/abstract.rb +1 -1
  19. data/lib/tdriver/base/test_object/adapter.rb +5 -5
  20. data/lib/tdriver/base/test_object/behaviours/syncronization.rb +7 -6
  21. data/lib/tdriver/base/test_object/behaviours/test_object.rb +18 -18
  22. data/lib/tdriver/base/test_object/factory.rb +147 -96
  23. data/lib/tdriver/base/test_object/verification.rb +6 -9
  24. data/lib/tdriver/base/test_object/xml/adapter.rb +5 -5
  25. data/lib/tdriver/matti.rb +1 -1
  26. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +17 -8
  27. data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +7 -7
  28. data/lib/tdriver/report/report_api.rb +172 -79
  29. data/lib/tdriver/report/report_crash_file_capture.rb +4 -7
  30. data/lib/tdriver/report/report_creator.rb +16 -20
  31. data/lib/tdriver/report/report_file_capture.rb +3 -3
  32. data/lib/tdriver/report/report_javascript.rb +3 -3
  33. data/lib/tdriver/report/report_test_case_run.rb +20 -10
  34. data/lib/tdriver/report/report_test_run.rb +11 -10
  35. data/lib/tdriver/report/report_writer.rb +13 -11
  36. data/lib/tdriver/tdriver.rb +6 -6
  37. data/lib/tdriver/util/common/array.rb +2 -2
  38. data/lib/tdriver/util/common/file.rb +9 -11
  39. data/lib/tdriver/util/common/gem.rb +1 -1
  40. data/lib/tdriver/util/common/kernel.rb +4 -4
  41. data/lib/tdriver/util/common/retryable.rb +2 -2
  42. data/lib/tdriver/util/common/string.rb +2 -3
  43. data/lib/tdriver/util/hooking/hooking.rb +2 -2
  44. data/lib/tdriver/util/localisation/localisation.rb +12 -12
  45. data/lib/tdriver/util/logger/logger.rb +7 -25
  46. data/lib/tdriver/util/operator_data/operator_data.rb +5 -5
  47. data/lib/tdriver/util/parameter/parameter.rb +2 -2
  48. data/lib/tdriver/util/plugin/abstract.rb +4 -3
  49. data/lib/tdriver/util/plugin/service.rb +31 -4
  50. data/lib/tdriver/util/recorder/recorder.rb +4 -4
  51. data/lib/tdriver/util/user_data/user_data.rb +5 -5
  52. data/lib/tdriver/util/video/camera_windows.rb +1 -1
  53. data/lib/tdriver/util/xml/builder.rb +3 -1
  54. data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +1 -1
  55. data/lib/tdriver/util/xml/xml.rb +5 -5
  56. data/lib/tdriver/verify/verify.rb +26 -26
  57. data/lib/tdriver/version.rb +1 -1
  58. data/xml/behaviours/generic.xml +1 -2
  59. metadata +2 -3
  60. data/lib/tdriver/verify/verify.rb_org +0 -630
@@ -17,9 +17,6 @@
17
17
  ##
18
18
  ############################################################################
19
19
 
20
-
21
-
22
-
23
20
  class TDriverReportCrashFileCapture
24
21
  include TDriverReportFileCapture
25
22
  def initialize
@@ -48,7 +45,7 @@ class TDriverReportCrashFileCapture
48
45
 
49
46
  def clean_crash_files_from_sut()
50
47
  if @monitor_crash_files == 'true'
51
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
48
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
52
49
  if sut_attributes[:is_connected]
53
50
  @crash_file_suts.each do |monitored_sut|
54
51
  if monitored_sut == sut_id.to_s
@@ -65,7 +62,7 @@ class TDriverReportCrashFileCapture
65
62
  end
66
63
 
67
64
  def confirm_crash_notes
68
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
65
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
69
66
  if sut_attributes[:is_connected]
70
67
  @crash_file_suts.each do |monitored_sut|
71
68
  if monitored_sut == sut_id.to_s
@@ -127,7 +124,7 @@ class TDriverReportCrashFileCapture
127
124
  def check_if_crash_files_exist()
128
125
  sut_crash_files=Array.new
129
126
  if @monitor_crash_files == 'true'
130
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
127
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
131
128
  if sut_attributes[:is_connected]
132
129
  @crash_file_suts.each do |monitored_sut|
133
130
  if monitored_sut == sut_id.to_s
@@ -144,7 +141,7 @@ class TDriverReportCrashFileCapture
144
141
 
145
142
  def download_crash_files(download_folder)
146
143
  if @monitor_crash_files == 'true'
147
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
144
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
148
145
  if sut_attributes[:is_connected]
149
146
  @crash_file_suts.each do |monitored_sut|
150
147
  if monitored_sut == sut_id.to_s
@@ -62,7 +62,7 @@ module TDriverReportCreator
62
62
  puts 'Generating total run table...'
63
63
  $tdriver_reporter.update_test_case_summary_pages('all')
64
64
  puts 'Total run table generated...'
65
- if $tdriver_reporter.report_exclude_passed_cases=='false'
65
+ if $tdriver_reporter.report_exclude_passed_cases=='false'
66
66
  puts 'Generating passed cases table...'
67
67
  $tdriver_reporter.update_test_case_summary_pages('passed')
68
68
  puts 'Passed table generated...'
@@ -93,7 +93,7 @@ module TDriverReportCreator
93
93
  puts 'Report generated to:'
94
94
  puts $tdriver_reporter.report_folder()
95
95
  clean_video_files
96
- ending_test_set_run if $parameters[ :custom_error_recovery_module, nil ]!=nil
96
+ ending_test_set_run if $parameters[ :custom_error_recovery_module, nil ]!=nil
97
97
  if $tdriver_reporter.total_failed.to_i > 0
98
98
  Kernel.exit(1)
99
99
  elsif $tdriver_reporter.total_run.to_i == 0
@@ -115,10 +115,6 @@ module TDriverReportCreator
115
115
  # nil
116
116
  # === raises
117
117
  def error_in_connection_detected
118
- if start_error_recovery()==true
119
- $tdriver_reporter.set_total_device_resets(1)
120
- $new_test_case.set_test_case_reboots(1) if $new_test_case!=nil
121
- end
122
118
  error_in_connection if $parameters[ :custom_error_recovery_module, nil ]!=nil
123
119
  end
124
120
  #This method returns the group where the test case belongs
@@ -276,11 +272,11 @@ module TDriverReportCreator
276
272
  $new_test_case.read_crash_monitor_settings()
277
273
 
278
274
  $new_test_case.read_file_monitor_settings()
279
-
275
+
280
276
  $new_test_case.clean_crash_files_from_sut() if $test_case_run_index==1 && $parameters[ :report_crash_file_monitor_crash_file_cleanup, false ]=='true'
281
277
 
282
278
  amount_of_crash_files=$new_test_case.check_if_crash_files_exist()
283
-
279
+
284
280
  if amount_of_crash_files.to_i > 0
285
281
  $new_test_case.capture_crash_files()
286
282
  $new_test_case.clean_crash_files_from_sut()
@@ -302,7 +298,7 @@ module TDriverReportCreator
302
298
 
303
299
  if $parameters[ :report_monitor_memory, 'false']=='true'
304
300
  begin
305
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
301
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
306
302
  $new_test_case.set_tc_memory_amount_total($tdriver_reporter.get_sut_total_memory(sut_id,sut_attributes))
307
303
  $new_test_case.set_tc_memory_amount_start($tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes))
308
304
  end
@@ -337,7 +333,7 @@ module TDriverReportCreator
337
333
  MobyUtil::Logger.instance.enabled=logging_enabled
338
334
  end
339
335
  update_test_case_user_data()
340
- starting_test_case(test_case, MobyBase::SUTFactory.instance.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
336
+ starting_test_case(test_case, TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
341
337
  end
342
338
  #This method updates the current test case execution log
343
339
  #
@@ -364,7 +360,7 @@ module TDriverReportCreator
364
360
  begin
365
361
  start_memory=$new_test_case.tc_memory_amount_start()
366
362
  if start_memory=='-'
367
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
363
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
368
364
  memory=$tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes)
369
365
  $new_test_case.set_tc_memory_amount_start(memory)
370
366
  end
@@ -408,11 +404,11 @@ module TDriverReportCreator
408
404
  if $new_test_case.video_recording?
409
405
  $new_test_case.copy_video_capture()
410
406
  end
411
- error_in_test_case(MobyBase::SUTFactory.instance.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
407
+ error_in_test_case(TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
412
408
  begin
413
-
409
+
414
410
  error_in_connection_detected
415
-
411
+
416
412
  rescue Exception => e
417
413
  update_test_case("Error recovery failed Exception: #{e.message} Backtrace: #{e.backtrace}")
418
414
  end_test_case($new_test_case.test_case_name,'failed')
@@ -431,7 +427,7 @@ module TDriverReportCreator
431
427
  # === raises
432
428
  def update_test_case_memory_usage()
433
429
  begin
434
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
430
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
435
431
  if sut_attributes[:is_connected]
436
432
  memory=$tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes)
437
433
  $tdriver_reporter.get_sut_total_dump_count(sut_id,sut_attributes)
@@ -466,7 +462,7 @@ module TDriverReportCreator
466
462
  end
467
463
 
468
464
  def calculate_execution_footprint_data_for_test_case
469
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
465
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
470
466
  if sut_attributes[:is_connected]
471
467
  $tdriver_reporter.get_sut_total_dump_count(sut_id,sut_attributes)
472
468
  $tdriver_reporter.get_sut_total_sent_data(sut_id,sut_attributes)
@@ -598,15 +594,15 @@ module TDriverReportCreator
598
594
  $new_test_case.clean_files_from_sut()
599
595
 
600
596
  update_run($new_test_case.test_case_name.to_s,status,$new_test_case.test_case_reboots,$new_test_case.test_case_crash_files,execution_log)
601
-
597
+
602
598
  $new_junit_xml_results.add_test_result(status, $new_test_case.test_case_start_time, $new_test_case.test_case_end_time)
603
- tdriver_update_sequential_fails( status ) if $parameters[ :runner_sequence_skip, "false" ] == "true"
604
-
599
+ tdriver_update_sequential_fails( status ) if $parameters[ :runner_sequence_skip, "false" ] == "true"
600
+
605
601
  $new_test_case=nil
606
602
  execution_log=nil
607
603
 
608
604
  end
609
- ending_test_case(status, MobyBase::SUTFactory.instance.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
605
+ ending_test_case(status, TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil
610
606
  end
611
607
  def add_report_group(value)
612
608
  $tdriver_reporter.set_generic_reporting_groups(value)
@@ -47,7 +47,7 @@ module TDriverReportFileCapture
47
47
  def clean_files_from_sut()
48
48
 
49
49
  if @monitor_files == 'true' && @clean_files == 'true'
50
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
50
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
51
51
  if sut_attributes[:is_connected]
52
52
  @file_suts.each do |monitored_sut|
53
53
  if monitored_sut == sut_id.to_s
@@ -107,7 +107,7 @@ module TDriverReportFileCapture
107
107
  def check_if_files_exist()
108
108
  sut_files=Array.new
109
109
  if @monitor_files == 'true'
110
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
110
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
111
111
  if sut_attributes[:is_connected]
112
112
  @file_suts.each do |monitored_sut|
113
113
  if monitored_sut == sut_id.to_s
@@ -124,7 +124,7 @@ module TDriverReportFileCapture
124
124
 
125
125
  def download_files(download_folder)
126
126
  if @monitor_files == 'true'
127
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
127
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
128
128
  if sut_attributes[:is_connected]
129
129
  @file_suts.each do |monitored_sut|
130
130
  if monitored_sut == sut_id.to_s
@@ -20,7 +20,7 @@
20
20
 
21
21
  module TDriverReportJavascript
22
22
 
23
- def get_expand_collapse_java_script()
23
+ def self.get_expand_collapse_java_script
24
24
  java_script='<script type="text/javascript">'<<
25
25
  '/* Only set closed if JS-enabled */'<<
26
26
  "document.getElementsByTagName('html')[0].className = 'isJS';"<<
@@ -45,8 +45,8 @@ module TDriverReportJavascript
45
45
  java_script
46
46
  end
47
47
 
48
- def get_table_sorting_java_script()
49
- java_script="
48
+ def self.get_table_sorting_java_script
49
+ java_script="
50
50
  function TSorter(){
51
51
  var table = Object;
52
52
  var trs = Array;
@@ -509,7 +509,7 @@ module TDriverReportCreator
509
509
  write_page_end(@test_case_folder+'/index.html')
510
510
 
511
511
  rescue Exception => e
512
- Kernel::raise e
512
+ raise e
513
513
  end
514
514
  return nil
515
515
  end
@@ -571,7 +571,7 @@ module TDriverReportCreator
571
571
  if File::directory?(dump_folder)==false
572
572
  FileUtils.mkdir_p dump_folder
573
573
  end
574
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
574
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
575
575
 
576
576
  t = Time.now
577
577
  time_stamp=t.strftime( "%Y%m%d%H%M%S" )
@@ -600,15 +600,25 @@ module TDriverReportCreator
600
600
  end
601
601
 
602
602
  begin
603
- failed_xml_state=sut_attributes[:sut].xml_data() if sut_attributes[:is_connected]
604
- File.open(dump_folder+'/'+time_stamp+'_'+sut_id.to_s+'_state.xml', 'w') { |file| file.write(failed_xml_state) }
605
- state_html='<a href="state_xml/'<<
606
- time_stamp+'_'+sut_id.to_s+'_state.xml'<<
607
- '">'+time_stamp+'_'+sut_id.to_s+'_state.xml'+'</a>'
608
- self.set_test_case_execution_log(state_html.to_s)
603
+ if sut_attributes[:is_connected]
604
+ original_filter=sut_attributes[:sut].parameter[ :filter_type]
605
+ original_find=sut_attributes[:sut].parameter[ :use_find_object]
606
+ sut_attributes[:sut].parameter[ :filter_type] = 'none'
607
+ sut_attributes[:sut].parameter[ :use_find_object] = 'false'
608
+ sut_attributes[:sut].refresh
609
+ failed_xml_state=sut_attributes[:sut].xml_data()
610
+ File.open(dump_folder+'/'+time_stamp+'_'+sut_id.to_s+'_state.xml', 'w') { |file| file.write(failed_xml_state) }
611
+ state_html='<a href="state_xml/'<<
612
+ time_stamp+'_'+sut_id.to_s+'_state.xml'<<
613
+ '">'+time_stamp+'_'+sut_id.to_s+'_state.xml'+'</a>'
614
+ self.set_test_case_execution_log(state_html.to_s)
615
+ end
609
616
  rescue Exception=>e
610
617
  @failed_dump_error="Unable to capture state xml #{sut_id}: " + e.message
611
618
  self.set_test_case_execution_log(@failed_dump_error.to_s)
619
+ ensure
620
+ sut_attributes[:sut].parameter[ :filter_type]=original_filter
621
+ sut_attributes[:sut].parameter[ :use_find_object]=original_find
612
622
  end
613
623
  end
614
624
  rescue Exception => e
@@ -664,7 +674,7 @@ module TDriverReportCreator
664
674
  FileUtils.mkdir_p @test_case_folder
665
675
  end
666
676
  rescue Exception => e
667
- Kernel::raise e
677
+ raise e
668
678
  end
669
679
  return nil
670
680
  end
@@ -691,7 +701,7 @@ module TDriverReportCreator
691
701
  @test_case_folder=new_test_case_folder
692
702
  end
693
703
  rescue Exception => e
694
- Kernel::raise e
704
+ raise e
695
705
  end
696
706
  return nil
697
707
  end
@@ -17,7 +17,6 @@
17
17
  ##
18
18
  ############################################################################
19
19
 
20
-
21
20
  module TDriverReportCreator
22
21
 
23
22
  #Test run class for new test run
@@ -513,7 +512,7 @@ module TDriverReportCreator
513
512
 
514
513
  end
515
514
  rescue Exception => e
516
- Kernel::raise e, "Unable to create report folder: #{@report_folder}", caller
515
+ raise e, "Unable to create report folder: #{@report_folder}", caller
517
516
  end
518
517
  return nil
519
518
  end
@@ -562,7 +561,7 @@ module TDriverReportCreator
562
561
  write_page_end(@report_folder+'/index.html')
563
562
  end
564
563
  rescue Exception => e
565
- Kernel::raise e, "Unable to update summary page", e.backtrace
564
+ raise e, "Unable to update summary page", e.backtrace
566
565
  end
567
566
  return nil
568
567
  end
@@ -593,7 +592,7 @@ module TDriverReportCreator
593
592
  FileUtils.copy('/etc/tdriver/tdriver_parameters.xml',@report_folder+'/environment/tdriver_parameters.xml') if File.file?('/etc/tdriver/tdriver_parameters.xml')
594
593
  end
595
594
  if $parameters[ :report_monitor_memory, 'false']=='true'
596
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
595
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
597
596
  if sut_attributes[:is_connected]
598
597
  @memory_amount_start=get_sut_used_memory(sut_id, sut_attributes) if @memory_amount_start==nil || @memory_amount_start=='-'
599
598
  @memory_amount_end=get_sut_used_memory(sut_id, sut_attributes)
@@ -605,7 +604,7 @@ module TDriverReportCreator
605
604
  end
606
605
  end
607
606
  if $parameters[ :report_collect_environment_data_from_sut, 'true']=='true'
608
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
607
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
609
608
  begin
610
609
  if sut_attributes[:is_connected]
611
610
  sw_version=get_sut_sw_version(sut_id, sut_attributes)
@@ -636,7 +635,9 @@ module TDriverReportCreator
636
635
  write_page_end(@report_folder+'/environment/index.html')
637
636
  $new_junit_xml_results.test_suite_properties(RUBY_PLATFORM,sw_version,variant,product,language,loc,@memory_amount_total,@memory_amount_start,@memory_amount_end)
638
637
  rescue Exception => e
639
- Kernel::raise e, "Unable to update environment page", caller
638
+ p e.message
639
+ p e.backtrace
640
+ raise e, "Unable to update environment page"
640
641
  end
641
642
  return nil
642
643
  end
@@ -653,7 +654,7 @@ module TDriverReportCreator
653
654
  write_tdriver_log_body(@report_folder+'/cases/tdriver_log_index.html',@test_run_behaviour_log)
654
655
  write_page_end(@report_folder+'/cases/tdriver_log_index.html')
655
656
  rescue Exception => e
656
- Kernel::raise e
657
+ raise e
657
658
  end
658
659
  return nil
659
660
  end
@@ -1213,7 +1214,7 @@ module TDriverReportCreator
1213
1214
  # === raises
1214
1215
  def disconnect_connected_devices()
1215
1216
  if $parameters[ :report_disconnect_connected_devices, false ] == 'true'
1216
- MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
1217
+ TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
1217
1218
  sut_attributes[:sut].disconnect() if sut_attributes[:is_connected]
1218
1219
  end
1219
1220
  end
@@ -1335,7 +1336,7 @@ module TDriverReportCreator
1335
1336
  @all_cases_arr=nil
1336
1337
  update_test_case_summary_pages_for_crashes_and_reboots(rewrite)
1337
1338
  rescue Exception => e
1338
- Kernel::raise e, "Unable to update test case summary pages", caller
1339
+ raise e, "Unable to update test case summary pages", caller
1339
1340
  end
1340
1341
  return nil
1341
1342
  end
@@ -1346,7 +1347,7 @@ module TDriverReportCreator
1346
1347
  update_test_case_summary_page('crash',rewrite,'Crash')
1347
1348
  update_test_case_summary_page('reboot',rewrite,'Reboot')
1348
1349
  rescue Exception => e
1349
- Kernel::raise e, "Unable to update test case summary pages for crashes and reboots", caller
1350
+ raise e, "Unable to update test case summary pages for crashes and reboots", caller
1350
1351
  end
1351
1352
  return nil
1352
1353
  end
@@ -17,7 +17,6 @@
17
17
  ##
18
18
  ############################################################################
19
19
 
20
- include TDriverReportJavascript
21
20
  module TDriverReportWriter
22
21
 
23
22
  def write_style_sheet(page)
@@ -489,15 +488,15 @@ display: block;
489
488
  end
490
489
  end
491
490
 
492
- def copy_code_file_to_test_case_report(file,folder,linen)
491
+ def copy_code_file_to_test_case_report(file,folder,linen,time_stamp)
493
492
  begin
494
493
  FileUtils.mkdir_p(folder.to_s+'/stack_files') if File::directory?(folder.to_s+'/stack_files')==false
495
494
  if File.directory?("#{Dir.pwd}/#{@report_folder}/#{folder}")
496
- write_stack_file_to_html(file,"#{Dir.pwd}/#{@report_folder}/#{folder}/stack_files/#{File.basename(file)}.html",linen)
497
- FileUtils.copy(file,"#{Dir.pwd}/#{@report_folder}/#{folder}/stack_files/#{File.basename(file)}")
495
+ write_stack_file_to_html(file,"#{Dir.pwd}/#{@report_folder}/#{folder}/stack_files/stk_#{time_stamp}.html",linen)
496
+ FileUtils.copy(file,"#{Dir.pwd}/#{@report_folder}/#{folder}/stack_files/stk_#{time_stamp}.rb")
498
497
  else
499
- write_stack_file_to_html(file,"#{folder}/stack_files/#{File.basename(file)}.html",linen)
500
- FileUtils.copy(file,"#{folder}/stack_files/#{File.basename(file)}")
498
+ write_stack_file_to_html(file,"#{folder}/stack_files/stk_#{time_stamp}.html",linen)
499
+ FileUtils.copy(file,"#{folder}/stack_files/stk_#{time_stamp}.rb")
501
500
  end
502
501
 
503
502
  rescue Exception => e
@@ -508,6 +507,9 @@ display: block;
508
507
 
509
508
  def reporter_link_to_code(log_line,folder=nil)
510
509
  begin
510
+ t = Time.now
511
+ time_stamp=t.strftime( "%Y%m%d%H%M%S" )
512
+
511
513
  log_line.gsub(/([\w \*\/\w\/\.-]+)\:(\d+)/) do |match|
512
514
  line=match[/\:(\d+)/]
513
515
  f=match[/([\w \*\/\w\/\.-]+)/]
@@ -515,9 +517,9 @@ display: block;
515
517
  file = file if File.exist?(file)
516
518
  file = "#{Dir.pwd}/#{file}" if File.exist?("#{Dir.pwd}/#{file}")
517
519
  if File.exist?(file) && match.include?('testability-driver')==false
518
- copy_code_file_to_test_case_report(file,folder,line.gsub(':','').strip)
519
- link_to_stack='<a style="color: #FF0000" href="stack_files/'<<
520
- File.basename(file.to_s)+'.html#'+line.to_s.gsub(':','')<<
520
+ copy_code_file_to_test_case_report(file,folder,line.gsub(':','').strip,time_stamp)
521
+ link_to_stack='<a style="color: #FF0000" href="stack_files/stk_'<<
522
+ time_stamp+'.html#'+line.to_s.gsub(':','')<<
521
523
  '">'+match+'</a>'
522
524
  log_line=log_line.gsub(match,link_to_stack)
523
525
  end
@@ -683,7 +685,7 @@ display: block;
683
685
  '<html xmlns="http://www.w3.org/1999/xhtml">'<<
684
686
  '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"><META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">'<<
685
687
  stylesheet<<
686
- get_expand_collapse_java_script()<<
688
+ get_java_script<<
687
689
  '<title>'+title+'</title>'<<
688
690
  '</head><body>'
689
691
  File.open(page, 'w') do |f2|
@@ -1495,7 +1497,7 @@ display: block;
1495
1497
  page_ready
1496
1498
  end
1497
1499
  def get_java_script()
1498
- get_expand_collapse_java_script()
1500
+ TDriverReportJavascript.get_expand_collapse_java_script()
1499
1501
  end
1500
1502
 
1501
1503
  def scan_rdoc_file_for_method(file,method_name)
@@ -46,18 +46,18 @@ module TDriver
46
46
  # hash:: Defines SUT type, identification attributes etc.
47
47
  # :id:: Valid id that can be matched in tdriver_parameters.xml
48
48
  # === raises
49
- # ArgumentError:: Wrong argument Type '%s' (Expected Hash)
49
+ # ArgumentError:: Wrong argument type <class> (expected Hash)
50
50
  # ArgumentError:: SUT type not defined
51
- # ArgumentError:: SUT type '%s' not supported
51
+ # ArgumentError:: SUT type <name> not supported
52
52
  # ArgumentError:: Sut id not given
53
53
  # MobyUtil::ParameterFileNotFoundError:: if paramter file (tdriver_parameters.xml in TDriver home directory) is not found
54
54
  # === returns
55
- # Object:: Object that SutFactory returns
55
+ # Object:: Object that SUTFactory returns
56
56
  # === example
57
57
  # @sut = TDriver.connect_sut(:Id =>'sut_qt') # for qt, id in configuration file sut_qt
58
58
  def connect_sut( sut_attributes = {} )
59
59
 
60
- MobyBase::SUTFactory.instance.make( sut_attributes )
60
+ TDriver::SUTFactory.make( sut_attributes )
61
61
 
62
62
  end
63
63
 
@@ -74,7 +74,7 @@ module TDriver
74
74
  # @sut = TDriver.disconnect_sut(:Id =>'sut_qt') # for qt, should be connected already
75
75
  def disconnect_sut( sut_attributes = {} )
76
76
 
77
- MobyBase::SUTFactory.instance.disconnect_sut( sut_attributes )
77
+ TDriver::SUTFactory.disconnect_sut( sut_attributes )
78
78
 
79
79
  end
80
80
 
@@ -89,7 +89,7 @@ module TDriver
89
89
  # @sut = TDriver.reboot_sut(:Id => 'sut_qt') # for Qt, should be connected already
90
90
  def reboot_sut( sut_attributes = {} )
91
91
 
92
- MobyBase::SUTFactory.instance.reboot_sut( sut_attributes )
92
+ TDriver::SUTFactory.reboot_sut( sut_attributes )
93
93
 
94
94
  end
95
95