Changeset 127
- Timestamp:
- 05/02/08 13:49:52 (8 months ago)
- Files:
-
- trunk/dba/config.bkl (modified) (1 diff)
- trunk/dba/dba.bkl (modified) (5 diffs)
- trunk/dba/dba/xmlarchive.cpp (modified) (1 diff)
- trunk/dba/dba/xmlarchive.h (modified) (2 diffs)
- trunk/dba/test/main.cpp (modified) (2 diffs)
- trunk/dba/test/xmltestcase.cpp (modified) (1 diff)
- trunk/dba/test/xmltestcase.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dba/config.bkl
r126 r127 11 11 <option name="ODBC_LIBS"/> 12 12 <option name="ODBC_CFLAGS"/> 13 <option name="xml2_LIBS"/> 14 <option name="xml2_CXXFLAGS"/> 13 15 </if> 14 16 trunk/dba/dba.bkl
r126 r127 92 92 </set> 93 93 94 <template id="dbabase"> 94 <template id="xml-lib"> 95 <if cond="FORMAT!='autoconf'"> 96 <if cond="TOOLSET=='win32'"> 97 <lib-path>"$(DOLLAR)($(ENV_VAR)LIBXML2)$(DIRSEP)lib"</lib-path> 98 <include>"$(DOLLAR)($(ENV_VAR)LIBXML2)$(DIRSEP)include"</include> 99 </if> 100 </if> 101 <if cond="FORMAT=='autoconf'"> 102 <cxxflags>$(xml2_CXXFLAGS)</cxxflags> 103 </if> 104 </template> 105 106 <template id="xml-exe" template="xml-lib"> 107 <if cond="FORMAT!='autoconf'"> 108 <if cond="TOOLSET=='win32'"> 109 <sys-lib>libxml2</sys-lib> 110 </if> 111 </if> 112 <if cond="FORMAT=='autoconf'"> 113 <ldlibs>$(xml2_LIBS)</ldlibs> 114 </if> 115 </template> 116 117 <template id="dbabase" template="xml-lib"> 95 118 <name>dba</name> 96 119 <sources>$(LIBSOURCES)</sources>--> … … 183 206 <set var="MSVC6PRJ_MERGED_TARGETS" append="1">dbacsv=dbacsv_static+dbacsv_dynamic</set> 184 207 185 <template id="dbaxml_base" >208 <template id="dbaxml_base" template="xml-lib"> 186 209 <name>dbaxml</name> 187 210 <include>$(LIBSRC)</include> … … 270 293 </set> 271 294 272 <lib id="dbatestlib" template="lib " template_append="cppunit" cond="TESTS=='1'">295 <lib id="dbatestlib" template="lib,xml-lib" template_append="cppunit" cond="TESTS=='1'"> 273 296 <sources>$(TESTLIB_SOURCES)</sources> 274 297 <msvc-headers>$(TESTLIB_HEADERS)</msvc-headers> … … 284 307 </lib> 285 308 286 <template id="dbaexe_base" >309 <template id="dbaexe_base" template="xml-exe"> 287 310 <app-type>console</app-type> 288 311 <include>$(SRCDIR)</include> … … 314 337 <library>libdba_static</library> 315 338 <library>dbacsv_static</library> 339 <library>dbaxml_static</library> 316 340 </exe> 317 341 trunk/dba/dba/xmlarchive.cpp
r126 r127 15 15 16 16 XMLArchive::XMLArchive() 17 : Archive() 17 : Archive(), 18 mDocument(NULL), 19 mRootNode(NULL) 18 20 { 19 21 } 20 22 23 void 24 XMLArchive::open(const char* pOpenStr) { 25 //TODO 26 }; 27 28 void 29 XMLArchive::open(xmlNodePtr pRoot) { 30 //TODO 31 }; 32 33 IStream* 34 XMLArchive::getInputStream() { 35 //TODO 36 }; 37 38 OStream* 39 XMLArchive::getOutputStream() { 40 //TODO 41 }; 21 42 22 43 XMLArchive::~XMLArchive() 23 44 { 45 xmlFreeDoc(mDocument); 24 46 } 25 47 trunk/dba/dba/xmlarchive.h
r126 r127 14 14 15 15 #include "archive.h" 16 #include <libxml/tree.h> 16 17 17 18 namespace dba { 19 20 class OStream; 21 class IStream; 18 22 19 23 /** … … 23 27 public: 24 28 XMLArchive(); 25 ~XMLArchive(); 29 virtual void open(const char* pOpenStr); 30 void open(xmlNodePtr pRoot); 31 virtual bool isOpen() const { return mRootNode != NULL; } 32 virtual IStream* getInputStream(); 33 virtual OStream* getOutputStream(); 34 virtual ~XMLArchive(); 35 private: 36 /** 37 pointer to xml document. NULL if archive is open in external document 38 */ 39 xmlDocPtr mDocument; 40 /** 41 pointer to xml node that is root of archive. If archive is open using connect string 42 then node points to root node of mDocument, otherwise node is set to 43 some node of external document 44 */ 45 xmlNodePtr mRootNode; 26 46 }; 27 47 trunk/dba/test/main.cpp
r126 r127 144 144 CppUnit::BriefTestProgressListener listener; 145 145 runner.eventManager().addListener(&listener); 146 runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );146 //runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); 147 147 //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::sqlError)); 148 148 //runner.addTest(new CppUnit::TestCaller<PostgresSQLArchiveTestCase>("debug_test",&PostgresSQLArchiveTestCase::sqlError)); … … 150 150 //runner.addTest(new CppUnit::TestCaller<dba_tests::CSVTestCase>("debug_test",&dba_tests::CSVTestCase::manual)); 151 151 //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::transactions_rollback)); 152 //runner.addTest(dba_tests::ConnectStringTestCase::suite());152 runner.addTest(dba_tests::XMLTestCase::suite()); 153 153 //runner.addTest(new CppUnit::TestCaller<OdbcPluginTestCase>("debug_test",&OdbcPluginTestCase::dbConnection)); 154 154 //runner.addTest(new CppUnit::TestCaller<PostgresSQLArchiveTestCase>("debug_test",&PostgresSQLArchiveTestCase::sqlError)); trunk/dba/test/xmltestcase.cpp
r126 r127 14 14 namespace dba_tests { 15 15 16 CPPUNIT_TEST_SUITE_REGISTRATION(XMLTestCase); 17 18 void 19 XMLTestCase::setUp() { 20 mArchive = new dba::XMLArchive; 21 }; 22 23 void 24 XMLTestCase::tearDown() { 25 delete mArchive; 26 mArchive = NULL; 27 }; 28 29 XMLTestCase::~XMLTestCase() { 30 delete mArchive; 31 }; 32 33 //tests 34 void 35 XMLTestCase::empty() { 36 //TODO 37 }; 38 16 39 } //namespace trunk/dba/test/xmltestcase.h
r126 r127 15 15 #include <cppunit/TestCase.h> 16 16 #include <cppunit/extensions/HelperMacros.h> 17 #include "dba/xmlarchive.h" 17 18 18 19 namespace dba_tests { … … 24 25 */ 25 26 class XMLTestCase : public CppUnit::TestCase { 27 CPPUNIT_TEST_SUITE(XMLTestCase); 28 CPPUNIT_TEST(empty); 29 CPPUNIT_TEST_SUITE_END(); 26 30 public: 27 31 virtual void setUp(); 32 virtual void tearDown(); 33 virtual ~XMLTestCase(); 34 35 //tests 36 void empty(); 37 private: 38 dba::XMLArchive* mArchive; 28 39 }; 29 40
