RobotTestingFramework  2.0.1
Robot Testing Framework
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
robottestingframework::plugin::PythonPluginLoaderImpl Class Reference

The PythonPluginLoaderImpl loads a Pthyon test case plug-in and gives the direct access to the TestCase. More...

#include <robottestingframework/python/impl/PythonPluginLoader_impl.h>

+ Inheritance diagram for robottestingframework::plugin::PythonPluginLoaderImpl:

Public Member Functions

 PythonPluginLoaderImpl ()
 PythonPluginLoaderImpl constructor. More...
 
 ~PythonPluginLoaderImpl () override
 PythonPluginLoaderImpl destructor. More...
 
TestCaseopen (const std::string filename)
 open Loads a test case plugin More...
 
void close ()
 close Unloads the plugin and deletes any allocated memory. More...
 
std::string getLastError ()
 getLastError gets the last error if any. More...
 
std::string getFileName ()
 getFileName returns the loaded script file name More...
 
void setTestName (const std::string name)
 setTestName set the test case name More...
 
bool setup (int argc, char **argv) override
 setup is called before the test run. More...
 
void tearDown () override
 tearDown is called after the test run More...
 
void run () override
 run is called by the TestCase class if setup is successfull; More...
 
- Public Member Functions inherited from robottestingframework::TestCase
 TestCase (std::string name, std::string param="")
 TestCase constructor. More...
 
virtual ~TestCase ()
 TestCase destructor. More...
 
void interrupt () override
 interrupt interrupts the current test run More...
 
void run (TestResult &rsl) override
 the main caller of a TestCase inherited from Test Class. More...
 
bool succeeded () const override
 succeeded More...
 
void failed ()
 failed Sets the test successful flag to false which indicates that the test was not successful. More...
 
TestResultgetResult ()
 getResult Returns an instance of TestResult if run(TestResult &result) has been already called by a TestRunner More...
 
void setParam (const std::string param)
 setParam Sets the optional parameters of the test. More...
 
std::string getParam ()
 getParam gets the original paramter string which is set for the test case More...
 
void setEnvironment (const std::string environment)
 setEnvironment Optioanlly specifies the environment in which the test case is executed. More...
 
std::string getEnvironment ()
 getParam gets the environment string which is set for the test case More...
 
void setRepetition (unsigned int rep)
 setRepetition sets the run repetition by default the run() method is called only once; The number of test runs (e.g., for stress testing) can be set using this function. More...
 
unsigned int getRepetition ()
 getRepetition gets the tun repetition More...
 
- Public Member Functions inherited from robottestingframework::Test
 Test (std::string name, std::string description="")
 Test constructor. More...
 
virtual ~Test ()
 Test destructor. More...
 
const std::string getName () const
 getName Getting test name. More...
 
const std::string getDescription () const
 getDescription Getting test description More...
 
void setDescription (const std::string description)
 setDescription Sets an optional string which describes the test. More...
 

Static Public Member Functions

static PyObject * setName (PyObject *self, PyObject *args)
 
static PyObject * assertError (PyObject *self, PyObject *args)
 
static PyObject * assertFail (PyObject *self, PyObject *args)
 
static PyObject * testReport (PyObject *self, PyObject *args)
 
static PyObject * testCheck (PyObject *self, PyObject *args)
 

Private Member Functions

std::string getPythonErrorString ()
 

Private Attributes

std::string filename
 
std::string error
 
PyObject * pyName
 
PyObject * pyModule
 
PyObject * pyDict
 
PyObject * pyClass
 
PyObject * pyInstance
 
PyObject * pyModuleRobotTestingFramework
 
PyObject * pyCapsuleRobotTestingFramework
 

Static Private Attributes

static PyMethodDef testPythonMethods []
 

Additional Inherited Members

- Protected Member Functions inherited from robottestingframework::Test
void setName (std::string name)
 setName setting the test name More...
 

Detailed Description

The PythonPluginLoaderImpl loads a Pthyon test case plug-in and gives the direct access to the TestCase.

Definition at line 37 of file PythonPluginLoader_impl.h.

Constructor & Destructor Documentation

◆ PythonPluginLoaderImpl()

robottestingframework::plugin::PythonPluginLoaderImpl::PythonPluginLoaderImpl ( )

PythonPluginLoaderImpl constructor.

◆ ~PythonPluginLoaderImpl()

robottestingframework::plugin::PythonPluginLoaderImpl::~PythonPluginLoaderImpl ( )
override

Member Function Documentation

◆ assertError()

static PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::assertError ( PyObject *  self,
PyObject *  args 
)
static

◆ assertFail()

static PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::assertFail ( PyObject *  self,
PyObject *  args 
)
static

◆ close()

void robottestingframework::plugin::PythonPluginLoaderImpl::close ( )

close Unloads the plugin and deletes any allocated memory.

◆ getFileName()

std::string robottestingframework::plugin::PythonPluginLoaderImpl::getFileName ( )

getFileName returns the loaded script file name

Returns
the script file name

◆ getLastError()

std::string robottestingframework::plugin::PythonPluginLoaderImpl::getLastError ( )

getLastError gets the last error if any.

Returns
returns the last error string.

◆ getPythonErrorString()

std::string robottestingframework::plugin::PythonPluginLoaderImpl::getPythonErrorString ( )
private

◆ open()

TestCase* robottestingframework::plugin::PythonPluginLoaderImpl::open ( const std::string  filename)

open Loads a test case plugin

Parameters
filenamethe plugin filename
Returns
A pointer to the test case loaded from the plugin or a null pointer in case of failure.

◆ run()

void robottestingframework::plugin::PythonPluginLoaderImpl::run ( )
overridevirtual

run is called by the TestCase class if setup is successfull;

Implements robottestingframework::TestCase.

◆ setName()

static PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::setName ( PyObject *  self,
PyObject *  args 
)
static

◆ setTestName()

void robottestingframework::plugin::PythonPluginLoaderImpl::setTestName ( const std::string  name)

setTestName set the test case name

Parameters
namethe test case name

◆ setup()

bool robottestingframework::plugin::PythonPluginLoaderImpl::setup ( int  argc,
char **  argv 
)
overridevirtual

setup is called before the test run.

Note
the first value in argv is the name of the current testcases
Parameters
argcThe number of the pasred argument from string paramter
argvThe arguments which is parsed using string paramter
Returns
true or false depending of the test initialization

Reimplemented from robottestingframework::TestCase.

◆ tearDown()

void robottestingframework::plugin::PythonPluginLoaderImpl::tearDown ( )
overridevirtual

tearDown is called after the test run

Reimplemented from robottestingframework::TestCase.

◆ testCheck()

static PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::testCheck ( PyObject *  self,
PyObject *  args 
)
static

◆ testReport()

static PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::testReport ( PyObject *  self,
PyObject *  args 
)
static

Member Data Documentation

◆ error

std::string robottestingframework::plugin::PythonPluginLoaderImpl::error
private

Definition at line 100 of file PythonPluginLoader_impl.h.

◆ filename

std::string robottestingframework::plugin::PythonPluginLoaderImpl::filename
private

Definition at line 99 of file PythonPluginLoader_impl.h.

◆ pyCapsuleRobotTestingFramework

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyCapsuleRobotTestingFramework
private

Definition at line 108 of file PythonPluginLoader_impl.h.

◆ pyClass

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyClass
private

Definition at line 105 of file PythonPluginLoader_impl.h.

◆ pyDict

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyDict
private

Definition at line 104 of file PythonPluginLoader_impl.h.

◆ pyInstance

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyInstance
private

Definition at line 106 of file PythonPluginLoader_impl.h.

◆ pyModule

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyModule
private

Definition at line 103 of file PythonPluginLoader_impl.h.

◆ pyModuleRobotTestingFramework

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyModuleRobotTestingFramework
private

Definition at line 107 of file PythonPluginLoader_impl.h.

◆ pyName

PyObject* robottestingframework::plugin::PythonPluginLoaderImpl::pyName
private

Definition at line 102 of file PythonPluginLoader_impl.h.

◆ testPythonMethods

PyMethodDef robottestingframework::plugin::PythonPluginLoaderImpl::testPythonMethods[]
staticprivate

Definition at line 109 of file PythonPluginLoader_impl.h.


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