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.
- data/bin/tdriver-devtools +0 -0
- data/ext/native_extensions.c +165 -6
- data/lib/tdriver-devtools/behaviour/old/xml/update +0 -0
- data/lib/tdriver-devtools/behaviour/xml/generate.rb +0 -0
- data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +15 -1
- data/lib/tdriver-devtools/doc/update +0 -0
- data/lib/tdriver-devtools/doc/xslt/template.xsl +24 -14
- data/lib/tdriver-devtools/doc/xslt/update +0 -0
- data/lib/tdriver-devtools/tdriver-devtools.rb +0 -0
- data/lib/tdriver-devtools/tests/feature_tests/update +0 -0
- data/lib/tdriver/base/behaviour/{behaviour.rb → abstract.rb} +3 -6
- data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +2 -2
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +47 -37
- data/lib/tdriver/base/behaviour/factory.rb +260 -382
- data/lib/tdriver/base/behaviour/loader.rb +22 -4
- data/lib/tdriver/base/controller/abstraction.rb +56 -0
- data/lib/tdriver/base/controller/loader.rb +21 -0
- data/lib/tdriver/base/loader.rb +3 -1
- data/lib/tdriver/base/sut/controller.rb +91 -74
- data/lib/tdriver/base/sut/factory.rb +8 -8
- data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +116 -96
- data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
- data/lib/tdriver/base/sut/sut.rb +10 -8
- data/lib/tdriver/base/test_object/abstract.rb +25 -24
- data/lib/tdriver/base/test_object/adapter.rb +67 -44
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +79 -20
- data/lib/tdriver/base/test_object/factory.rb +45 -15
- data/lib/tdriver/base/test_object/xml/adapter.rb +80 -57
- data/lib/tdriver/env.rb +0 -0
- data/lib/tdriver/loader.rb +0 -0
- data/lib/tdriver/matti.rb +0 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +1 -0
- data/lib/tdriver/report/report.rb +2 -1
- data/lib/tdriver/report/report_crash_file_capture.rb +12 -0
- data/lib/tdriver/report/report_creator.rb +6 -2
- data/lib/tdriver/report/report_execution_statistics.rb +27 -11
- data/lib/tdriver/report/report_graph_generator.rb +59 -0
- data/lib/tdriver/report/report_test_case_run.rb +34 -2
- data/lib/tdriver/report/report_writer.rb +12 -0
- data/lib/tdriver/tdriver.rb +12 -1
- data/lib/tdriver/util/agent/loader.rb +22 -0
- data/lib/tdriver/util/agent/service.rb +107 -0
- data/lib/tdriver/util/common/crc16.rb +17 -10
- data/lib/tdriver/util/common/hash.rb +4 -1
- data/lib/tdriver/util/common/kernel.rb +11 -0
- data/lib/tdriver/util/common/numeric.rb +48 -0
- data/lib/tdriver/util/common/object.rb +5 -2
- data/lib/tdriver/util/common/string.rb +8 -1
- 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 +157 -0
- data/lib/tdriver/util/loader.rb +8 -2
- data/lib/tdriver/util/logger/logger.rb +12 -6
- data/lib/tdriver/util/other/config.rb +0 -0
- data/lib/tdriver/util/parameter/parameter.rb +221 -152
- data/lib/tdriver/util/plugin/error.rb +0 -0
- data/lib/tdriver/util/video/camera_linux.rb +36 -22
- data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +3 -13
- data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +13 -8
- data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +51 -9
- data/lib/tdriver/util/xml/xml.rb +4 -2
- data/lib/tdriver/verify/verify.rb +280 -621
- data/lib/tdriver/version.rb +1 -1
- data/xml/behaviours/generic.xml +34 -0
- data/xml/templates/generic.xml +20 -3
- metadata +168 -240
- data/lib/tdriver-devtools/tests/feature_tests/output/application_closable_0x3f.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/application_close.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/application_environment.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/application_executable_name.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/application_uid.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/created.rid +0 -1
- data/lib/tdriver-devtools/tests/feature_tests/output/find_find.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/flash_behaviour_flash_images.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_application.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_capture_screen.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_child.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_clear_verify_blocks.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_connect.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_controller_execution_order_0x3d.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_current_application_id.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_disconnect.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_dump_count.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_freeze.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_frozen.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_application_id.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_object.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_operator_data.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_ui_dump.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_get_user_information.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_input.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_parameter.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_press_key.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_received_data.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh.feature +0 -20
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_timeout.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_tries.feature +0 -15
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_refresh_ui_dump.feature +0 -20
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_run.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_sent_data.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_state.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_translate.feature +0 -30
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_type.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_ui_version.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_unfreeze.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_update.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_always.feature +0 -20
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_verify_blocks.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_x_path.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_0x3d.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/sut_xml_data_crc.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_down.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_status.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_power_up.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/switchbox_behaviour_reset.feature +0 -10
- data/lib/tdriver-devtools/tests/feature_tests/output/verification_test_object_exists_0x3f.feature +0 -15
- data/lib/tdriver/base/behaviour/factory_new.rb +0 -409
- data/lib/tdriver/base/test_object/identificator.rb +0 -518
- 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
|