Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replace old build system with CMake build system
[xestiaab/.git] / source / tests / classes / FakeConnectionObject.h
1 // FakeConnectionObject.h - FakeConnectionObject class
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
18  
19 #ifndef __CONNOBJECT_FAKECONNECTIONOBJECT_H__
20 #define __CONNOBJECT_FAKECONNECTIONOBJECT_H__
21  
22 #include "../../connobject/ConnectionObject.h"
24 class FakeConnectionObject : public ConnectionObject {
25         
26         public:
27         
28                 //using ConnectionObject::ConnectionObject;
29         
30                 FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL);
31                 FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount);
33                 // Destructor.
34         
35                 ~FakeConnectionObject();
36         
37                 // Functions for fake connection object.
38         
39                 std::string GetServerAddress();
40                 unsigned int GetServerPort();
41                 std::string GetServerUser();
42                 std::string GetServerPass();
43                 std::string GetServerPrefix();
44                 std::string GetServerAccount();
45                 bool GetServerSSL();
46                 bool GetTestMode();
47         
48                 // Functions from the ConnectionObject interface.
49         
50         void SetupConnectionObject();
51         void BypassSSLVerification(bool EnableBypass);
52         COServerResponse GetDefaultPrefix(std::string *ServerPrefix);
53         COServerResponse GetContact(std::string Location, std::string *PageData);
54         std::string GetErrorMessage();
55         SSLCertCollectionString BuildSSLCollection();
56                 COConnectResult Connect(bool DoAuthentication);
57                 std::string GetDefaultPrefix();
58                 COServerResponse AddContact(std::string Location, std::string Data);
59                 COServerResponse EditContact(std::string Location, std::string Data);
60                 COServerResponse DeleteContact(std::string Location);
61                 COServerResponse GetServerEntityTagValue(std::string Location);
62                 COServerResponse GetContact(std::string Location);
63                 COContactList GetContactList(std::string SyncToken);
64                 
65                 bool IsTaskCompleted();
66                 void SetupData(std::string Method, std::string Location, std::string Data);
67         
68                 bool CanDoProcessing();
69                 bool CanDoSSL();
70                 COSSLVerified SSLVerify();
71                 bool AbleToLogin();
72                 bool HasValidResponse();
73                 bool IsSelfSigned();
74         
75                 // Variables to set for fake connection object.
76         
77                 std::string ResultServerPrefix = "";
78                 COConnectResult ResultStatus = COCONNECT_UNITTESTFAIL;
79                 bool ResultAuthPassed = false;
80                 bool ResultCanProcess = false;
81                 bool ResultSSLStatus = false;
82                 COSSLVerified ResultSSLVerified = COSSL_NORESULT;
83                 bool ResultValidResponse = false;
84                 bool ResultSelfSigned = false;
85                 bool ResultTaskCompleted = false;
86                 CORequestResult TestRequestResult;
87                 COContactList TestContactList;
88                 std::string TestEntityTag = "";
89                 int TestSessionCode = 0;
90                 int TestResultCode = 0;
91                 std::string TestResultMessage = "";
92                 bool ResultTestMode = false;
93         
94         protected:
95         private:
96         
97 };
99 #endif
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy