testability-driver 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/bin/tdriver-devtools +0 -0
  2. data/ext/native_extensions.c +165 -6
  3. data/lib/tdriver-devtools/behaviour/old/xml/update +0 -0
  4. data/lib/tdriver-devtools/behaviour/xml/generate.rb +0 -0
  5. data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +15 -1
  6. data/lib/tdriver-devtools/doc/update +0 -0
  7. data/lib/tdriver-devtools/doc/xslt/template.xsl +24 -14
  8. data/lib/tdriver-devtools/doc/xslt/update +0 -0
  9. data/lib/tdriver-devtools/tdriver-devtools.rb +0 -0
  10. data/lib/tdriver-devtools/tests/feature_tests/update +0 -0
  11. data/lib/tdriver/base/behaviour/{behaviour.rb → abstract.rb} +3 -6
  12. data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
  13. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +2 -2
  14. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +47 -37
  15. data/lib/tdriver/base/behaviour/factory.rb +260 -382
  16. data/lib/tdriver/base/behaviour/loader.rb +22 -4
  17. data/lib/tdriver/base/controller/abstraction.rb +56 -0
  18. data/lib/tdriver/base/controller/loader.rb +21 -0
  19. data/lib/tdriver/base/loader.rb +3 -1
  20. data/lib/tdriver/base/sut/controller.rb +91 -74
  21. data/lib/tdriver/base/sut/factory.rb +8 -8
  22. data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
  23. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +116 -96
  24. data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
  25. data/lib/tdriver/base/sut/sut.rb +10 -8
  26. data/lib/tdriver/base/test_object/abstract.rb +25 -24
  27. data/lib/tdriver/base/test_object/adapter.rb +67 -44
  28. data/lib/tdriver/base/test_object/behaviours/test_object.rb +79 -20
  29. data/lib/tdriver/base/test_object/factory.rb +45 -15
  30. data/lib/tdriver/base/test_object/xml/adapter.rb +80 -57
  31. data/lib/tdriver/env.rb +0 -0
  32. data/lib/tdriver/loader.rb +0 -0
  33. data/lib/tdriver/matti.rb +0 -0
  34. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +1 -0
  35. data/lib/tdriver/report/report.rb +2 -1
  36. data/lib/tdriver/report/report_crash_file_capture.rb +12 -0
  37. data/lib/tdriver/report/report_creator.rb +6 -2
  38. data/lib/tdriver/report/report_execution_statistics.rb +27 -11
  39. data/lib/tdriver/report/report_graph_generator.rb +59 -0
  40. data/lib/tdriver/report/report_test_case_run.rb +34 -2
  41. data/lib/tdriver/report/report_writer.rb +12 -0
  42. data/lib/tdriver/tdriver.rb +12 -1
  43. data/lib/tdriver/util/agent/loader.rb +22 -0
  44. data/lib/tdriver/util/agent/service.rb +107 -0
  45. data/lib/tdriver/util/common/crc16.rb +17 -10
  46. data/lib/tdriver/util/common/hash.rb +4 -1
  47. data/lib/tdriver/util/common/kernel.rb +11 -0
  48. data/lib/tdriver/util/common/numeric.rb +48 -0
  49. data/lib/tdriver/util/common/object.rb +5 -2
  50. data/lib/tdriver/util/common/string.rb +8 -1
  51. data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
  52. data/lib/tdriver/util/filters/loader.rb +29 -0
  53. data/lib/tdriver/util/fixture/loader.rb +22 -0
  54. data/lib/tdriver/util/fixture/service.rb +157 -0
  55. data/lib/tdriver/util/loader.rb +8 -2
  56. data/lib/tdriver/util/logger/logger.rb +12 -6
  57. data/lib/tdriver/util/other/config.rb +0 -0
  58. data/lib/tdriver/util/parameter/parameter.rb +221 -152
  59. data/lib/tdriver/util/plugin/error.rb +0 -0
  60. data/lib/tdriver/util/video/camera_linux.rb +36 -22
  61. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +3 -13
  62. data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +13 -8
  63. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +51 -9
  64. data/lib/tdriver/util/xml/xml.rb +4 -2
  65. data/lib/tdriver/verify/verify.rb +280 -621
  66. data/lib/tdriver/version.rb +1 -1
  67. data/xml/behaviours/generic.xml +34 -0
  68. data/xml/templates/generic.xml +20 -3
  69. metadata +168 -240
  70. data/lib/tdriver-devtools/tests/feature_tests/output/application_closable_0x3f.feature +0 -10
  71. data/lib/tdriver-devtools/tests/feature_tests/output/application_close.feature +0 -15
  72. data/lib/tdriver-devtools/tests/feature_tests/output/application_environment.feature +0 -10
  73. data/lib/tdriver-devtools/tests/feature_tests/output/application_executable_name.feature +0 -10
  74. data/lib/tdriver-devtools/tests/feature_tests/output/application_uid.feature +0 -10
  75. data/lib/tdriver-devtools/tests/feature_tests/output/created.rid +0 -1
  76. data/lib/tdriver-devtools/tests/feature_tests/output/find_find.feature +0 -15
  77. data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash.feature +0 -10
  78. data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash_images.feature +0 -15
  79. data/lib/tdriver-devtools/tests/feature_tests/output/sut_application.feature +0 -15
  80. data/lib/tdriver-devtools/tests/feature_tests/output/sut_capture_screen.feature +0 -10
  81. data/lib/tdriver-devtools/tests/feature_tests/output/sut_child.feature +0 -10
  82. data/lib/tdriver-devtools/tests/feature_tests/output/sut_clear_verify_blocks.feature +0 -10
  83. data/lib/tdriver-devtools/tests/feature_tests/output/sut_connect.feature +0 -10
  84. data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order.feature +0 -10
  85. data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order_0x3d.feature +0 -10
  86. data/lib/tdriver-devtools/tests/feature_tests/output/sut_current_application_id.feature +0 -15
  87. data/lib/tdriver-devtools/tests/feature_tests/output/sut_disconnect.feature +0 -10
  88. data/lib/tdriver-devtools/tests/feature_tests/output/sut_dump_count.feature +0 -15
  89. data/lib/tdriver-devtools/tests/feature_tests/output/sut_freeze.feature +0 -10
  90. data/lib/tdriver-devtools/tests/feature_tests/output/sut_frozen.feature +0 -10
  91. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_application_id.feature +0 -10
  92. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_object.feature +0 -10
  93. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_operator_data.feature +0 -10
  94. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_ui_dump.feature +0 -15
  95. data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_user_information.feature +0 -10
  96. data/lib/tdriver-devtools/tests/feature_tests/output/sut_input.feature +0 -15
  97. data/lib/tdriver-devtools/tests/feature_tests/output/sut_parameter.feature +0 -15
  98. data/lib/tdriver-devtools/tests/feature_tests/output/sut_press_key.feature +0 -10
  99. data/lib/tdriver-devtools/tests/feature_tests/output/sut_received_data.feature +0 -10
  100. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh.feature +0 -20
  101. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_timeout.feature +0 -15
  102. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_tries.feature +0 -15
  103. data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_ui_dump.feature +0 -20
  104. data/lib/tdriver-devtools/tests/feature_tests/output/sut_run.feature +0 -10
  105. data/lib/tdriver-devtools/tests/feature_tests/output/sut_sent_data.feature +0 -10
  106. data/lib/tdriver-devtools/tests/feature_tests/output/sut_state.feature +0 -10
  107. data/lib/tdriver-devtools/tests/feature_tests/output/sut_translate.feature +0 -30
  108. data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_type.feature +0 -10
  109. data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_version.feature +0 -10
  110. data/lib/tdriver-devtools/tests/feature_tests/output/sut_unfreeze.feature +0 -10
  111. data/lib/tdriver-devtools/tests/feature_tests/output/sut_update.feature +0 -10
  112. data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_always.feature +0 -20
  113. data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_blocks.feature +0 -10
  114. data/lib/tdriver-devtools/tests/feature_tests/output/sut_x_path.feature +0 -10
  115. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data.feature +0 -10
  116. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_0x3d.feature +0 -10
  117. data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_crc.feature +0 -10
  118. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_down.feature +0 -10
  119. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_status.feature +0 -10
  120. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_up.feature +0 -10
  121. data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_reset.feature +0 -10
  122. data/lib/tdriver-devtools/tests/feature_tests/output/verification_test_object_exists_0x3f.feature +0 -15
  123. data/lib/tdriver/base/behaviour/factory_new.rb +0 -409
  124. data/lib/tdriver/base/test_object/identificator.rb +0 -518
  125. data/lib/tdriver/util/filters/dynamic_attributes.rb +0 -189
@@ -1,189 +0,0 @@
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
- module MobyUtil
21
-
22
- class DynamicAttributeFilter
23
-
24
- include Singleton
25
-
26
- attr_accessor :filter_string
27
-
28
- def initialize
29
-
30
- @filter_string = "" # coma separated list of symbol names in the filter
31
-
32
- @attributes = []
33
-
34
- @files = []
35
-
36
- end
37
-
38
- def update_filter( backtrace )
39
-
40
- begin
41
-
42
- if backtrace.collect{ | stack_point |
43
-
44
- next if stack_point =~ /^\(eval\)/ # skip eval trace lines
45
-
46
- read_attributes_from_file( $1 ) unless @files.include?( $1 ) if stack_point =~ /([\w\/:_\-\.\\\s\']+\.rb):\d+/
47
-
48
- }.include?( true )
49
-
50
- # new symbols added, update filter string
51
- update_filter_string
52
-
53
- end
54
-
55
- rescue Exception => exception
56
-
57
- puts exception
58
-
59
- puts exception.backtrace
60
-
61
- end
62
- end
63
-
64
- # Adds a hard coded symbol to be added to every filter.
65
- # Used in situations when variables are used to identify
66
- # attributes e.g:
67
- # var = 'text'
68
- # app.Object.attribute(var)
69
- def add_hardcoded_symbol( symbol )
70
-
71
- #$stderr.puts "warning: DynamicAttributeFilter#add_hardcoded_symbol is deprecated; please use DynamicAttributeFilter#add_attribute instead."
72
- warn "warning: deprecated method DynamicAttributeFilter#add_hardcoded_symbol; please use DynamicAttributeFilter#add_attribute instead"
73
-
74
- # update filter if new symbols added
75
- update_filter_string if add_attribute_to_filter( symbol )
76
-
77
- end
78
-
79
- def has_attribute?( symbol )
80
-
81
- @attributes.include?( symbol.to_s )
82
-
83
- end
84
-
85
- def add_attribute( symbol )
86
-
87
- # update filter if new symbols added
88
- update_filter_string if add_attribute_to_filter( symbol )
89
-
90
- end
91
-
92
- def add_attributes( symbols )
93
-
94
- # update filter if new symbols added
95
- update_filter_string if symbols.collect{ | symbol | add_attribute_to_filter( symbol ) }.include?( true )
96
-
97
- end
98
-
99
- private
100
-
101
- # == returns
102
- # Boolean:: determine that was symbol added to attributes list or not
103
- def add_attribute_to_filter( symbol )
104
-
105
- symbol = symbol.to_s
106
-
107
- unless @attributes.include?( symbol )
108
-
109
- # add symbol to atributes list
110
- @attributes << symbol
111
-
112
- true
113
-
114
- else
115
-
116
- false
117
-
118
- end
119
-
120
- end
121
-
122
- def update_filter_string
123
-
124
- @filter_string = @attributes.join( "," )
125
-
126
- end
127
-
128
- # This method will parse a file to collect its symbols and add them to the @filter
129
- # It will skip already parsed files
130
- # == params
131
- # String:: File path to the file to parse for symbols
132
- # == returns
133
- #
134
- # == throws
135
- #
136
- def read_attributes_from_file( file_name )
137
-
138
- #DEBUG
139
- #puts "File skipped :" + file_name if @files.include?( file_name )
140
-
141
- unless @files.include?( file_name )
142
-
143
- open( file_name ) do | file |
144
-
145
- file.each do | line |
146
-
147
- # Line Parser
148
- next if ( line.nil? or line =~ /^#/ ) # ignore comments
149
-
150
- line_symbols =
151
- (
152
- # :attribute => value
153
- line.scan( /[^:]\:(\w+)\s*\=\>/ )
154
-
155
- ).concat(
156
-
157
- # .attribute( 'name' )
158
- line.scan( /\.attribute\s*[\(\s]{1}\s*["']{1}(\w+)["']{1}[\)\s]{1}/ )
159
-
160
- ).concat(
161
-
162
- # .attribute( :name )
163
- line.scan( /\.attribute\s*[\(\s]{1}\s*[:]{1}(\w+)[\)\s]{1}/ )
164
- )
165
-
166
- next if line_symbols.empty? # skip lines with no symbols
167
-
168
- # store found attributes
169
- @attributes.concat( line_symbols.collect{ | value | value[ 0 ] }.compact ).uniq!
170
- end
171
-
172
- end
173
-
174
- # store filename that we don't scan the file again...
175
- @files << file_name
176
-
177
- # do not change this or evaluate anything after this line; update filter behaviour depends of this return value
178
- true
179
-
180
- end
181
-
182
- end
183
-
184
- # enable hooking for performance measurement & debug logging
185
- TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
186
-
187
- end # DynamicAttributeFilter
188
-
189
- end # MobyUtil