|
ADTF
|
#include <test_system.h>
Inherits adtf::system::testing::giant::cTestSystem.
Public Member Functions | |
| cSessionTestSystem (const std::string &strUrl="", const std::string &strAdtfDirectory=ADTF_TESTING_ADTF_DIR, const std::string &strPluginDirectories=ADTF_TESTING_PLUGIN_DIRECTORIES, const std::string &strResources=ADTF_TESTING_MUTABLE_RESOURCES, const std::string &strResourcesOutputDirectory=ADTF_TESTING_BUILD_DIR) | |
| cSessionTestSystem (const std::string &strUrl, bool bCreateLoggingService, const std::string &strAdtfDirectory=ADTF_TESTING_ADTF_DIR, const std::string &strPluginDirectories=ADTF_TESTING_PLUGIN_DIRECTORIES, const std::string &strResources=ADTF_TESTING_MUTABLE_RESOURCES, const std::string &strResourcesOutputDirectory=ADTF_TESTING_BUILD_DIR) | |
| void | SetEnvironmentFile (const std::string &strFileName, bool bPluginDiscovery=true) |
| void | CreateSession (const std::string &strFileName) |
| void | Exec (std::chrono::microseconds tmTimeout) |
| void | Exec (int8_t nInitialRunlevel, std::function< void()> fnStartup) |
| void | ExecTest (int8_t nInitialRunlevel, std::function< void()> fnTest) |
| void | Exec (int8_t nInitialRunlevel, int8_t nAutoQuitLevel, std::function< void()> fnStartup) |
| ucom::ant::object_ptr< services::ISession > | GetSession () |
| ucom::ant::object_ptr< streaming::ant::IStreamingGraph > | GetStreamingGraph () |
| ucom::ant::object_ptr< streaming::ant::IFilterGraph > | GetFilterGraph () |
| ucom::ant::object_ptr< streaming::ant::INamedGraphObject > | GetGraphObject (const std::string &name) |
Public Member Functions inherited from adtf::system::testing::giant::cTestSystem | |
| cTestSystem (const std::string &strUrl="", const std::vector< std::string > &oPlugins={}, bool bCreateSessionManager=false, const std::string &strAdtfDirectory=ADTF_TESTING_ADTF_DIR, const std::string &strPluginDirectories=ADTF_TESTING_PLUGIN_DIRECTORIES, const std::string &strResources=ADTF_TESTING_MUTABLE_RESOURCES, const std::string &strResourcesOutputDirectory=ADTF_TESTING_BUILD_DIR) | |
| cTestSystem (const std::string &strUrl, const std::vector< std::string > &oPlugins, bool bCreateSessionManager, bool bCreateLoggingService, const std::string &strAdtfDirectory=ADTF_TESTING_ADTF_DIR, const std::string &strPluginDirectories=ADTF_TESTING_PLUGIN_DIRECTORIES, const std::string &strResources=ADTF_TESTING_MUTABLE_RESOURCES, const std::string &strResourcesOutputDirectory=ADTF_TESTING_BUILD_DIR) | |
| ~cTestSystem () | |
| void | SetRunLevel (base::ant::tADTFRunLevel eRunlevel) |
| base::ant::tADTFRunLevel | GetRunLevel () const |
| void | LoadPlugin (const std::string &strPluginFileName, bool bCreateServices=true, base::ant::tADTFRunLevel nServicesRunlevel=base::tADTFRunLevel::RL_System) |
| ucom::ant::object_ptr< ucom::ant::IService > | CreateService (const std::string &strClassId, const std::string &strObjectId, base::ant::tADTFRunLevel nRunlevel=base::tADTFRunLevel::RL_System) |
| ucom::ant::object_ptr< ucom::ant::IService > | CreateService (const std::string &strPluginFileName, const std::string &strClassId, const std::string &strObjectId, base::ant::tADTFRunLevel nRunlevel=base::tADTFRunLevel::RL_System) |
| ucom::ant::object_ptr< ucom::ant::IService > | CreateService (const std::string &strClassId, const std::string &strObjectId, base::ant::tADTFRunLevel nRunlevel, const std::map< std::string, std::string > &oProperties) |
| ucom::ant::object_ptr< ucom::ant::IService > | CreateService (const std::string &strPluginFileName, const std::string &strClassId, const std::string &strObjectId, base::ant::tADTFRunLevel nRunlevel, const std::map< std::string, std::string > &oProperties) |
| std::string | GetUrl () const |
| std::string | GetMutableResourceDirectory () const |
Additional Inherited Members | |
Public Types inherited from adtf::system::testing::giant::cTestSystem | |
| enum | tProtocolFamily { TCP_IPv4 , TCP_IPv6 , UDP_IPv4 , UDP_IPv6 } |
Static Public Member Functions inherited from adtf::system::testing::giant::cTestSystem | |
| static void | SetCurDirectory (const std::string &strRelativePath, const std::string &strTestSourceDirectory=ADTF_TESTING_SOURCE_DIR) |
| static void | SetMacro (const std::string &strName, const std::string &strValue) |
| static uint16_t | GetAvailablePort (tProtocolFamily eFamily, const std::string &strInterface={}) |
| static std::string | GetAvailableTestUrl () |
Protected Attributes inherited from adtf::system::testing::giant::cTestSystem | |
| std::unique_ptr< cImplementation > | m_pImplementation |
This class allows you to create a test system based on an ADTF Session.
| adtf::system::testing::giant::cSessionTestSystem::cSessionTestSystem | ( | const std::string & | strUrl = "", |
| const std::string & | strAdtfDirectory = ADTF_TESTING_ADTF_DIR, | ||
| const std::string & | strPluginDirectories = ADTF_TESTING_PLUGIN_DIRECTORIES, | ||
| const std::string & | strResources = ADTF_TESTING_MUTABLE_RESOURCES, | ||
| const std::string & | strResourcesOutputDirectory = ADTF_TESTING_BUILD_DIR ) |
Constructs a test system.
| [in] | strUrl | If set the RPC object registry will be created and listen at the given URL. |
| [in] | strAdtfDirectory | The ADTF root directory. The default is a macro that can be set by the test environment. |
| [in] | strPluginDirectories | A ';' separated list of plugin directories. The default is a macro that can be set by the test environment. |
| [in] | strResources | A ';' separated list of mutable test resources. Can be directories and/or files. The listed inputs will be copied to strResourcesOutputDirectory. |
| [in] | strResourcesOutputDirectory | The root directory where the listed inputs from strResources will be copied to. A unique folder name will be attached to the path. Mind that this unique folder is temporary! |
| adtf::system::testing::giant::cSessionTestSystem::cSessionTestSystem | ( | const std::string & | strUrl, |
| bool | bCreateLoggingService, | ||
| const std::string & | strAdtfDirectory = ADTF_TESTING_ADTF_DIR, | ||
| const std::string & | strPluginDirectories = ADTF_TESTING_PLUGIN_DIRECTORIES, | ||
| const std::string & | strResources = ADTF_TESTING_MUTABLE_RESOURCES, | ||
| const std::string & | strResourcesOutputDirectory = ADTF_TESTING_BUILD_DIR ) |
Constructs a test system.
| [in] | strUrl | If set the RPC object registry will be created and listen at the given URL. |
| [in] | bCreateLoggingService | Whether or not to create a logging service. |
| [in] | strAdtfDirectory | The ADTF root directory. The default is a macro that can be set by the test environment. |
| [in] | strPluginDirectories | A ';' separated list of plugin directories. The default is a macro that can be set by the test environment. |
| [in] | strResources | A ';' separated list of mutable test resources. Can be directories and/or files. The listed inputs will be copied to strResourcesOutputDirectory. |
| [in] | strResourcesOutputDirectory | The root directory where the listed inputs from strResources will be copied to. A unique folder name will be attached to the path. Mind that this unique folder is temporary! |
| void adtf::system::testing::giant::cSessionTestSystem::CreateSession | ( | const std::string & | strFileName | ) |
Load and create a session.
This will create the services. The filter graph is created when you change the runlevel to RL_FilterGraph.
| [in] | strFileName | The path to the .adtfsession file. |
| tResult | if an error occurred. |
| void adtf::system::testing::giant::cSessionTestSystem::Exec | ( | int8_t | nInitialRunlevel, |
| int8_t | nAutoQuitLevel, | ||
| std::function< void()> | fnStartup ) |
Executes a session and call the a callback function when ready.
| [in] | nInitialRunlevel | Change to this runlevel before the callback is called. |
| [in] | nAutoQuitLevel | Execution is stopped when the given runlevel is left by decrementing. |
| [in] | fnStartup | This callback will be called once the session is ready. |
| tResult | if an error occurred. |
| void adtf::system::testing::giant::cSessionTestSystem::Exec | ( | int8_t | nInitialRunlevel, |
| std::function< void()> | fnStartup ) |
Executes a session and call the a callback function when ready.
| [in] | nInitialRunlevel | Change to this runlevel before the callback is called. |
| [in] | fnStartup | This callback will be called once the session is ready. |
| tResult | if an error occurred. |
| void adtf::system::testing::giant::cSessionTestSystem::Exec | ( | std::chrono::microseconds | tmTimeout | ) |
Executes a session for a given amount of time. This will look for an IApplication implementation and call its IApplication::Execute() and quit when the timeout is reached. If there is no IApplication, then the runlevel will be set to RL_Running and shutdown after the timeout.
| [in] | tmTimeout | The amount of time the session should be executed. |
| tResult | if an error occurred. |
| void adtf::system::testing::giant::cSessionTestSystem::ExecTest | ( | int8_t | nInitialRunlevel, |
| std::function< void()> | fnTest ) |
Execute a session, call a test function and shutdown the session afterwards.
| [in] | nInitialRunlevel | Change to this runlevel before the callback is called. |
| [in] | fnTest | The test callback function. |
| tResult | if an error occurred (i.e. an exception was thrown). |
| ucom::ant::object_ptr< streaming::ant::IFilterGraph > adtf::system::testing::giant::cSessionTestSystem::GetFilterGraph | ( | ) |
| ucom::ant::object_ptr< streaming::ant::INamedGraphObject > adtf::system::testing::giant::cSessionTestSystem::GetGraphObject | ( | const std::string & | name | ) |
Retrieve a graph object from the streaming/filter graph.
| [in] | name | The full name of the object to retrieve. |
| tResult | if an error occurred. |
| ucom::ant::object_ptr< services::ISession > adtf::system::testing::giant::cSessionTestSystem::GetSession | ( | ) |
| ucom::ant::object_ptr< streaming::ant::IStreamingGraph > adtf::system::testing::giant::cSessionTestSystem::GetStreamingGraph | ( | ) |
| void adtf::system::testing::giant::cSessionTestSystem::SetEnvironmentFile | ( | const std::string & | strFileName, |
| bool | bPluginDiscovery = true ) |
Set the adtfenvironment.
This will set the adtfenvironment of the test system. It must be called before CreateSession()
| [in] | strFileName | The path to the .adtfenvironment file. |
| [in] | bPluginDiscovery | Whether or not all available plugin descriptions from the environment should be loaded and used for the automatic lookup and loading of required plugins when creating class instances. Will also enable the loading of all available adtf_file plugins during session creation. |
| tResult | if an error occurred. |