Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Member Functions | Private Attributes
LoggerTest Class Reference
Collaboration diagram for LoggerTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void setUp ()
void tearDown ()
void TestLoggerINFO ()
void TestLoggerVERBOSE ()

Private Member Functions

 CPPUNIT_TEST_SUITE (LoggerTest)
 CPPUNIT_TEST (TestLoggerINFO)
 CPPUNIT_TEST (TestLoggerVERBOSE)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

std::stringstream stream
Arc::LogStreamoutput
Arc::Loggerlogger

Detailed Description

Definition at line 9 of file LoggerTest.cpp.


Member Function Documentation

Definition at line 31 of file LoggerTest.cpp.

Here is the call graph for this function:

Definition at line 37 of file LoggerTest.cpp.

Here is the call graph for this function:

Definition at line 43 of file LoggerTest.cpp.

                                {
  std::string res;
  logger->msg(Arc::VERBOSE, "This VERBOSE message should not be seen");
  res = stream.str();
  CPPUNIT_ASSERT(res.empty());

  logger->msg(Arc::INFO, "This INFO message should be seen");
  res = stream.str();
  res = res.substr(res.rfind(']') + 2);
  CPPUNIT_ASSERT_EQUAL(res, std::string("This INFO message should be seen\n"));
  stream.str("");
}

Here is the call graph for this function:

Definition at line 57 of file LoggerTest.cpp.

                                   {
  std::string res;
  logger->setThreshold(Arc::VERBOSE);
  logger->msg(Arc::VERBOSE, "This VERBOSE message should now be seen");
  res = stream.str();
  res = res.substr(res.rfind(']') + 2);
  CPPUNIT_ASSERT_EQUAL(res, std::string("This VERBOSE message should now be seen\n"));
  stream.str("");

  logger->msg(Arc::INFO, "This INFO message should also be seen");
  res = stream.str();
  res = res.substr(res.rfind(']') + 2);
  CPPUNIT_ASSERT_EQUAL(res, std::string("This INFO message should also be seen\n"));
  stream.str("");
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 27 of file LoggerTest.cpp.

Definition at line 26 of file LoggerTest.cpp.

std::stringstream LoggerTest::stream [private]

Definition at line 25 of file LoggerTest.cpp.


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