testability-driver 1.3.0 → 1.3.1
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.
- data/ext/native_extensions.c +53 -25
- data/lib/matti.rb +0 -5
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +4 -4
- data/lib/tdriver/base/behaviour/factory.rb +120 -7
- data/lib/tdriver/base/errors.rb +1 -1
- data/lib/tdriver/base/state_object.rb +3 -2
- data/lib/tdriver/base/sut/controller.rb +2 -2
- data/lib/tdriver/base/sut/factory.rb +207 -201
- data/lib/tdriver/base/sut/generic/behaviours/application.rb +3 -6
- data/lib/tdriver/base/sut/generic/behaviours/find.rb +1 -1
- data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +14 -14
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +5 -5
- data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +14 -14
- data/lib/tdriver/base/sut/generic/behaviours/verification.rb +3 -18
- data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +6 -6
- data/lib/tdriver/base/sut/generic/plugin.rb +4 -9
- data/lib/tdriver/base/sut/sut.rb +2 -6
- data/lib/tdriver/base/test_object/abstract.rb +1 -1
- data/lib/tdriver/base/test_object/adapter.rb +5 -5
- data/lib/tdriver/base/test_object/behaviours/syncronization.rb +7 -6
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +18 -18
- data/lib/tdriver/base/test_object/factory.rb +147 -96
- data/lib/tdriver/base/test_object/verification.rb +6 -9
- data/lib/tdriver/base/test_object/xml/adapter.rb +5 -5
- data/lib/tdriver/matti.rb +1 -1
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +17 -8
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +7 -7
- data/lib/tdriver/report/report_api.rb +172 -79
- data/lib/tdriver/report/report_crash_file_capture.rb +4 -7
- data/lib/tdriver/report/report_creator.rb +16 -20
- data/lib/tdriver/report/report_file_capture.rb +3 -3
- data/lib/tdriver/report/report_javascript.rb +3 -3
- data/lib/tdriver/report/report_test_case_run.rb +20 -10
- data/lib/tdriver/report/report_test_run.rb +11 -10
- data/lib/tdriver/report/report_writer.rb +13 -11
- data/lib/tdriver/tdriver.rb +6 -6
- data/lib/tdriver/util/common/array.rb +2 -2
- data/lib/tdriver/util/common/file.rb +9 -11
- data/lib/tdriver/util/common/gem.rb +1 -1
- data/lib/tdriver/util/common/kernel.rb +4 -4
- data/lib/tdriver/util/common/retryable.rb +2 -2
- data/lib/tdriver/util/common/string.rb +2 -3
- data/lib/tdriver/util/hooking/hooking.rb +2 -2
- data/lib/tdriver/util/localisation/localisation.rb +12 -12
- data/lib/tdriver/util/logger/logger.rb +7 -25
- data/lib/tdriver/util/operator_data/operator_data.rb +5 -5
- data/lib/tdriver/util/parameter/parameter.rb +2 -2
- data/lib/tdriver/util/plugin/abstract.rb +4 -3
- data/lib/tdriver/util/plugin/service.rb +31 -4
- data/lib/tdriver/util/recorder/recorder.rb +4 -4
- data/lib/tdriver/util/user_data/user_data.rb +5 -5
- data/lib/tdriver/util/video/camera_windows.rb +1 -1
- data/lib/tdriver/util/xml/builder.rb +3 -1
- data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +1 -1
- data/lib/tdriver/util/xml/xml.rb +5 -5
- data/lib/tdriver/verify/verify.rb +26 -26
- data/lib/tdriver/version.rb +1 -1
- data/xml/behaviours/generic.xml +1 -2
- metadata +2 -3
- data/lib/tdriver/verify/verify.rb_org +0 -630
@@ -86,13 +86,13 @@ module MobyBehaviour
|
|
86
86
|
# description: If no application test object is found after close or if this application is still in the foreground after the close.
|
87
87
|
#
|
88
88
|
# TypeError
|
89
|
-
# description: Wrong argument type
|
89
|
+
# description: Wrong argument type <class> for options_hash (expected a Hash, TrueClass or FalseClass)
|
90
90
|
#
|
91
91
|
# TypeError
|
92
|
-
# description: Wrong argument type
|
92
|
+
# description: Wrong argument type <class> for :force_kill (expected NilClass, TrueClass or FalseClass)
|
93
93
|
#
|
94
94
|
# TypeError
|
95
|
-
# description: Wrong argument type
|
95
|
+
# description: Wrong argument type <class> for :check_process (expected TrueClass or FalseClass)
|
96
96
|
#
|
97
97
|
def close( options_hash = {} )
|
98
98
|
|
@@ -344,9 +344,6 @@ module MobyBehaviour
|
|
344
344
|
# puts @sut.application.closable #prints foreground application closable status to console (at the moment always true)
|
345
345
|
def closable?
|
346
346
|
|
347
|
-
#file, line = caller.first.split(":")
|
348
|
-
#$stderr.puts "%s:%s warning: TestObject#closable? is deprecated" % [ file, line ]
|
349
|
-
|
350
347
|
true
|
351
348
|
|
352
349
|
end
|
@@ -63,7 +63,7 @@ module MobyBehaviour
|
|
63
63
|
#
|
64
64
|
# == exceptions
|
65
65
|
# TypeError
|
66
|
-
# description: Wrong argument type
|
66
|
+
# description: Wrong argument type <class> for attributes (expected Hash)
|
67
67
|
#
|
68
68
|
# ArgumentError
|
69
69
|
# description: Attributes hash must not be empty
|
@@ -126,7 +126,7 @@ module MobyBehaviour
|
|
126
126
|
|
127
127
|
begin
|
128
128
|
if parameter(:flaxi_flash_attempts)
|
129
|
-
$stderr.puts "
|
129
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_flash_attempts deprecated use :flash_attempts instead"
|
130
130
|
parameter[:flash_attempts]=parameter(:flaxi_flash_attempts)
|
131
131
|
end
|
132
132
|
rescue
|
@@ -134,7 +134,7 @@ module MobyBehaviour
|
|
134
134
|
|
135
135
|
begin
|
136
136
|
if parameter(:flaxi_commands_before_flash)
|
137
|
-
$stderr.puts "
|
137
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_commands_before_flash deprecated use :commands_before_flash instead"
|
138
138
|
parameter[:commands_before_flash]=parameter(:flaxi_commands_before_flash)
|
139
139
|
end
|
140
140
|
rescue
|
@@ -142,7 +142,7 @@ module MobyBehaviour
|
|
142
142
|
|
143
143
|
begin
|
144
144
|
if parameter(:flaxi_flash_command)
|
145
|
-
$stderr.puts "
|
145
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_flash_command deprecated use :flash_command instead"
|
146
146
|
parameter[:flash_command]=parameter(:flaxi_flash_command)
|
147
147
|
end
|
148
148
|
rescue
|
@@ -150,7 +150,7 @@ module MobyBehaviour
|
|
150
150
|
|
151
151
|
begin
|
152
152
|
if parameter(:flaxi_optional_parameters_after_flashing)
|
153
|
-
$stderr.puts "
|
153
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_optional_parameters_after_flashing deprecated use :optional_parameters_after_flashing instead"
|
154
154
|
parameter[:optional_parameters_after_flashing]=parameter(:flaxi_optional_parameters_after_flashing)
|
155
155
|
end
|
156
156
|
rescue
|
@@ -158,7 +158,7 @@ module MobyBehaviour
|
|
158
158
|
|
159
159
|
begin
|
160
160
|
if parameter(:flaxi_flash_images)
|
161
|
-
$stderr.puts "
|
161
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_flash_images deprecated use :flash_images instead"
|
162
162
|
parameter[:flash_images]=parameter(:flaxi_flash_images)
|
163
163
|
end
|
164
164
|
rescue
|
@@ -166,7 +166,7 @@ module MobyBehaviour
|
|
166
166
|
|
167
167
|
begin
|
168
168
|
if parameter(:flaxi_sleep_time_after_flash_command)
|
169
|
-
$stderr.puts "
|
169
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_sleep_time_after_flash_command deprecated use :sleep_time_after_flash_command instead"
|
170
170
|
parameter[:sleep_time_after_flash_command]=parameter(:flaxi_sleep_time_after_flash_command)
|
171
171
|
end
|
172
172
|
rescue
|
@@ -174,7 +174,7 @@ module MobyBehaviour
|
|
174
174
|
|
175
175
|
begin
|
176
176
|
if parameter(:flaxi_command_after_flash)
|
177
|
-
$stderr.puts "
|
177
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_command_after_flash deprecated use :command_after_flash instead"
|
178
178
|
parameter[:command_after_flash]=parameter(:flaxi_command_after_flash)
|
179
179
|
end
|
180
180
|
rescue
|
@@ -182,7 +182,7 @@ module MobyBehaviour
|
|
182
182
|
|
183
183
|
begin
|
184
184
|
if parameter(:flaxi_commands_after_failed_flash)
|
185
|
-
$stderr.puts "
|
185
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_commands_after_failed_flash deprecated use :commands_after_failed_flash instead"
|
186
186
|
parameter[:commands_after_failed_flash]=parameter(:flaxi_commands_after_failed_flash)
|
187
187
|
end
|
188
188
|
rescue
|
@@ -190,7 +190,7 @@ module MobyBehaviour
|
|
190
190
|
|
191
191
|
begin
|
192
192
|
if parameter(:flaxi_flash_command_success_string)
|
193
|
-
$stderr.puts "
|
193
|
+
$stderr.puts "#{ file.to_s }:#{ line.to_s } warning: parameter :flaxi_flash_command_success_string deprecated use :flash_command_success_string instead"
|
194
194
|
parameter[:flash_command_success_string]=parameter(:flaxi_flash_command_success_string)
|
195
195
|
end
|
196
196
|
rescue
|
@@ -198,14 +198,14 @@ module MobyBehaviour
|
|
198
198
|
|
199
199
|
if flash_files==nil
|
200
200
|
flash_files=parameter(:flash_images)
|
201
|
-
|
201
|
+
raise MobyBase::BehaviourError.new("flash_images", "flash_images not defined for sut in tdriver_parameters.xml") if flash_files == nil
|
202
202
|
end
|
203
203
|
|
204
204
|
str_flash_command=parameter(:flash_command)
|
205
|
-
|
205
|
+
raise MobyBase::BehaviourError.new("flash_images", "flash_command not defined for sut in tdriver_parameters.xml") if str_flash_command == nil
|
206
206
|
|
207
207
|
str_optional_parameters=parameter(:optional_parameters_after_flashing,'')
|
208
|
-
|
208
|
+
raise MobyBase::BehaviourError.new("flash_images", "optional_parameters_after_flashing not defined for sut in tdriver_parameters.xml") if str_optional_parameters == nil
|
209
209
|
|
210
210
|
#build flash command
|
211
211
|
flash_command="#{str_flash_command} #{flash_files} #{str_optional_parameters}"
|
@@ -213,7 +213,7 @@ module MobyBehaviour
|
|
213
213
|
#start flashing
|
214
214
|
result = start_flashing( flash_command )
|
215
215
|
|
216
|
-
|
216
|
+
raise MobyBase::BehaviourError.new("flash_images", "Flashing failed") if result.to_s == 'false'
|
217
217
|
sleep parameter[:sleep_time_after_flash_command].to_i
|
218
218
|
end
|
219
219
|
|
@@ -250,7 +250,7 @@ module MobyBehaviour
|
|
250
250
|
def start_flashing(flash_command)
|
251
251
|
|
252
252
|
flash_attempts=parameter(:flash_attempts)
|
253
|
-
|
253
|
+
raise MobyBase::BehaviourError.new("start_flashing", "flash_attempts not defined for sut in tdriver_parameters.xml") if flash_attempts == nil
|
254
254
|
|
255
255
|
current_flash_attempt=0
|
256
256
|
flash_result='false'
|
@@ -253,7 +253,7 @@ module MobyBehaviour
|
|
253
253
|
#
|
254
254
|
# == exception
|
255
255
|
# TypeError
|
256
|
-
# description: Wrong argument type
|
256
|
+
# description: Wrong argument type <class> for XML (expected MobyUtil::XML::Element, String or NilClass)
|
257
257
|
def xml_data=( xml )
|
258
258
|
|
259
259
|
xml.check_type( [ MobyUtil::XML::Element, String, NilClass ], "Wrong argument type $1 for XML (expected $2)" )
|
@@ -552,7 +552,7 @@ module MobyBehaviour
|
|
552
552
|
#
|
553
553
|
# == exceptions
|
554
554
|
# TypeError
|
555
|
-
# description: Wrong argument type
|
555
|
+
# description: Wrong argument type <class> for attributes (expected Hash)
|
556
556
|
#
|
557
557
|
def application( attributes = {} )
|
558
558
|
|
@@ -614,13 +614,13 @@ module MobyBehaviour
|
|
614
614
|
#
|
615
615
|
# == exceptions
|
616
616
|
# TypeError
|
617
|
-
# description: Wrong argument type
|
617
|
+
# description: Wrong argument type <class> (expected Hash)
|
618
618
|
#
|
619
619
|
# ArgumentError
|
620
620
|
# description: Output filename (:filename) not defined in argument hash
|
621
621
|
#
|
622
622
|
# ArgumentError
|
623
|
-
# description: Wrong argument type
|
623
|
+
# description: Wrong argument type <class> for output filename (expected String)
|
624
624
|
#
|
625
625
|
# ArgumentError
|
626
626
|
# description: Output filename must not be empty string
|
@@ -707,7 +707,7 @@ module MobyBehaviour
|
|
707
707
|
#
|
708
708
|
# == exceptions
|
709
709
|
# TypeError
|
710
|
-
# description: Wrong argument type
|
710
|
+
# description: Wrong argument type <class> for run method (expected Hash)
|
711
711
|
#
|
712
712
|
# ArgumentError
|
713
713
|
# description: Required key :uid or :name not found from argument hash
|
@@ -65,27 +65,27 @@ module MobyBehaviour
|
|
65
65
|
# description: switchbox_sleep_after_powerup_in_reboot could not be converted to integer
|
66
66
|
def reset
|
67
67
|
str_sleep_time_before_powerup = parameter(:switchbox_sleep_before_powerup_in_reboot)
|
68
|
-
|
68
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_before_powerup_in_reboot not defined for sut in tdriver_parameters.xml") if str_sleep_time_before_powerup == nil
|
69
69
|
|
70
70
|
str_sleep_time_after_powerup = parameter(:switchbox_sleep_after_powerup_in_reboot)
|
71
|
-
|
71
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_after_powerup_in_reboot not defined for sut in tdriver_parameters.xml") if str_sleep_time_after_powerup == nil
|
72
72
|
|
73
73
|
str_commands_after_powerup = parameter(:switchbox_commands_after_powerup_in_reboot)
|
74
74
|
|
75
75
|
begin
|
76
76
|
sleep_time_before_powerup = str_sleep_time_before_powerup.to_i
|
77
|
-
|
77
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_before_powerup_in_reboot need to be non-negative integer smaller than 50 seconds") if sleep_time_before_powerup < 0 or sleep_time_before_powerup > 50
|
78
78
|
|
79
79
|
rescue
|
80
|
-
|
80
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_in_reboot could not be converted to integer")
|
81
81
|
end
|
82
82
|
|
83
83
|
begin
|
84
84
|
sleep_time_after_powerup = str_sleep_time_after_powerup.to_i
|
85
|
-
|
85
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_after_powerup_in_reboot need to be non-negative integer smaller than 500 seconds") if sleep_time_after_powerup < 0 or sleep_time_after_powerup > 500
|
86
86
|
|
87
87
|
rescue
|
88
|
-
|
88
|
+
raise BehaviourError.new("reboot", "switchbox_sleep_after_powerup_in_reboot could not be converted to integer")
|
89
89
|
end
|
90
90
|
|
91
91
|
power_down
|
@@ -126,12 +126,12 @@ module MobyBehaviour
|
|
126
126
|
|
127
127
|
switchbox_sequence_timeout = parameter(:switchbox_timeout_between_command_sequence)
|
128
128
|
|
129
|
-
|
129
|
+
raise BehaviourError.new("power_down", "switchbox_timeout_between_command_sequence not defined for sut in tdriver_parameters.xml") if switchbox_sequence_timeout == nil
|
130
130
|
|
131
|
-
|
131
|
+
raise BehaviourError.new("power_down", "switchbox_powerdown_command not defined for sut in tdriver_parameters.xml") if str_command == nil
|
132
132
|
|
133
133
|
str_result = parameter(:switchbox_powerdown_command_success_string)
|
134
|
-
|
134
|
+
raise BehaviourError.new("power_down", "switchbox_powerdown_command_success string not defined for sut in tdriver_parameters.xml") if str_result == nil
|
135
135
|
|
136
136
|
#generate the sequence
|
137
137
|
str_command_arr = str_command.split('|')
|
@@ -142,7 +142,7 @@ module MobyBehaviour
|
|
142
142
|
std_out = system(foobox_command)
|
143
143
|
$logger.behaviour "PASS;Powerdown command #{foobox_command} executed"
|
144
144
|
sleep switchbox_sequence_timeout.to_i
|
145
|
-
|
145
|
+
raise BehaviourError.new("power_down", "Failed to power down") unless std_out.to_s.downcase.include?(str_result.to_s.downcase)
|
146
146
|
end
|
147
147
|
@switch_box_power_status = false
|
148
148
|
end
|
@@ -162,13 +162,13 @@ module MobyBehaviour
|
|
162
162
|
|
163
163
|
switchbox_sequence_timeout = parameter(:switchbox_timeout_between_command_sequence)
|
164
164
|
|
165
|
-
|
165
|
+
raise BehaviourError.new("power_down", "switchbox_timeout_between_command_sequence not defined for sut in tdriver_parameters.xml") if switchbox_sequence_timeout == nil
|
166
166
|
|
167
167
|
str_command = parameter(:switchbox_powerup_command_sequence)
|
168
|
-
|
168
|
+
raise BehaviourError.new("power_up", "switchbox_powerup_command not defined for sut in tdriver_parameters.xml") if str_command == nil
|
169
169
|
|
170
170
|
str_result = parameter(:switchbox_powerup_command_success_string)
|
171
|
-
|
171
|
+
raise BehaviourError.new("power_up", "switchbox_powerup_command_success string not defined for sut in tdriver_parameters.xml") if str_result == nil
|
172
172
|
|
173
173
|
#generate the sequence
|
174
174
|
str_command_arr = str_command.split('|')
|
@@ -179,7 +179,7 @@ module MobyBehaviour
|
|
179
179
|
std_out = system(foobox_command)
|
180
180
|
$logger.behaviour "PASS;Ppowerup command #{foobox_command} executed"
|
181
181
|
sleep switchbox_sequence_timeout.to_i
|
182
|
-
|
182
|
+
raise BehaviourError.new("power_up", "Failed to power up") unless std_out.to_s.downcase.include?(str_result.to_s.downcase)
|
183
183
|
end
|
184
184
|
|
185
185
|
@switch_box_power_status = true
|
@@ -64,7 +64,7 @@ module MobyBehaviour
|
|
64
64
|
#
|
65
65
|
# == exceptions
|
66
66
|
# TypeError
|
67
|
-
# description: Wrong argument type
|
67
|
+
# description: Wrong argument type <class> for test object type (expected String)
|
68
68
|
#
|
69
69
|
# ArgumentError
|
70
70
|
# description: The test object type argument must not be empty
|
@@ -73,7 +73,7 @@ module MobyBehaviour
|
|
73
73
|
# description: Test object attributes hash argument must not be empty
|
74
74
|
#
|
75
75
|
# TypeError
|
76
|
-
# description: Wrong argument type
|
76
|
+
# description: Wrong argument type <class> for test object attributes (expected Hash)
|
77
77
|
def test_object_exists?( *attributes )
|
78
78
|
|
79
79
|
begin
|
@@ -198,22 +198,7 @@ module MobyBehaviour
|
|
198
198
|
$logger.enabled = ( attributes[ :__logging ] == 'true' ? true : false )
|
199
199
|
|
200
200
|
# behaviour logging
|
201
|
-
$logger.behaviour(
|
202
|
-
|
203
|
-
"%s;%s;%s;test_object_exists?;" % [
|
204
|
-
|
205
|
-
# status
|
206
|
-
( result == true ? 'PASS' : 'FAIL' ),
|
207
|
-
|
208
|
-
# description
|
209
|
-
description,
|
210
|
-
|
211
|
-
# sut id
|
212
|
-
( self.kind_of?( MobyBase::SUT ) ? self.id.to_s : '' )
|
213
|
-
|
214
|
-
]
|
215
|
-
|
216
|
-
)
|
201
|
+
$logger.behaviour "#{ ( result == true ? 'PASS' : 'FAIL' ) };#{ description };#{ ( self.sut? ? self.id.to_s : '' ) };test_object_exists?;"
|
217
202
|
|
218
203
|
# raise exception if neccessery
|
219
204
|
raise result if result.kind_of?( Exception )
|
@@ -53,21 +53,21 @@ module MobyCommand
|
|
53
53
|
# == returns
|
54
54
|
# self
|
55
55
|
# == raises
|
56
|
-
# TypeError:: Wrong argument type
|
57
|
-
# ArgumentError:: Positive value expected for times count (got
|
56
|
+
# TypeError:: Wrong argument type <class> for times count (expected Fixnum)
|
57
|
+
# ArgumentError:: Positive value expected for times count (got <value>)
|
58
58
|
# IndexError:: Unable to multiply last given key due to key sequence is empty
|
59
59
|
def times!( count = 1 )
|
60
60
|
|
61
61
|
# verify count argument type
|
62
|
-
#
|
62
|
+
#raise ArgumentError.new("Fixnum expected as argument") if count.class != Fixnum
|
63
63
|
count.check_type( Fixnum, "Wrong argument type $1 for times count (expected $2)" )
|
64
64
|
|
65
65
|
# verify that count is positive number
|
66
|
-
|
66
|
+
raise ArgumentError.new( "Positive value expected for times count (got #{ count })" ) if count.negative?
|
67
67
|
|
68
68
|
# verify that @sequence is not empty
|
69
|
-
#
|
70
|
-
|
69
|
+
#raise IndexError.new( "Not allowed when empty key sequence" ) if @sequence.size == 0
|
70
|
+
raise IndexError.new( "Unable to multiply last given key due to key sequence is empty" ) if @sequence.empty?
|
71
71
|
|
72
72
|
count.times do | iteration |
|
73
73
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
############################################################################
|
19
19
|
|
20
20
|
# verify that plugin engine and modules is loaded
|
21
|
-
|
21
|
+
raise RuntimeError.new( "This SUT plugin requires Testability Driver and cannot be launched in standalone mode" ) unless defined?( MobyUtil::Plugin )
|
22
22
|
|
23
23
|
module MobyPlugin
|
24
24
|
|
@@ -30,7 +30,8 @@ module MobyPlugin
|
|
30
30
|
def self.plugin_name
|
31
31
|
|
32
32
|
# return plugin name as string
|
33
|
-
"
|
33
|
+
"testability-driver-generic-sut-plugin"
|
34
|
+
|
34
35
|
end
|
35
36
|
|
36
37
|
def self.plugin_type
|
@@ -71,15 +72,9 @@ module MobyPlugin
|
|
71
72
|
|
72
73
|
end
|
73
74
|
|
74
|
-
# returns SUT object - this method will be called from
|
75
|
+
# returns SUT object - this method will be called from TDriver::SUTFactory
|
75
76
|
def self.make_sut( sut_id )
|
76
77
|
|
77
|
-
# MobyBase::SUT.new(
|
78
|
-
# MobyBase::SutController.new( "", MobyController::SutAdapter.new() ),
|
79
|
-
# MobyBase::TestObjectFactory.instance,
|
80
|
-
# sut_id
|
81
|
-
# )
|
82
|
-
|
83
78
|
MobyBase::SUT.new(
|
84
79
|
MobyBase::SutController.new( "", MobyController::SutAdapter.new() ),
|
85
80
|
TDriver.TestObjectFactory.new( TDriver::TestObjectAdapter ),
|
data/lib/tdriver/base/sut/sut.rb
CHANGED
@@ -43,19 +43,15 @@ module MobyBase
|
|
43
43
|
def initialize( sut_controller, test_object_factory, sut_id, test_object_adapter = nil )
|
44
44
|
|
45
45
|
@sut_controller = sut_controller
|
46
|
-
|
47
|
-
#@sut_controller.test_object_factory = test_object_factory
|
48
|
-
|
49
|
-
#@sut_controller.test_object_adapter = test_object_adapter || TDriver::TestObjectAdapter
|
50
46
|
|
51
47
|
# remove this line when possible
|
52
48
|
@_sutController = sut_controller
|
53
49
|
|
54
50
|
# remove this line when possible
|
55
|
-
@test_object_factory = test_object_factory
|
51
|
+
@test_object_factory = test_object_factory
|
56
52
|
|
57
53
|
# remove this line when possible
|
58
|
-
@test_object_adapter = test_object_adapter || TDriver::TestObjectAdapter
|
54
|
+
@test_object_adapter = test_object_adapter || TDriver::TestObjectAdapter
|
59
55
|
|
60
56
|
@id = sut_id
|
61
57
|
|
@@ -175,7 +175,7 @@ module MobyBase
|
|
175
175
|
|
176
176
|
rescue MobyBase::TestObjectNotFoundError
|
177
177
|
|
178
|
-
|
178
|
+
raise MobyBase::TestObjectNotFoundError.new(
|
179
179
|
|
180
180
|
"The test object (id: #{ @id.inspect }, type: #{ @type.inspect }, name: #{ @name.inspect }) does not exist on #{ @sut.id.inspect } anymore"
|
181
181
|
|
@@ -343,7 +343,7 @@ module TDriver
|
|
343
343
|
else
|
344
344
|
|
345
345
|
# raise exception if layout direction it not supported
|
346
|
-
|
346
|
+
raise ArgumentError, "Unsupported layout direction #{ layout_direction.inspect }"
|
347
347
|
|
348
348
|
end
|
349
349
|
|
@@ -388,7 +388,7 @@ module TDriver
|
|
388
388
|
if default.empty?
|
389
389
|
|
390
390
|
# raise exception if no such attribute found
|
391
|
-
|
391
|
+
raise MobyBase::AttributeNotFoundError, "Could not find test object element attribute #{ attribute_name.inspect }"
|
392
392
|
|
393
393
|
else
|
394
394
|
|
@@ -433,7 +433,7 @@ module TDriver
|
|
433
433
|
if default.empty?
|
434
434
|
|
435
435
|
# raise exception if no such attribute found
|
436
|
-
|
436
|
+
raise MobyBase::AttributeNotFoundError, "Could not find attribute #{ attribute_name.inspect }" # for test object of type #{ type.to_s }"
|
437
437
|
|
438
438
|
else
|
439
439
|
|
@@ -448,7 +448,7 @@ module TDriver
|
|
448
448
|
|
449
449
|
# attribute(s) found
|
450
450
|
# Need to disable this for now
|
451
|
-
#
|
451
|
+
# raise MobyBase::MultipleAttributesFoundError.new( "Multiple attributes found with name '#{ name }'" ) if nodeset.count > 1
|
452
452
|
|
453
453
|
# return found attribute
|
454
454
|
nodeset.first.content
|
@@ -605,7 +605,7 @@ module TDriver
|
|
605
605
|
nodeset = test_object.instance_variable_get( :@sut ).xml_data.xpath( test_object.instance_variable_get( :@x_path ) )
|
606
606
|
|
607
607
|
# raise exception if no test objects found
|
608
|
-
|
608
|
+
raise MobyBase::TestObjectNotFoundError if nodeset.empty?
|
609
609
|
|
610
610
|
# return first test object from the nodeset
|
611
611
|
nodeset.first
|