Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added ConnectionObject interface, FakeConnection object and connection tests
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 29 Jul 2016 10:10:21 +0000 (11:10 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 29 Jul 2016 10:10:21 +0000 (11:10 +0100)
source/connobject/ConnectionObject.cpp [new file with mode: 0644]
source/connobject/ConnectionObject.h [new file with mode: 0644]
source/tests/classes/FakeConnectionObject.cpp [new file with mode: 0644]
source/tests/classes/FakeConnectionObject.h [new file with mode: 0644]
source/tests/xestiaab_carddav.cpp [moved from source/tests/xestiaab_carddav.h with 100% similarity]

diff --git a/source/connobject/ConnectionObject.cpp b/source/connobject/ConnectionObject.cpp
new file mode 100644 (file)
index 0000000..9e2e202
--- /dev/null
@@ -0,0 +1,35 @@
+// ConnectionObject.h - ConnectionObject interface
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#include "ConnectionObject.h"
+
+using namespace std;
+
+ConnectionObject::ConnectionObject(string ServerAddress, int ServerPort, string ServerUser, string ServerPass, bool ServerSSL) : 
+       ServerAddress(ServerAddress), ServerPort(ServerPort), ServerUser(ServerUser), ServerPass(ServerPass), ServerSSL(ServerSSL){
+
+       TestMode = true;
+       
+}
+
+ConnectionObject::ConnectionObject(string ServerAddress, int ServerPort, string ServerUser, string ServerPass, bool ServerSSL, string ServerPrefix, string ServerAccount) :
+       ServerAddress(ServerAddress), ServerPort(ServerPort), ServerUser(ServerUser), ServerPass(ServerPass), ServerSSL(ServerSSL), ServerPrefix(ServerPrefix), ServerAccount(ServerAccount){
+       
+       TestMode = false;
+       
+}
diff --git a/source/connobject/ConnectionObject.h b/source/connobject/ConnectionObject.h
new file mode 100644 (file)
index 0000000..c668814
--- /dev/null
@@ -0,0 +1,45 @@
+// ConnectionObject.h - ConnectionObject interface header file.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#include <string>
+
+class ConnectionObject{
+       
+       public:
+               ConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL);
+               ConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount);
+       
+               // Virtual functions to be setup by the inheriting classes.
+       
+               virtual void SetupConnectionObject() {};
+               virtual ~ConnectionObject() {};
+               
+       protected:
+               std::string ServerAddress = "";
+               unsigned int ServerPort = 8080;
+               std::string ServerUser = "";
+               std::string ServerPass = "";
+               std::string ServerPrefix = "";
+               std::string ServerAccount = "";
+               bool ServerSSL = true;
+               std::string ErrorMessage = "";
+               std::string ErrorBufferMessage = "";
+               bool TestMode = false;
+       private:
+
+};
\ No newline at end of file
diff --git a/source/tests/classes/FakeConnectionObject.cpp b/source/tests/classes/FakeConnectionObject.cpp
new file mode 100644 (file)
index 0000000..02a20dc
--- /dev/null
@@ -0,0 +1,51 @@
+// FakeConnectionObject.cpp - FakeConnectionObject class
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#include "FakeConnectionObject.h"
+
+std::string FakeConnectionObject::GetServerAddress(){
+       return ServerAddress;
+}
+
+unsigned int FakeConnectionObject::GetServerPort(){
+       return ServerPort;
+}
+
+std::string FakeConnectionObject::GetServerUser(){
+       return ServerUser;      
+}
+
+std::string FakeConnectionObject::GetServerPass(){
+       return ServerPass;
+}
+
+std::string FakeConnectionObject::GetServerPrefix(){
+       return ServerPrefix;
+}
+
+std::string FakeConnectionObject::GetServerAccount(){
+       return ServerAccount;
+}
+
+bool FakeConnectionObject::GetServerSSL(){
+       return ServerSSL;
+}
+
+bool FakeConnectionObject::GetTestMode(){
+       return TestMode;
+}
\ No newline at end of file
diff --git a/source/tests/classes/FakeConnectionObject.h b/source/tests/classes/FakeConnectionObject.h
new file mode 100644 (file)
index 0000000..02924f9
--- /dev/null
@@ -0,0 +1,44 @@
+// FakeConnectionObject.h - FakeConnectionObject class
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+#include "../../connobject/ConnectionObject.h"
+
+class FakeConnectionObject : public ConnectionObject {
+       
+       public:
+               
+               // Functions for fake connection object.
+       
+               using ConnectionObject::ConnectionObject;
+               std::string GetServerAddress();
+               unsigned int GetServerPort();
+               std::string GetServerUser();
+               std::string GetServerPass();
+               std::string GetServerPrefix();
+               std::string GetServerAccount();
+               bool GetServerSSL();
+               bool GetTestMode();
+       
+               // Variables to set for fake connection object.
+       
+               std::string ServerPrefixInput = "";
+       
+       protected:
+       private:
+       
+};
\ No newline at end of file
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