cutedriver-driver 2.0.0.20210120164037
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/README.md +16 -0
 - data/bin/start_app_perf +200 -0
 - data/bin/tdriver-devtools +3 -0
 - data/config/sut_parameters.rb +52 -0
 - data/config/sut_setup.rb +32 -0
 - data/config/sut_teardown.rb +32 -0
 - data/config/tdriver_custom_error_recovery.rb +83 -0
 - data/ext/extconf.rb +70 -0
 - data/ext/native_extensions.c +315 -0
 - data/lib/matti.rb +25 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +120 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/example/impl.rb_invalid +194 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/generate_behaviour_xml.rb +95 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/lib/tdriver_generator.rb +722 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/qdoc_generator.rb +321 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.method.template +43 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.module.template +54 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument.template +7 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument_type.template +7 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.exception.template +5 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.line.template +2 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.template +5 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.method.template +23 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.template +14 -0
 - data/lib/tdriver-devtools/behaviour/old/xml/update +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/generate.rb +88 -0
 - data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +1945 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.default.template +1 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.template +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument_type.template +4 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.exception.template +4 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.arguments.template +4 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.deprecated.template +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.exceptions.template +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.info.template +1 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.returns.template +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.tables.template +3 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.template +12 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.returns.template +5 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.item.template +1 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.row.template +2 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.template +8 -0
 - data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.template +14 -0
 - data/lib/tdriver-devtools/doc/behaviour_xml/QtExampleGestureBehaviour.xml +138 -0
 - data/lib/tdriver-devtools/doc/behaviour_xml/created.rid +1 -0
 - data/lib/tdriver-devtools/doc/behaviour_xml/tdriver.hash +1 -0
 - data/lib/tdriver-devtools/doc/feature_xml/qt_widget_hold.feature.xml +9 -0
 - data/lib/tdriver-devtools/doc/feature_xml/qt_widget_tap.feature.xml +9 -0
 - data/lib/tdriver-devtools/doc/generate.rb +917 -0
 - data/lib/tdriver-devtools/doc/update +1 -0
 - data/lib/tdriver-devtools/doc/xslt/html.rb +7 -0
 - data/lib/tdriver-devtools/doc/xslt/template.xsl +2170 -0
 - data/lib/tdriver-devtools/doc/xslt/update +3 -0
 - data/lib/tdriver-devtools/plugin/placeholder.txt +1 -0
 - data/lib/tdriver-devtools/tdriver-devtools.rb +404 -0
 - data/lib/tdriver-devtools/tests/feature_tests/example/behaviour_example.rb +100 -0
 - data/lib/tdriver-devtools/tests/feature_tests/generate.rb +82 -0
 - data/lib/tdriver-devtools/tests/feature_tests/lib/custom_rdoc_generator.rb +468 -0
 - data/lib/tdriver-devtools/tests/feature_tests/templates/feature_attribute.template +5 -0
 - data/lib/tdriver-devtools/tests/feature_tests/templates/feature_method.template +5 -0
 - data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_attribute.template +5 -0
 - data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_method.template +5 -0
 - data/lib/tdriver-devtools/tests/feature_tests/update +3 -0
 - data/lib/tdriver.rb +23 -0
 - data/lib/tdriver/base/behaviour/abstract.rb +29 -0
 - data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
 - data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +99 -0
 - data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +278 -0
 - data/lib/tdriver/base/behaviour/behaviours/object_composition.rb +119 -0
 - data/lib/tdriver/base/behaviour/factory.rb +495 -0
 - data/lib/tdriver/base/behaviour/loader.rb +46 -0
 - data/lib/tdriver/base/command_data/command_data.rb +51 -0
 - data/lib/tdriver/base/command_data/loader.rb +29 -0
 - data/lib/tdriver/base/controller/abstraction.rb +56 -0
 - data/lib/tdriver/base/controller/loader.rb +21 -0
 - data/lib/tdriver/base/errors.rb +134 -0
 - data/lib/tdriver/base/loader.rb +47 -0
 - data/lib/tdriver/base/state_object.rb +373 -0
 - data/lib/tdriver/base/sut/adapter.rb +54 -0
 - data/lib/tdriver/base/sut/controller.rb +151 -0
 - data/lib/tdriver/base/sut/factory.rb +339 -0
 - data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
 - data/lib/tdriver/base/sut/generic/behaviours/application.rb +427 -0
 - data/lib/tdriver/base/sut/generic/behaviours/controller.rb +67 -0
 - data/lib/tdriver/base/sut/generic/behaviours/find.rb +107 -0
 - data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +337 -0
 - data/lib/tdriver/base/sut/generic/behaviours/sut.rb +1888 -0
 - data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +210 -0
 - data/lib/tdriver/base/sut/generic/behaviours/verification.rb +222 -0
 - data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
 - data/lib/tdriver/base/sut/generic/commands/application.rb +274 -0
 - data/lib/tdriver/base/sut/generic/commands/fixture.rb +47 -0
 - data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +94 -0
 - data/lib/tdriver/base/sut/generic/commands/screen_capture.rb +64 -0
 - data/lib/tdriver/base/sut/generic/plugin.rb +97 -0
 - data/lib/tdriver/base/sut/loader.rb +35 -0
 - data/lib/tdriver/base/sut/sut.rb +98 -0
 - data/lib/tdriver/base/test_object/abstract.rb +208 -0
 - data/lib/tdriver/base/test_object/adapter.rb +740 -0
 - data/lib/tdriver/base/test_object/behaviours/syncronization.rb +144 -0
 - data/lib/tdriver/base/test_object/behaviours/test_object.rb +1047 -0
 - data/lib/tdriver/base/test_object/cache.rb +134 -0
 - data/lib/tdriver/base/test_object/factory.rb +684 -0
 - data/lib/tdriver/base/test_object/loader.rb +51 -0
 - data/lib/tdriver/base/test_object/verification.rb +178 -0
 - data/lib/tdriver/base/test_object/xml/abstraction.rb +63 -0
 - data/lib/tdriver/base/test_object/xml/adapter.rb +773 -0
 - data/lib/tdriver/env.rb +21 -0
 - data/lib/tdriver/loader.rb +57 -0
 - data/lib/tdriver/matti.rb +35 -0
 - data/lib/tdriver/report/error_recovery/tdriver_custom_error_recovery.rb +83 -0
 - data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +168 -0
 - data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +106 -0
 - data/lib/tdriver/report/report.rb +61 -0
 - data/lib/tdriver/report/report_api.rb +348 -0
 - data/lib/tdriver/report/report_combine.rb +86 -0
 - data/lib/tdriver/report/report_crash_file_capture.rb +178 -0
 - data/lib/tdriver/report/report_creator.rb +665 -0
 - data/lib/tdriver/report/report_cucumber.rb +158 -0
 - data/lib/tdriver/report/report_cucumber_listener.rb +184 -0
 - data/lib/tdriver/report/report_cucumber_reporter.rb +181 -0
 - data/lib/tdriver/report/report_data_presentation.rb +156 -0
 - data/lib/tdriver/report/report_data_table.rb +64 -0
 - data/lib/tdriver/report/report_execution_statistics.rb +400 -0
 - data/lib/tdriver/report/report_file_capture.rb +159 -0
 - data/lib/tdriver/report/report_graph_generator.rb +59 -0
 - data/lib/tdriver/report/report_grouping.rb +541 -0
 - data/lib/tdriver/report/report_javascript.rb +199 -0
 - data/lib/tdriver/report/report_junit_xml.rb +147 -0
 - data/lib/tdriver/report/report_rspec.rb +108 -0
 - data/lib/tdriver/report/report_test_case_run.rb +725 -0
 - data/lib/tdriver/report/report_test_run.rb +1476 -0
 - data/lib/tdriver/report/report_test_unit.rb +223 -0
 - data/lib/tdriver/report/report_writer.rb +1621 -0
 - data/lib/tdriver/tdriver.rb +209 -0
 - data/lib/tdriver/util/agent/loader.rb +22 -0
 - data/lib/tdriver/util/agent/service.rb +107 -0
 - data/lib/tdriver/util/common/array.rb +39 -0
 - data/lib/tdriver/util/common/boolean.rb +48 -0
 - data/lib/tdriver/util/common/crc16.rb +149 -0
 - data/lib/tdriver/util/common/environment.rb +154 -0
 - data/lib/tdriver/util/common/error.rb +40 -0
 - data/lib/tdriver/util/common/exception.rb +53 -0
 - data/lib/tdriver/util/common/exceptions.rb +12 -0
 - data/lib/tdriver/util/common/file.rb +328 -0
 - data/lib/tdriver/util/common/gem.rb +109 -0
 - data/lib/tdriver/util/common/hash.rb +288 -0
 - data/lib/tdriver/util/common/kernel.rb +253 -0
 - data/lib/tdriver/util/common/loader.rb +47 -0
 - data/lib/tdriver/util/common/numeric.rb +159 -0
 - data/lib/tdriver/util/common/object.rb +159 -0
 - data/lib/tdriver/util/common/retryable.rb +179 -0
 - data/lib/tdriver/util/common/stackable.rb +185 -0
 - data/lib/tdriver/util/common/string.rb +174 -0
 - data/lib/tdriver/util/database/access.rb +240 -0
 - data/lib/tdriver/util/database/connection.rb +44 -0
 - data/lib/tdriver/util/database/error.rb +34 -0
 - data/lib/tdriver/util/database/loader.rb +28 -0
 - data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
 - data/lib/tdriver/util/filters/loader.rb +29 -0
 - data/lib/tdriver/util/fixture/loader.rb +22 -0
 - data/lib/tdriver/util/fixture/service.rb +211 -0
 - data/lib/tdriver/util/hooking/hooking.rb +477 -0
 - data/lib/tdriver/util/keymap/keymap.rb +81 -0
 - data/lib/tdriver/util/loader.rb +80 -0
 - data/lib/tdriver/util/localisation/error.rb +31 -0
 - data/lib/tdriver/util/localisation/loader.rb +25 -0
 - data/lib/tdriver/util/localisation/localisation.rb +762 -0
 - data/lib/tdriver/util/logger/loader.rb +22 -0
 - data/lib/tdriver/util/logger/logger.rb +591 -0
 - data/lib/tdriver/util/operator_data/error.rb +29 -0
 - data/lib/tdriver/util/operator_data/loader.rb +27 -0
 - data/lib/tdriver/util/operator_data/operator_data.rb +93 -0
 - data/lib/tdriver/util/other/config.rb +221 -0
 - data/lib/tdriver/util/parameter/error.rb +48 -0
 - data/lib/tdriver/util/parameter/loader.rb +25 -0
 - data/lib/tdriver/util/parameter/parameter.rb +1161 -0
 - data/lib/tdriver/util/plugin/abstract.rb +61 -0
 - data/lib/tdriver/util/plugin/error.rb +0 -0
 - data/lib/tdriver/util/plugin/loader.rb +28 -0
 - data/lib/tdriver/util/plugin/service.rb +319 -0
 - data/lib/tdriver/util/recorder/loader.rb +25 -0
 - data/lib/tdriver/util/recorder/recorder.rb +72 -0
 - data/lib/tdriver/util/recorder/scripter.rb +294 -0
 - data/lib/tdriver/util/statistics/statistics.rb +89 -0
 - data/lib/tdriver/util/user_data/error.rb +28 -0
 - data/lib/tdriver/util/user_data/loader.rb +25 -0
 - data/lib/tdriver/util/user_data/user_data.rb +104 -0
 - data/lib/tdriver/util/video/camera.rb +67 -0
 - data/lib/tdriver/util/video/camera_linux.rb +153 -0
 - data/lib/tdriver/util/video/camera_windows.rb +174 -0
 - data/lib/tdriver/util/video/loader.rb +31 -0
 - data/lib/tdriver/util/video/video_utils.rb +139 -0
 - data/lib/tdriver/util/xml/abstraction.rb +117 -0
 - data/lib/tdriver/util/xml/attribute.rb +32 -0
 - data/lib/tdriver/util/xml/builder.rb +53 -0
 - data/lib/tdriver/util/xml/comment.rb +32 -0
 - data/lib/tdriver/util/xml/document.rb +32 -0
 - data/lib/tdriver/util/xml/element.rb +32 -0
 - data/lib/tdriver/util/xml/error.rb +46 -0
 - data/lib/tdriver/util/xml/loader.rb +62 -0
 - data/lib/tdriver/util/xml/nil_node.rb +95 -0
 - data/lib/tdriver/util/xml/nodeset.rb +32 -0
 - data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +140 -0
 - data/lib/tdriver/util/xml/parsers/loader.rb +21 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +167 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +66 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/builder.rb +64 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/comment.rb +39 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +66 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/element.rb +39 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/loader.rb +58 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +212 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +237 -0
 - data/lib/tdriver/util/xml/parsers/nokogiri/text.rb +39 -0
 - data/lib/tdriver/util/xml/text.rb +32 -0
 - data/lib/tdriver/util/xml/xml.rb +332 -0
 - data/lib/tdriver/verify/verify.rb +2398 -0
 - data/lib/tdriver/version.rb +21 -0
 - data/xml/behaviours/generic.xml +530 -0
 - data/xml/defaults/generic.xml +11 -0
 - data/xml/defaults/sut_generic.xml +8 -0
 - data/xml/parameters/tdriver_parameters.xml +23 -0
 - data/xml/templates/generic.xml +292 -0
 - metadata +324 -0
 
| 
         @@ -0,0 +1,199 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 2 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 3 
     | 
    
         
            +
            ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 
         
     | 
| 
      
 4 
     | 
    
         
            +
            ## All rights reserved. 
         
     | 
| 
      
 5 
     | 
    
         
            +
            ## Contact: Nokia Corporation (testabilitydriver@nokia.com) 
         
     | 
| 
      
 6 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 7 
     | 
    
         
            +
            ## This file is part of Testability Driver. 
         
     | 
| 
      
 8 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 9 
     | 
    
         
            +
            ## If you have questions regarding the use of this file, please contact 
         
     | 
| 
      
 10 
     | 
    
         
            +
            ## Nokia at testabilitydriver@nokia.com . 
         
     | 
| 
      
 11 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 12 
     | 
    
         
            +
            ## This library is free software; you can redistribute it and/or 
         
     | 
| 
      
 13 
     | 
    
         
            +
            ## modify it under the terms of the GNU Lesser General Public 
         
     | 
| 
      
 14 
     | 
    
         
            +
            ## License version 2.1 as published by the Free Software Foundation 
         
     | 
| 
      
 15 
     | 
    
         
            +
            ## and appearing in the file LICENSE.LGPL included in the packaging 
         
     | 
| 
      
 16 
     | 
    
         
            +
            ## of this file. 
         
     | 
| 
      
 17 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 18 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            module TDriverReportJavascript
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              def self.get_expand_collapse_java_script
         
     | 
| 
      
 24 
     | 
    
         
            +
                java_script='<script type="text/javascript">'<<
         
     | 
| 
      
 25 
     | 
    
         
            +
                  '/* Only set closed if JS-enabled */'<<
         
     | 
| 
      
 26 
     | 
    
         
            +
                  "document.getElementsByTagName('html')[0].className = 'isJS';"<<
         
     | 
| 
      
 27 
     | 
    
         
            +
                  'function tog(dt)'<<
         
     | 
| 
      
 28 
     | 
    
         
            +
                  '{'<<
         
     | 
| 
      
 29 
     | 
    
         
            +
                  'var display, dd=dt;'<<
         
     | 
| 
      
 30 
     | 
    
         
            +
                  '/* get dd */'<<
         
     | 
| 
      
 31 
     | 
    
         
            +
                  "do{ dd = dd.nextSibling } while(dd.tagName!='DD');"<<
         
     | 
| 
      
 32 
     | 
    
         
            +
                  'toOpen =!dd.style.display;'<<
         
     | 
| 
      
 33 
     | 
    
         
            +
                  "dd.style.display = toOpen? 'none':'';"<<
         
     | 
| 
      
 34 
     | 
    
         
            +
                  "dt.getElementsByTagName('span')[0].innerHTML"<<
         
     | 
| 
      
 35 
     | 
    
         
            +
                  "= toOpen? '<input id=\"Button1\" type=\"button\" value=\"Open\" class=\"btn\" />':'<input id=\"Button1\" type=\"button\" value=\"Close\" class=\"btn\" style=\"background-color: #FFFFFF\" />' ;"<<
         
     | 
| 
      
 36 
     | 
    
         
            +
                  '}'<<
         
     | 
| 
      
 37 
     | 
    
         
            +
                  get_table_sorting_java_script <<
         
     | 
| 
      
 38 
     | 
    
         
            +
                  'function init()
         
     | 
| 
      
 39 
     | 
    
         
            +
                  {
         
     | 
| 
      
 40 
     | 
    
         
            +
                    var Table1Sorter = new TSorter;
         
     | 
| 
      
 41 
     | 
    
         
            +
                    Table1Sorter.init(\'statistics_table\');
         
     | 
| 
      
 42 
     | 
    
         
            +
                  }
         
     | 
| 
      
 43 
     | 
    
         
            +
                  window.onload = init;'<<
         
     | 
| 
      
 44 
     | 
    
         
            +
                  '</script>'
         
     | 
| 
      
 45 
     | 
    
         
            +
                java_script
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
              
         
     | 
| 
      
 48 
     | 
    
         
            +
              def self.get_table_sorting_java_script
         
     | 
| 
      
 49 
     | 
    
         
            +
              java_script="
         
     | 
| 
      
 50 
     | 
    
         
            +
              function TSorter(){
         
     | 
| 
      
 51 
     | 
    
         
            +
                var table = Object;
         
     | 
| 
      
 52 
     | 
    
         
            +
                var trs = Array;
         
     | 
| 
      
 53 
     | 
    
         
            +
                var ths = Array;
         
     | 
| 
      
 54 
     | 
    
         
            +
                var curSortCol = Object;
         
     | 
| 
      
 55 
     | 
    
         
            +
                var prevSortCol = '3';
         
     | 
| 
      
 56 
     | 
    
         
            +
                var sortType = Object;
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                function get(){}
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                function getCell(index){
         
     | 
| 
      
 61 
     | 
    
         
            +
                  return trs[index].cells[curSortCol]
         
     | 
| 
      
 62 
     | 
    
         
            +
                }
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                this.init = function(tableName)
         
     | 
| 
      
 66 
     | 
    
         
            +
                {
         
     | 
| 
      
 67 
     | 
    
         
            +
                  table = document.getElementById(tableName);
         
     | 
| 
      
 68 
     | 
    
         
            +
                  ths = table.getElementsByTagName(\"th\");
         
     | 
| 
      
 69 
     | 
    
         
            +
                  for(var i = 0; i < ths.length ; i++)
         
     | 
| 
      
 70 
     | 
    
         
            +
                  {
         
     | 
| 
      
 71 
     | 
    
         
            +
                    ths[i].onclick = function()
         
     | 
| 
      
 72 
     | 
    
         
            +
                    {
         
     | 
| 
      
 73 
     | 
    
         
            +
                      sort(this);
         
     | 
| 
      
 74 
     | 
    
         
            +
                    }
         
     | 
| 
      
 75 
     | 
    
         
            +
                  }
         
     | 
| 
      
 76 
     | 
    
         
            +
                  return true;
         
     | 
| 
      
 77 
     | 
    
         
            +
                };
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                function sort(oTH)
         
     | 
| 
      
 81 
     | 
    
         
            +
                {
         
     | 
| 
      
 82 
     | 
    
         
            +
                  curSortCol = oTH.cellIndex;
         
     | 
| 
      
 83 
     | 
    
         
            +
                  sortType = oTH.abbr;
         
     | 
| 
      
 84 
     | 
    
         
            +
                  trs = table.tBodies[0].getElementsByTagName(\"tr\");
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                  setGet(sortType)
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
                  for(var j=0; j<trs.length; j++)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  {
         
     | 
| 
      
 92 
     | 
    
         
            +
                    if(trs[j].className == 'detail_row')
         
     | 
| 
      
 93 
     | 
    
         
            +
                    {
         
     | 
| 
      
 94 
     | 
    
         
            +
                      closeDetails(j+2);
         
     | 
| 
      
 95 
     | 
    
         
            +
                    }
         
     | 
| 
      
 96 
     | 
    
         
            +
                  }
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  // if already sorted just reverse
         
     | 
| 
      
 99 
     | 
    
         
            +
                  if(prevSortCol == curSortCol)
         
     | 
| 
      
 100 
     | 
    
         
            +
                  {
         
     | 
| 
      
 101 
     | 
    
         
            +
                    oTH.className = (oTH.className != 'ascend' ? 'ascend' : 'descend' );
         
     | 
| 
      
 102 
     | 
    
         
            +
                    reverseTable();
         
     | 
| 
      
 103 
     | 
    
         
            +
                  }
         
     | 
| 
      
 104 
     | 
    
         
            +
                  // not sorted - call quicksort
         
     | 
| 
      
 105 
     | 
    
         
            +
                  else
         
     | 
| 
      
 106 
     | 
    
         
            +
                  {
         
     | 
| 
      
 107 
     | 
    
         
            +
                    oTH.className = 'ascend';
         
     | 
| 
      
 108 
     | 
    
         
            +
                    if(ths[prevSortCol].className != 'exc_cell'){ths[prevSortCol].className = '';}
         
     | 
| 
      
 109 
     | 
    
         
            +
                    quicksort(0, trs.length);
         
     | 
| 
      
 110 
     | 
    
         
            +
                  }
         
     | 
| 
      
 111 
     | 
    
         
            +
                  prevSortCol = curSortCol;
         
     | 
| 
      
 112 
     | 
    
         
            +
                }
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                function setGet(sortType)
         
     | 
| 
      
 116 
     | 
    
         
            +
                {
         
     | 
| 
      
 117 
     | 
    
         
            +
                  switch(sortType)
         
     | 
| 
      
 118 
     | 
    
         
            +
                  {
         
     | 
| 
      
 119 
     | 
    
         
            +
                    case \"link_column\":
         
     | 
| 
      
 120 
     | 
    
         
            +
                      get = function(index){
         
     | 
| 
      
 121 
     | 
    
         
            +
                        return  parseFloat(getCell(index).firstChild.firstChild.nodeValue);
         
     | 
| 
      
 122 
     | 
    
         
            +
                      };
         
     | 
| 
      
 123 
     | 
    
         
            +
                      break;
         
     | 
| 
      
 124 
     | 
    
         
            +
                    default:
         
     | 
| 
      
 125 
     | 
    
         
            +
                      get = function(index){	return parseInt(getCell(index).firstChild.nodeValue);};
         
     | 
| 
      
 126 
     | 
    
         
            +
                      break;
         
     | 
| 
      
 127 
     | 
    
         
            +
                  };
         
     | 
| 
      
 128 
     | 
    
         
            +
                }
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
             
     | 
| 
      
 131 
     | 
    
         
            +
                function exchange(i, j)
         
     | 
| 
      
 132 
     | 
    
         
            +
                {
         
     | 
| 
      
 133 
     | 
    
         
            +
                  if(i == j+1) {
         
     | 
| 
      
 134 
     | 
    
         
            +
                    table.tBodies[0].insertBefore(trs[i], trs[j]);
         
     | 
| 
      
 135 
     | 
    
         
            +
                  } else if(j == i+1) {
         
     | 
| 
      
 136 
     | 
    
         
            +
                    table.tBodies[0].insertBefore(trs[j], trs[i]);
         
     | 
| 
      
 137 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 138 
     | 
    
         
            +
                    var tmpNode = table.tBodies[0].replaceChild(trs[i], trs[j]);
         
     | 
| 
      
 139 
     | 
    
         
            +
                    if(typeof(trs[i]) == \"undefined\") {
         
     | 
| 
      
 140 
     | 
    
         
            +
                      table.appendChild(tmpNode);
         
     | 
| 
      
 141 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 142 
     | 
    
         
            +
                      table.tBodies[0].insertBefore(tmpNode, trs[i]);
         
     | 
| 
      
 143 
     | 
    
         
            +
                    }
         
     | 
| 
      
 144 
     | 
    
         
            +
                  }
         
     | 
| 
      
 145 
     | 
    
         
            +
                }
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
                function reverseTable()
         
     | 
| 
      
 149 
     | 
    
         
            +
                {
         
     | 
| 
      
 150 
     | 
    
         
            +
                  for(var i = 1; i<trs.length; i++)
         
     | 
| 
      
 151 
     | 
    
         
            +
                  {
         
     | 
| 
      
 152 
     | 
    
         
            +
                    table.tBodies[0].insertBefore(trs[i], trs[0]);
         
     | 
| 
      
 153 
     | 
    
         
            +
                  }
         
     | 
| 
      
 154 
     | 
    
         
            +
                }
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
                function quicksort(lo, hi)
         
     | 
| 
      
 157 
     | 
    
         
            +
                {
         
     | 
| 
      
 158 
     | 
    
         
            +
                  if(hi <= lo+1) return;
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
                  if((hi - lo) == 2) {
         
     | 
| 
      
 161 
     | 
    
         
            +
                    if(get(hi-1) > get(lo)) exchange(hi-1, lo);
         
     | 
| 
      
 162 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 163 
     | 
    
         
            +
                  }
         
     | 
| 
      
 164 
     | 
    
         
            +
             
     | 
| 
      
 165 
     | 
    
         
            +
                  var i = lo + 1;
         
     | 
| 
      
 166 
     | 
    
         
            +
                  var j = hi - 1;
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
                  if(get(lo) > get(i)) exchange(i, lo);
         
     | 
| 
      
 169 
     | 
    
         
            +
                  if(get(j) > get(lo)) exchange(lo, j);
         
     | 
| 
      
 170 
     | 
    
         
            +
                  if(get(lo) > get(i)) exchange(i, lo);
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                  var pivot = get(lo);
         
     | 
| 
      
 173 
     | 
    
         
            +
             
     | 
| 
      
 174 
     | 
    
         
            +
                  while(true) {
         
     | 
| 
      
 175 
     | 
    
         
            +
                    j--;
         
     | 
| 
      
 176 
     | 
    
         
            +
                    while(pivot > get(j)) j--;
         
     | 
| 
      
 177 
     | 
    
         
            +
                    i++;
         
     | 
| 
      
 178 
     | 
    
         
            +
                    while(get(i) > pivot) i++;
         
     | 
| 
      
 179 
     | 
    
         
            +
                    if(j <= i) break;
         
     | 
| 
      
 180 
     | 
    
         
            +
                    exchange(i, j);
         
     | 
| 
      
 181 
     | 
    
         
            +
                  }
         
     | 
| 
      
 182 
     | 
    
         
            +
                  exchange(lo, j);
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
      
 184 
     | 
    
         
            +
                  if((j-lo) < (hi-j)) {
         
     | 
| 
      
 185 
     | 
    
         
            +
                    quicksort(lo, j);
         
     | 
| 
      
 186 
     | 
    
         
            +
                    quicksort(j+1, hi);
         
     | 
| 
      
 187 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 188 
     | 
    
         
            +
                    quicksort(j+1, hi);
         
     | 
| 
      
 189 
     | 
    
         
            +
                    quicksort(lo, j);
         
     | 
| 
      
 190 
     | 
    
         
            +
                  }
         
     | 
| 
      
 191 
     | 
    
         
            +
                }
         
     | 
| 
      
 192 
     | 
    
         
            +
              }"
         
     | 
| 
      
 193 
     | 
    
         
            +
                java_script
         
     | 
| 
      
 194 
     | 
    
         
            +
              end
         
     | 
| 
      
 195 
     | 
    
         
            +
             
     | 
| 
      
 196 
     | 
    
         
            +
             
     | 
| 
      
 197 
     | 
    
         
            +
            end
         
     | 
| 
      
 198 
     | 
    
         
            +
             
     | 
| 
      
 199 
     | 
    
         
            +
             
         
     | 
| 
         @@ -0,0 +1,147 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 2 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 3 
     | 
    
         
            +
            ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 
         
     | 
| 
      
 4 
     | 
    
         
            +
            ## All rights reserved. 
         
     | 
| 
      
 5 
     | 
    
         
            +
            ## Contact: Nokia Corporation (testabilitydriver@nokia.com) 
         
     | 
| 
      
 6 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 7 
     | 
    
         
            +
            ## This file is part of Testability Driver. 
         
     | 
| 
      
 8 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 9 
     | 
    
         
            +
            ## If you have questions regarding the use of this file, please contact 
         
     | 
| 
      
 10 
     | 
    
         
            +
            ## Nokia at testabilitydriver@nokia.com . 
         
     | 
| 
      
 11 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 12 
     | 
    
         
            +
            ## This library is free software; you can redistribute it and/or 
         
     | 
| 
      
 13 
     | 
    
         
            +
            ## modify it under the terms of the GNU Lesser General Public 
         
     | 
| 
      
 14 
     | 
    
         
            +
            ## License version 2.1 as published by the Free Software Foundation 
         
     | 
| 
      
 15 
     | 
    
         
            +
            ## and appearing in the file LICENSE.LGPL included in the packaging 
         
     | 
| 
      
 16 
     | 
    
         
            +
            ## of this file. 
         
     | 
| 
      
 17 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 18 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            class ReportJUnitXml
         
     | 
| 
      
 22 
     | 
    
         
            +
              def initialize(report_path)
         
     | 
| 
      
 23 
     | 
    
         
            +
                
         
     | 
| 
      
 24 
     | 
    
         
            +
                @test_case_run_arr=Array.new
         
     | 
| 
      
 25 
     | 
    
         
            +
                @junit_xml_report_path=report_path
         
     | 
| 
      
 26 
     | 
    
         
            +
                @test_case_arr=Array.new
         
     | 
| 
      
 27 
     | 
    
         
            +
                @test_run_properties_arr=Array.new
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
      
 29 
     | 
    
         
            +
                @test_set_name=$parameters[ :quality_center_testset_name, "TestSetName" ]
         
     | 
| 
      
 30 
     | 
    
         
            +
                @test_set_path =$parameters[ :quality_center_testset_path, "TestSetPath" ]
         
     | 
| 
      
 31 
     | 
    
         
            +
                @test_class_name=nil
         
     | 
| 
      
 32 
     | 
    
         
            +
                @junit_xml_filename = convert_to_file_name('tdriver_junit_xml')
         
     | 
| 
      
 33 
     | 
    
         
            +
                @failures = 0
         
     | 
| 
      
 34 
     | 
    
         
            +
                @errors = 0
         
     | 
| 
      
 35 
     | 
    
         
            +
                @tests = 0
         
     | 
| 
      
 36 
     | 
    
         
            +
                
         
     | 
| 
      
 37 
     | 
    
         
            +
                @tests_start_time = Time.now
         
     | 
| 
      
 38 
     | 
    
         
            +
                @tc_start_time = nil
         
     | 
| 
      
 39 
     | 
    
         
            +
                @tc_end_time = nil
         
     | 
| 
      
 40 
     | 
    
         
            +
                @pass_statuses=$parameters[ :report_passed_statuses, "passed" ].split('|')
         
     | 
| 
      
 41 
     | 
    
         
            +
                @fail_statuses=$parameters[ :report_failed_statuses, "failed" ].split('|')
         
     | 
| 
      
 42 
     | 
    
         
            +
                @not_run_statuses=$parameters[ :report_not_run_statuses, "not run" ].split('|')
         
     | 
| 
      
 43 
     | 
    
         
            +
              end
         
     | 
| 
      
 44 
     | 
    
         
            +
              def convert_to_file_name(value)
         
     | 
| 
      
 45 
     | 
    
         
            +
                "TEST-"+value.gsub(/[^\w_\.]/, '_') + ".xml"
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
              def add_test_name(name,group)
         
     | 
| 
      
 48 
     | 
    
         
            +
                @test_class_name=group.gsub(/[<\/?*>!)(}{\{@%"'.,:;~-]/,'')
         
     | 
| 
      
 49 
     | 
    
         
            +
                @test_name = name.gsub(/[<\/?*>!)(}{\{@%"'.,:;~-]/,'')
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
      
 51 
     | 
    
         
            +
              def test_suite_properties(os,sw,variant,product,language,localization,total_memory,used_memory_start,used_memory_end)
         
     | 
| 
      
 52 
     | 
    
         
            +
                @test_run_properties_arr=nil
         
     | 
| 
      
 53 
     | 
    
         
            +
                @test_run_properties_arr=Array.new  
         
     | 
| 
      
 54 
     | 
    
         
            +
                @test_run_properties_arr << [os]
         
     | 
| 
      
 55 
     | 
    
         
            +
                @test_run_properties_arr << [sw]
         
     | 
| 
      
 56 
     | 
    
         
            +
                @test_run_properties_arr << [variant]
         
     | 
| 
      
 57 
     | 
    
         
            +
                @test_run_properties_arr << [product]
         
     | 
| 
      
 58 
     | 
    
         
            +
                @test_run_properties_arr << [language]
         
     | 
| 
      
 59 
     | 
    
         
            +
                @test_run_properties_arr << [localization]
         
     | 
| 
      
 60 
     | 
    
         
            +
                @test_run_properties_arr << [total_memory]
         
     | 
| 
      
 61 
     | 
    
         
            +
                @test_run_properties_arr << [used_memory_start]
         
     | 
| 
      
 62 
     | 
    
         
            +
                @test_run_properties_arr << [used_memory_end]    
         
     | 
| 
      
 63 
     | 
    
         
            +
              end
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
              def add_test_result(status,start_time,end_time)
         
     | 
| 
      
 66 
     | 
    
         
            +
                if @fail_statuses.include?(status)
         
     | 
| 
      
 67 
     | 
    
         
            +
                  @failures = @failures + 1
         
     | 
| 
      
 68 
     | 
    
         
            +
                end
         
     | 
| 
      
 69 
     | 
    
         
            +
                if @not_run_statuses.include?(status)
         
     | 
| 
      
 70 
     | 
    
         
            +
                  @errors = @errors + 1
         
     | 
| 
      
 71 
     | 
    
         
            +
                end
         
     | 
| 
      
 72 
     | 
    
         
            +
                @tests = @tests+1
         
     | 
| 
      
 73 
     | 
    
         
            +
                @tc_start_time = start_time
         
     | 
| 
      
 74 
     | 
    
         
            +
                @tc_end_time = end_time
         
     | 
| 
      
 75 
     | 
    
         
            +
              end
         
     | 
| 
      
 76 
     | 
    
         
            +
              
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
              def create_junit_xml()    
         
     | 
| 
      
 80 
     | 
    
         
            +
                test_run_properties_arr=@test_run_properties_arr
         
     | 
| 
      
 81 
     | 
    
         
            +
                test_case_arr=$tdriver_reporter.read_result_storage('all')
         
     | 
| 
      
 82 
     | 
    
         
            +
                failures=@failures
         
     | 
| 
      
 83 
     | 
    
         
            +
                errors=@errors
         
     | 
| 
      
 84 
     | 
    
         
            +
                tests=@tests
         
     | 
| 
      
 85 
     | 
    
         
            +
                tests_end_time = Time.now
         
     | 
| 
      
 86 
     | 
    
         
            +
                execution_time=tests_end_time - @tests_start_time
         
     | 
| 
      
 87 
     | 
    
         
            +
                builder = Nokogiri::XML::Builder.new do |xml|
         
     | 
| 
      
 88 
     | 
    
         
            +
                  xml.testsuite(:failures => failures,
         
     | 
| 
      
 89 
     | 
    
         
            +
                    :errors => errors,
         
     | 
| 
      
 90 
     | 
    
         
            +
                    :tests => tests,
         
     | 
| 
      
 91 
     | 
    
         
            +
                    :name => "Test_Results" ) {
         
     | 
| 
      
 92 
     | 
    
         
            +
                    xml.properties {
         
     | 
| 
      
 93 
     | 
    
         
            +
                      xml.property(:os => test_run_properties_arr[0].to_s){
         
     | 
| 
      
 94 
     | 
    
         
            +
                      }
         
     | 
| 
      
 95 
     | 
    
         
            +
                      xml.property(:sw => test_run_properties_arr[1].to_s){
         
     | 
| 
      
 96 
     | 
    
         
            +
                      }
         
     | 
| 
      
 97 
     | 
    
         
            +
                      xml.property(:variant => test_run_properties_arr[2].to_s){
         
     | 
| 
      
 98 
     | 
    
         
            +
                      }
         
     | 
| 
      
 99 
     | 
    
         
            +
                      xml.property(:product => test_run_properties_arr[3].to_s){
         
     | 
| 
      
 100 
     | 
    
         
            +
                      }
         
     | 
| 
      
 101 
     | 
    
         
            +
                      xml.property(:language => test_run_properties_arr[4].to_s){
         
     | 
| 
      
 102 
     | 
    
         
            +
                      }
         
     | 
| 
      
 103 
     | 
    
         
            +
                      xml.property(:localization => test_run_properties_arr[5].to_s){
         
     | 
| 
      
 104 
     | 
    
         
            +
                      }
         
     | 
| 
      
 105 
     | 
    
         
            +
                      xml.property(:total_memory => test_run_properties_arr[6].to_s){
         
     | 
| 
      
 106 
     | 
    
         
            +
                      }
         
     | 
| 
      
 107 
     | 
    
         
            +
                      xml.property(:used_memory_start => test_run_properties_arr[7].to_s){
         
     | 
| 
      
 108 
     | 
    
         
            +
                      }
         
     | 
| 
      
 109 
     | 
    
         
            +
                      xml.property(:used_memory_end => test_run_properties_arr[8].to_s){
         
     | 
| 
      
 110 
     | 
    
         
            +
                      }
         
     | 
| 
      
 111 
     | 
    
         
            +
                      xml.property(:timestamp => @tests_start_time.to_s){
         
     | 
| 
      
 112 
     | 
    
         
            +
                      }
         
     | 
| 
      
 113 
     | 
    
         
            +
                      xml.property(:timestamp_end => tests_end_time.to_s){
         
     | 
| 
      
 114 
     | 
    
         
            +
                      }
         
     | 
| 
      
 115 
     | 
    
         
            +
                      xml.property(:time => execution_time.to_s){
         
     | 
| 
      
 116 
     | 
    
         
            +
                      }
         
     | 
| 
      
 117 
     | 
    
         
            +
            		    }
         
     | 
| 
      
 118 
     | 
    
         
            +
                    test_case_arr.each do |test_case|
         
     | 
| 
      
 119 
     | 
    
         
            +
                      if test_case[7].to_s == 'passed' || @pass_statuses.include?(test_case[7].to_s)
         
     | 
| 
      
 120 
     | 
    
         
            +
                        xml.testcase(:classname => test_case[1].to_s, :name => test_case[0].to_s, :start_time => @tc_start_time , :end_time => @tc_end_time){
         
     | 
| 
      
 121 
     | 
    
         
            +
                        }
         
     | 
| 
      
 122 
     | 
    
         
            +
                      end
         
     | 
| 
      
 123 
     | 
    
         
            +
                      if test_case[7].to_s == 'failed' || @fail_statuses.include?(test_case[7].to_s)
         
     | 
| 
      
 124 
     | 
    
         
            +
                        xml.testcase(:classname => test_case[1].to_s, :name => test_case[0].to_s, :start_time => @tc_start_time , :end_time => @tc_end_time ){
         
     | 
| 
      
 125 
     | 
    
         
            +
                          xml.failure(:message => test_case[0].to_s){
         
     | 
| 
      
 126 
     | 
    
         
            +
                            xml.text(test_case[9].to_s.gsub('<br />'," \n ")){
         
     | 
| 
      
 127 
     | 
    
         
            +
                            }
         
     | 
| 
      
 128 
     | 
    
         
            +
                          }
         
     | 
| 
      
 129 
     | 
    
         
            +
                        }
         
     | 
| 
      
 130 
     | 
    
         
            +
                      end
         
     | 
| 
      
 131 
     | 
    
         
            +
                      if test_case[7].to_s == 'not run' || @not_run_statuses.include?(test_case[7].to_s)
         
     | 
| 
      
 132 
     | 
    
         
            +
                        xml.testcase(:classname => test_case[1].to_s, :name => test_case[0].to_s, :start_time => @tc_start_time , :end_time => @tc_end_time ){
         
     | 
| 
      
 133 
     | 
    
         
            +
                          xml.error(:message => test_case[0].to_s){
         
     | 
| 
      
 134 
     | 
    
         
            +
                            xml.text(test_case[9].to_s.gsub('<br />'," \n ")){
         
     | 
| 
      
 135 
     | 
    
         
            +
                            }
         
     | 
| 
      
 136 
     | 
    
         
            +
                          }
         
     | 
| 
      
 137 
     | 
    
         
            +
                        }
         
     | 
| 
      
 138 
     | 
    
         
            +
                      end
         
     | 
| 
      
 139 
     | 
    
         
            +
                    end
         
     | 
| 
      
 140 
     | 
    
         
            +
                  }
         
     | 
| 
      
 141 
     | 
    
         
            +
                end
         
     | 
| 
      
 142 
     | 
    
         
            +
                File.open(@junit_xml_report_path+'/junit_xml/'+@junit_xml_filename, 'w') { |file| file.write(builder.to_xml) }
         
     | 
| 
      
 143 
     | 
    
         
            +
                builder=nil
         
     | 
| 
      
 144 
     | 
    
         
            +
                test_case_arr=nil
         
     | 
| 
      
 145 
     | 
    
         
            +
              end
         
     | 
| 
      
 146 
     | 
    
         
            +
            end
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,108 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 2 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 3 
     | 
    
         
            +
            ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 
         
     | 
| 
      
 4 
     | 
    
         
            +
            ## All rights reserved. 
         
     | 
| 
      
 5 
     | 
    
         
            +
            ## Contact: Nokia Corporation (testabilitydriver@nokia.com) 
         
     | 
| 
      
 6 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 7 
     | 
    
         
            +
            ## This file is part of Testability Driver. 
         
     | 
| 
      
 8 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 9 
     | 
    
         
            +
            ## If you have questions regarding the use of this file, please contact 
         
     | 
| 
      
 10 
     | 
    
         
            +
            ## Nokia at testabilitydriver@nokia.com . 
         
     | 
| 
      
 11 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 12 
     | 
    
         
            +
            ## This library is free software; you can redistribute it and/or 
         
     | 
| 
      
 13 
     | 
    
         
            +
            ## modify it under the terms of the GNU Lesser General Public 
         
     | 
| 
      
 14 
     | 
    
         
            +
            ## License version 2.1 as published by the Free Software Foundation 
         
     | 
| 
      
 15 
     | 
    
         
            +
            ## and appearing in the file LICENSE.LGPL included in the packaging 
         
     | 
| 
      
 16 
     | 
    
         
            +
            ## of this file. 
         
     | 
| 
      
 17 
     | 
    
         
            +
            ## 
         
     | 
| 
      
 18 
     | 
    
         
            +
            ############################################################################
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            require File.expand_path( File.join( File.dirname( __FILE__ ), 'report' ) )
         
     | 
| 
      
 22 
     | 
    
         
            +
            begin
         
     | 
| 
      
 23 
     | 
    
         
            +
            require 'spec/runner/formatter/base_text_formatter'
         
     | 
| 
      
 24 
     | 
    
         
            +
            module Spec
         
     | 
| 
      
 25 
     | 
    
         
            +
                module Runner
         
     | 
| 
      
 26 
     | 
    
         
            +
                  module Formatter
         
     | 
| 
      
 27 
     | 
    
         
            +
                    #Report module which contains the Cucumber, Test::Unit and RSpec report formatters
         
     | 
| 
      
 28 
     | 
    
         
            +
                    module TDriverReport
         
     | 
| 
      
 29 
     | 
    
         
            +
                      #Class for formatting RSpec report
         
     | 
| 
      
 30 
     | 
    
         
            +
                      class RSpecFormatter < BaseTextFormatter
         
     | 
| 
      
 31 
     | 
    
         
            +
                        include TDriverReportCreator
         
     | 
| 
      
 32 
     | 
    
         
            +
                        def initialize(options, output)
         
     | 
| 
      
 33 
     | 
    
         
            +
                          super
         
     | 
| 
      
 34 
     | 
    
         
            +
                          @current_example_group=nil
         
     | 
| 
      
 35 
     | 
    
         
            +
                        end
         
     | 
| 
      
 36 
     | 
    
         
            +
                        #This method is for the undefiened BaseTextFormatter methods
         
     | 
| 
      
 37 
     | 
    
         
            +
                        #
         
     | 
| 
      
 38 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 39 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 40 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 41 
     | 
    
         
            +
                        def method_missing(sym, *args)
         
     | 
| 
      
 42 
     | 
    
         
            +
                          # no-op
         
     | 
| 
      
 43 
     | 
    
         
            +
                        end
         
     | 
| 
      
 44 
     | 
    
         
            +
                        #This method initializes new test run
         
     | 
| 
      
 45 
     | 
    
         
            +
                        #
         
     | 
| 
      
 46 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 47 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 48 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 49 
     | 
    
         
            +
                        def start(example_count)
         
     | 
| 
      
 50 
     | 
    
         
            +
                          start_run()
         
     | 
| 
      
 51 
     | 
    
         
            +
                        end            
         
     | 
| 
      
 52 
     | 
    
         
            +
                        #This method sets the group
         
     | 
| 
      
 53 
     | 
    
         
            +
                        #
         
     | 
| 
      
 54 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 55 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 56 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 57 
     | 
    
         
            +
                        def example_group_started(example)
         
     | 
| 
      
 58 
     | 
    
         
            +
                          @current_example_group=example.description
         
     | 
| 
      
 59 
     | 
    
         
            +
                          add_report_group('Specs:'+@current_example_group+'|')
         
     | 
| 
      
 60 
     | 
    
         
            +
                        end
         
     | 
| 
      
 61 
     | 
    
         
            +
                        #This method starts a new test case
         
     | 
| 
      
 62 
     | 
    
         
            +
                        #
         
     | 
| 
      
 63 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 64 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 65 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 66 
     | 
    
         
            +
                        def example_started(example)              
         
     | 
| 
      
 67 
     | 
    
         
            +
                          start_test_case(example.description)
         
     | 
| 
      
 68 
     | 
    
         
            +
                          add_test_case_group(@current_example_group)
         
     | 
| 
      
 69 
     | 
    
         
            +
                        end
         
     | 
| 
      
 70 
     | 
    
         
            +
                        #This method records the passed test case result
         
     | 
| 
      
 71 
     | 
    
         
            +
                        #
         
     | 
| 
      
 72 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 73 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 74 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 75 
     | 
    
         
            +
                        def example_passed(example)
         
     | 
| 
      
 76 
     | 
    
         
            +
                         update_test_case('-')
         
     | 
| 
      
 77 
     | 
    
         
            +
                         end_test_case(example.description,'passed')
         
     | 
| 
      
 78 
     | 
    
         
            +
                        end
         
     | 
| 
      
 79 
     | 
    
         
            +
                        #This method records the failed test case result
         
     | 
| 
      
 80 
     | 
    
         
            +
                        #
         
     | 
| 
      
 81 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 82 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 83 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 84 
     | 
    
         
            +
                        def example_failed(example, counter, failure)
         
     | 
| 
      
 85 
     | 
    
         
            +
                          capture_screen_test_case()
         
     | 
| 
      
 86 
     | 
    
         
            +
                          update_test_case(failure)
         
     | 
| 
      
 87 
     | 
    
         
            +
                          update_test_case(failure.exception.message) unless failure.exception.message.nil?
         
     | 
| 
      
 88 
     | 
    
         
            +
                          update_test_case("#{format_backtrace(failure.exception.backtrace)}") unless failure.exception.nil?
         
     | 
| 
      
 89 
     | 
    
         
            +
                          end_test_case(example.description,'failed')
         
     | 
| 
      
 90 
     | 
    
         
            +
                        end
         
     | 
| 
      
 91 
     | 
    
         
            +
                        #This method records the not run test case result
         
     | 
| 
      
 92 
     | 
    
         
            +
                        #
         
     | 
| 
      
 93 
     | 
    
         
            +
                        # === params
         
     | 
| 
      
 94 
     | 
    
         
            +
                        # === returns
         
     | 
| 
      
 95 
     | 
    
         
            +
                        # === raises
         
     | 
| 
      
 96 
     | 
    
         
            +
                        def example_pending(example, message, pending_caller)
         
     | 
| 
      
 97 
     | 
    
         
            +
                          update_test_case(message)
         
     | 
| 
      
 98 
     | 
    
         
            +
                          end_test_case(example.description,'not run')
         
     | 
| 
      
 99 
     | 
    
         
            +
                        end
         
     | 
| 
      
 100 
     | 
    
         
            +
                      end
         
     | 
| 
      
 101 
     | 
    
         
            +
                  end
         
     | 
| 
      
 102 
     | 
    
         
            +
                end
         
     | 
| 
      
 103 
     | 
    
         
            +
              end
         
     | 
| 
      
 104 
     | 
    
         
            +
            end
         
     | 
| 
      
 105 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
            end
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     |