CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
TestBase Class Referenceabstract

#include <TestBase.h>

Inheritance diagram for TestBase:
DQMSummaryReader L1TriggerScalerRead RunSummaryRead

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
 

Detailed Description

Definition at line 21 of file TestBase.h.

Constructor & Destructor Documentation

◆ TestBase() [1/2]

TestBase::TestBase ( )

Definition at line 9 of file TestBase.cc.

References visDQMUpload::context, and instance.

9  : m_connection(nullptr) {
10  coral::Context& context = coral::Context::instance();
11  context.loadComponent("CORAL/RelationalPlugins/oracle");
12  coral::IHandle<coral::IRelationalDomain> domain =
13  context.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
14  if (!domain.isValid())
15  throw std::runtime_error("Could not load the OracleAccess plugin");
16 }
static PFTauRenderPlugin instance
coral::IConnection * m_connection
Definition: TestBase.h:32

◆ ~TestBase() [1/2]

TestBase::~TestBase ( )
virtual

Definition at line 18 of file TestBase.cc.

References m_connection.

18  {
19  if (m_connection)
20  delete m_connection;
21 }
coral::IConnection * m_connection
Definition: TestBase.h:32

◆ TestBase() [2/2]

TestBase::TestBase ( )

◆ ~TestBase() [2/2]

virtual TestBase::~TestBase ( )
virtual

Member Function Documentation

◆ connect() [1/2]

coral::ISession * TestBase::connect ( const std::string &  connectionString,
const std::string &  user,
const std::string &  password 
)
protected

Definition at line 23 of file TestBase.cc.

References l1RCTOmdsFedVectorProducer_cfi::connectionString, instance, m_connection, and EnviromentSettings::user.

Referenced by L1TriggerScalerRead::dropTable(), DQMSummaryReader::readData(), RunSummaryRead::readData(), L1TriggerScalerRead::readData(), and o2o_db_cfgmap.DbManagerDAQ::update_hashmap().

25  {
26  coral::Context& ctx = coral::Context::instance();
27  coral::IHandle<coral::IRelationalDomain> iHandle =
28  ctx.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
29  if (!iHandle.isValid())
30  throw std::runtime_error("Could not load the OracleAccess plugin");
31 
32  std::pair<std::string, std::string> connectionAndSchema = iHandle->decodeUserConnectionString(connectionString);
33  if (!m_connection)
34  m_connection = iHandle->newConnection(connectionAndSchema.first);
35 
36  if (!m_connection->isConnected())
37  m_connection->connect();
38 
39  coral::ISession* session = m_connection->newSession(connectionAndSchema.second);
40  if (session)
41  session->startUserSession(user, pass);
42 
43  return session;
44 }
static PFTauRenderPlugin instance
coral::IConnection * m_connection
Definition: TestBase.h:32

◆ connect() [2/2]

coral::ISession* TestBase::connect ( const std::string &  connectionString,
const std::string &  user,
const std::string &  password 
)
protected

◆ run() [1/2]

virtual void TestBase::run ( )
pure virtual

◆ run() [2/2]

virtual void TestBase::run ( )
pure virtual

◆ setVerbosityLevel() [1/2]

void TestBase::setVerbosityLevel ( coral::MsgLevel  level)

Definition at line 46 of file TestBase.cc.

References personalPlayback::level.

46 { coral::MessageStream::setMsgVerbosity(level); }

◆ setVerbosityLevel() [2/2]

void TestBase::setVerbosityLevel ( coral::MsgLevel  level)

Member Data Documentation

◆ m_connection

coral::IConnection * TestBase::m_connection
private

Definition at line 32 of file TestBase.h.

Referenced by connect(), and ~TestBase().