hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DataBaseSessionTest.h
Go to the documentation of this file.
1 #ifndef DATA_BASE_SESSION_TEST
2 #define DATA_BASE_SESSION_TEST
3 
4 #include <gtest/gtest.h>
5 #include <DBSession.h>
6 #include <Poco/SharedPtr.h>
7 #include <vector>
8 #include <Poco/Tuple.h>
9 #include <Poco/Data/MySQL/MySQLException.h>
10 #include <Poco/Data/Session.h>
11 #include <Application.h>
12 #include <TypeHandler.h>
13 
14 using namespace Poco::Data;
15 
16 class DataBaseSessionTest : public ::testing::Test {
17 public:
18  DataBaseSessionTest ():_pSession(0) {}
20 protected:
21  typedef Poco::Tuple<int,std::string> person;
22  typedef Poco::Tuple<std::string> person_name;
23  std::vector<person_name> namesOfPersons;
24  std::vector<person> people;
25  std::vector<Object> objects;
26  Poco::SharedPtr<HCE::database::DBSession> _pSession;
27 public:
28  virtual void setConnection (const std::string& key,const std::string& parameters);
29  virtual void closeConnection ();
30  virtual bool isConnected () ;
31 public:
32  virtual void countDataInDataBase (int& count);
33 public:
34  virtual void insertObjectInDataBase();
35  virtual void selectObjectFromDataBase ();
36 public:
37  virtual void insertTupleInDataBase ();
38  virtual void selectAllTuplesDataFromDataBase ();
39  virtual void selectTupleDataFromDataBase ();
40  virtual void selectOneFieldFormDataBaseInTuple ();
41 public:
42  virtual void createDataBase ();
43  virtual void dropDataBase ();
44  virtual void clearDataBase ();
45 public:
46  void clearVector () throw();
47  virtual void SetUp();
48  virtual void TearDown ();
49 };
50 
51 #endif
52