Module: TDriver
- Defined in:
- lib/tdriver/base/sut/factory.rb,
lib/tdriver/tdriver.rb,
lib/tdriver/util/common/crc16.rb,
lib/tdriver/util/agent/service.rb,
lib/tdriver/util/keymap/keymap.rb,
lib/tdriver/util/plugin/service.rb,
lib/tdriver/util/fixture/service.rb,
lib/tdriver/util/hooking/hooking.rb,
lib/tdriver/util/common/stackable.rb,
lib/tdriver/base/behaviour/factory.rb,
lib/tdriver/base/test_object/cache.rb,
lib/tdriver/base/test_object/adapter.rb,
lib/tdriver/base/test_object/factory.rb,
lib/tdriver/util/parameter/parameter.rb,
lib/tdriver/base/test_object/xml/adapter.rb,
lib/tdriver/base/test_object/verification.rb,
lib/tdriver/util/filters/attribute_filter.rb,
lib/tdriver/base/test_object/xml/abstraction.rb,
ext/native_extensions.c
Overview
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Contact: Nokia Corporation ([email protected])
This file is part of Testability Driver.
If you have questions regarding the use of this file, please contact Nokia at [email protected] .
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation and appearing in the file LICENSE.LGPL included in the packaging of this file.
Defined Under Namespace
Modules: Abstraction, FixtureSetupFunctions, NativeExtensions, OptimizedXML, TestObjectFactory, TestObjectVerification Classes: AgentService, AttributeFilter, BehaviourFactory, Checksum, FixturePluginService, FixtureService, Hooking, KeymapUtilities, Parameter, ParameterHash, ParameterUserAPI, PluginService, SUTFactory, StackableValue, TestObjectAdapter, TestObjectCache
Class Method Summary collapse
-
.config_dir ⇒ Object
nodoc TODO: document me.
-
.connect_sut(sut_attributes = {}) ⇒ Object
- Function to create and (or if already created re-) connect SUT object === params hash
-
Defines SUT type, identification attributes etc.
-
.disconnect_sut(sut_attributes = {}) ⇒ Object
Function to disconnect SUT object.
-
.library_dir ⇒ Object
nodoc TODO: document me.
-
.logger ⇒ Object
nodoc Wrapper for MobyUtil::Logger class.
-
.parameter(*arguments) ⇒ Object
Wrapper for TDriver::ParameterUserAPI class with methods e.g.
-
.reboot_sut(sut_attributes = {}) ⇒ Object
Function to reboot SUT object.
-
.state_object(options) ⇒ Object
TODO: document me.
-
.sut(*args) ⇒ Object
Wrapper for SUT functionality.
-
.suts ⇒ Object
Wrapper for TDriver::Parameter.configured_suts to retrieve all configured sut names.
-
.version ⇒ Object
nodoc TODO: document me.
Class Method Details
.config_dir ⇒ Object
nodoc
TODO: document me
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/tdriver/tdriver.rb', line 143 def config_dir if ENV['TDRIVER_HOME'] config_dir = ENV['TDRIVER_HOME'] elsif MobyUtil::EnvironmentHelper.windows? config_dir = "c:/tdriver" else config_dir = "/etc/tdriver" end File.( config_dir ) end |
.connect_sut(sut_attributes = {}) ⇒ Object
Function to create and (or if already created re-) connect SUT object
params
- hash
-
Defines SUT type, identification attributes etc.
- :id
-
Valid id that can be matched in tdriver_parameters.xml
raises
- ArgumentError
-
Wrong argument type <class> (expected Hash)
- ArgumentError
-
SUT type not defined
- ArgumentError
-
SUT type <name> not supported
- ArgumentError
-
Sut id not given
- MobyUtil::ParameterFileNotFoundError
-
if paramter file (tdriver_parameters.xml in TDriver home directory) is not found
returns
- Object
-
Object that SUTFactory returns
example
@sut = TDriver.connect_sut(:Id =>'sut_qt') # for qt, id in configuration file sut_qt
58 59 60 61 62 |
# File 'lib/tdriver/tdriver.rb', line 58 def connect_sut( sut_attributes = {} ) TDriver::SUTFactory.make( sut_attributes ) end |
.disconnect_sut(sut_attributes = {}) ⇒ Object
Function to disconnect SUT object.
params
- hash
-
Defines SUT type, identification attributes etc.
- :id
-
Valid id that can be matched in tdriver_parameters.xml and is already connected
raises
- ArgumentError
-
Not connected to device ‘id’ if not connected at all / device already disconnected
- ArgumentError
-
Sut id not given
returns
- Object
-
SUT object
example
@sut = TDriver.disconnect_sut(:Id =>'sut_qt') # for qt, should be connected already
75 76 77 78 79 |
# File 'lib/tdriver/tdriver.rb', line 75 def disconnect_sut( sut_attributes = {} ) TDriver::SUTFactory.disconnect_sut( sut_attributes ) end |
.library_dir ⇒ Object
nodoc
TODO: document me
165 166 167 168 169 |
# File 'lib/tdriver/tdriver.rb', line 165 def library_dir File.( File.dirname( __FILE__ ) ) end |
.logger ⇒ Object
nodoc
Wrapper for MobyUtil::Logger class
135 136 137 138 139 |
# File 'lib/tdriver/tdriver.rb', line 135 def logger $logger end |
.parameter(*arguments) ⇒ Object
Wrapper for TDriver::ParameterUserAPI class with methods e.g. [] and []=, files and load_xml etc.
111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/tdriver/tdriver.rb', line 111 def parameter( *arguments ) if arguments.count == 0 $parameters_api else $parameters_api[ *arguments ] end end |
.reboot_sut(sut_attributes = {}) ⇒ Object
Function to reboot SUT object.
params
- hash
-
Defines SUT type, identification attributes etc.
- :id
-
Valid id that can be matched in tdriver_parameters.xml and is already connected
raises
- ArgumentError
-
Not connected to device ‘id’ if not connected at all / device already disconnected
- ArgumentError
-
Sut id not given
example
@sut = TDriver.reboot_sut(:Id => 'sut_qt') # for Qt, should be connected already
90 91 92 93 94 |
# File 'lib/tdriver/tdriver.rb', line 90 def reboot_sut( sut_attributes = {} ) TDriver::SUTFactory.reboot_sut( sut_attributes ) end |
.state_object(options) ⇒ Object
TODO: document me
126 127 128 129 130 131 |
# File 'lib/tdriver/tdriver.rb', line 126 def state_object( ) # create state object with given options MobyBase::StateObject.new( ) end |
.sut(*args) ⇒ Object
Wrapper for SUT functionality. For documentation, please see TDriver::connect_sut
97 98 99 100 101 |
# File 'lib/tdriver/tdriver.rb', line 97 def sut( *args ) connect_sut( *args ) end |
.suts ⇒ Object
Wrapper for TDriver::Parameter.configured_suts to retrieve all configured sut names
104 105 106 107 108 |
# File 'lib/tdriver/tdriver.rb', line 104 def suts $parameters.configured_suts end |
.version ⇒ Object
nodoc
TODO: document me
173 174 175 176 177 |
# File 'lib/tdriver/tdriver.rb', line 173 def version ENV['TDRIVER_VERSION'] || "unknown" end |