Robot Raconteur Companion C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::Companion::Util::IntraTestFixture Class Reference

A test fixture for intra-process testing using Robot Raconteur. More...

#include <TestFixtures.h>

Public Member Functions

 IntraTestFixture ()
 Construct a new IntraTestFixture object.
template<typename T>
void RegisterServiceType ()
 Register a service type to the client and server nodes.
RobotRaconteur::ServerContextPtr RegisterService (const std::string &name, const std::string &type, const boost::shared_ptr< RRObject > &obj) const
 Register a service to the server node.
boost::shared_ptr< RRObject > ConnectService (const std::string &url) const
 Connect to a service on the server node.
void Shutdown ()
 Shutdown the client and server nodes.

Public Attributes

boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > client_node
 The client node.
boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > server_node
 The server node.
boost::shared_ptr< RobotRaconteur::IntraTransport > client_transport
 The client transport.
boost::shared_ptr< RobotRaconteur::IntraTransport > server_transport
 The server transport.

Detailed Description

A test fixture for intra-process testing using Robot Raconteur.

The IntraTestFixture class provides a convenient way to set up and tear down the necessary components for intra-process testing using Robot Raconteur. It initializes client and server nodes, registers transport, service types, and provides methods to register services and connect to services.

To use this test fixture, create an instance of IntraTestFixture in your test and call the necessary methods to set up the test environment. The fixture will automatically clean up the resources when it goes out of scope.

Constructor & Destructor Documentation

◆ IntraTestFixture()

RobotRaconteur::Companion::Util::IntraTestFixture::IntraTestFixture ( )
inline

Construct a new IntraTestFixture object.

The constructor initializes the client and server nodes, registers the intra-process transport, and starts the transport.

Member Function Documentation

◆ ConnectService()

boost::shared_ptr< RRObject > RobotRaconteur::Companion::Util::IntraTestFixture::ConnectService ( const std::string & url) const
inline

Connect to a service on the server node.

Parameters
urlThe URL of the service
Returns
RR_SHARED_PTR<RRObject>

◆ RegisterService()

RobotRaconteur::ServerContextPtr RobotRaconteur::Companion::Util::IntraTestFixture::RegisterService ( const std::string & name,
const std::string & type,
const boost::shared_ptr< RRObject > & obj ) const
inline

Register a service to the server node.

Parameters
nameThe name of the service
typeThe service type
objThe service object

◆ RegisterServiceType()

template<typename T>
void RobotRaconteur::Companion::Util::IntraTestFixture::RegisterServiceType ( )
inline

Register a service type to the client and server nodes.

This method registers a service type to the client and server nodes.

Template Parameters
TThe service type to register

◆ Shutdown()

void RobotRaconteur::Companion::Util::IntraTestFixture::Shutdown ( )
inline

Shutdown the client and server nodes.

This method shuts down the client and server nodes and stops the transport. Shutdown is also automatically called when the fixture goes out of scope.


The documentation for this class was generated from the following file: