#include <TestBase.h>
Public Member Functions | |
virtual void | run ()=0 |
virtual void | run ()=0 |
void | setVerbosityLevel (coral::MsgLevel level) |
void | setVerbosityLevel (coral::MsgLevel level) |
TestBase () | |
TestBase () | |
virtual | ~TestBase () |
virtual | ~TestBase () |
Protected Member Functions | |
coral::ISession * | connect (const std::string &connectionString, const std::string &user, const std::string &password) |
coral::ISession * | connect (const std::string &connectionString, const std::string &user, const std::string &password) |
Private Attributes | |
coral::IConnection * | m_connection |
Definition at line 21 of file TestBase.h.
TestBase::TestBase | ( | ) |
Definition at line 10 of file TestBase.cc.
: m_connection( 0 ) { coral::Context& context = coral::Context::instance(); context.loadComponent( "CORAL/RelationalPlugins/oracle" ); coral::IHandle<coral::IRelationalDomain> domain = context.query<coral::IRelationalDomain>( "CORAL/RelationalPlugins/oracle" ); if ( ! domain.isValid() ) throw std::runtime_error( "Could not load the OracleAccess plugin" ); }
TestBase::~TestBase | ( | ) | [virtual] |
Definition at line 19 of file TestBase.cc.
References m_connection.
{ if ( m_connection ) delete m_connection; }
TestBase::TestBase | ( | ) |
virtual TestBase::~TestBase | ( | ) | [virtual] |
coral::ISession * TestBase::connect | ( | const std::string & | connectionString, |
const std::string & | user, | ||
const std::string & | password | ||
) | [protected] |
Definition at line 24 of file TestBase.cc.
References m_connection, and python::CommonUtils::session.
Referenced by L1TriggerScalerRead::dropTable(), RunSummaryRead::readData(), RunInfoRead::readData(), L1TriggerScalerRead::readData(), and DQMSummaryReader::readData().
{ coral::Context& ctx = coral::Context::instance(); coral::IHandle<coral::IRelationalDomain> iHandle=ctx.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle"); if ( ! iHandle.isValid() ) throw std::runtime_error( "Could not load the OracleAccess plugin" ); std::pair<std::string, std::string> connectionAndSchema = iHandle->decodeUserConnectionString( connectionString ); if ( ! m_connection ) m_connection = iHandle->newConnection( connectionAndSchema.first ); if ( ! m_connection->isConnected() ) m_connection->connect(); coral::ISession* session = m_connection->newSession( connectionAndSchema.second ); if ( session ) session->startUserSession( user, pass ); return session; }
coral::ISession* TestBase::connect | ( | const std::string & | connectionString, |
const std::string & | user, | ||
const std::string & | password | ||
) | [protected] |
virtual void TestBase::run | ( | ) | [pure virtual] |
Implemented in DQMSummaryReader, L1TriggerScalerRead, RunInfoRead, and RunSummaryRead.
virtual void TestBase::run | ( | ) | [pure virtual] |
Implemented in DQMSummaryReader, L1TriggerScalerRead, RunInfoRead, and RunSummaryRead.
void TestBase::setVerbosityLevel | ( | coral::MsgLevel | level | ) |
Definition at line 47 of file TestBase.cc.
{ coral::MessageStream::setMsgVerbosity(level); }
void TestBase::setVerbosityLevel | ( | coral::MsgLevel | level | ) |
coral::IConnection * TestBase::m_connection [private] |
Definition at line 33 of file TestBase.h.
Referenced by connect(), and ~TestBase().