Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

O3DBIDatabaseTest.cpp

Go to the documentation of this file.
00001 
00012 #include "O3DBIDatabaseTest.h"
00013 
00014 // ----------------------------------------------------------------------------
00015 // Register the fixture into the 'registry'
00016 
00017 CPPUNIT_TEST_SUITE_REGISTRATION(O3DBIDatabaseTest);
00018 
00019 // ----------------------------------------------------------------------------
00020 // Test initialization and clean up
00021 
00022 void O3DBIDatabaseTest::setUp()
00023 {
00024     _pDB = new O3DBIDatabase();
00025 }
00026 
00027 void O3DBIDatabaseTest::tearDown()
00028 {
00029     delete _pDB;
00030     _pDB = NULL;
00031 }
00032 
00033 // ----------------------------------------------------------------------------
00034 // Test cases
00035 
00036 void O3DBIDatabaseTest::TestConstructor1()
00037 {
00038     try
00039     {
00040         // Process
00041         O3DBIDatabase db;
00042     }
00043     catch (O3DBIException* pEx)
00044     {
00045         std::string str;
00046         str += "O3DBIException caught: ";
00047         str += pEx->GetErrorText();
00048         delete pEx;
00049         CPPUNIT_FAIL(str.c_str());
00050     }
00051 }
00052 
00053 void O3DBIDatabaseTest::TestConstructor2()
00054 {
00055     // Process
00056     O3DBIDatabase db("Scott", "Tiger", "oradb");    // should throw an exception!
00057 }
00058 
00059 void O3DBIDatabaseTest::TestIsConnected()
00060 {
00061     CPPUNIT_ASSERT(_pDB->IsConnected());
00062 }
00063 
00064 void O3DBIDatabaseTest::TestIsNotConnected()
00065 {
00066     CPPUNIT_ASSERT(! _pDB->IsConnected());
00067 }



SourceForge.net Logo Generated on Sun Jan 23 11:36:34 2005 for Oracle Object Oriented Database Interface (O3DBI) by  doxygen 1.3.9.1