Index: src/tests/CMakeLists.txt
===================================================================
--- src/tests/CMakeLists.txt	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
+++ src/tests/CMakeLists.txt	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
@@ -0,0 +1,60 @@
+######################
+#
+#    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+#
+#    This library is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU Lesser General Public
+#    License as published by the Free Software Foundation; either
+#    version 2.1 of the License, or (at your option) any later version.
+#
+#    This library 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
+#    Lesser General Public License for more details.
+#
+#    You should have received a copy of the GNU Lesser General Public
+#    License along with this library; if not, write to the Free Software
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+#    MA 02110-1301  USA.
+#
+######################
+
+INCLUDE_DIRECTORIES(
+	${CMAKE_CURRENT_BINARY_DIR}
+	${CMAKE_CURRENT_SOURCE_DIR}
+	${libsiweather_SOURCE_DIR}
+	${libsiweather_BINARY_DIR}
+	${libsiweather_testing_SOURCE_DIR}
+	${libsiweather_testing_BINARY_DIR}
+)
+ADD_DEFINITIONS(${QT_DEFINITIONS})
+
+#######################
+#
+# SiWeatherStation Test
+#
+#######################
+
+SET(test_CPP
+	siweatherstationtest.cpp
+)
+
+ADD_EXECUTABLE(testsiweatherstationtest ${test_CPP})
+TARGET_LINK_LIBRARIES(testsiweatherstationtest ${QT_LIBRARIES} libsiweather libsiweather_testing)
+qt5_use_modules(testsiweatherstationtest Core Test)
+ADD_TEST(TestSiWeatherStation ${EXECUTABLE_OUTPUT_PATH}/testsiweatherstationtest)
+
+#######################
+#
+# SiWebserviceClient Test
+#
+#######################
+
+SET(test_CPP
+	siwebserviceclienttest.cpp
+)
+
+ADD_EXECUTABLE(testsiwebserviceclient ${test_CPP})
+TARGET_LINK_LIBRARIES(testsiwebserviceclient ${QT_LIBRARIES} libsiweather libsiweather_testing)
+qt5_use_modules(testsiwebserviceclient Core Test)
+ADD_TEST(TestSiWebserviceClient ${EXECUTABLE_OUTPUT_PATH}/testsiwebserviceclient)
Index: src/tests/siweatherstationtest.cpp
===================================================================
--- src/tests/siweatherstationtest.cpp	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
+++ src/tests/siweatherstationtest.cpp	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
@@ -0,0 +1,96 @@
+/*
+    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+*/
+
+#include "siweatherstationtest.h"
+#include "moc_siweatherstationtest.cpp"
+
+#include <siweatherstation.h>
+
+#include <QTest>
+
+using namespace SiWeather::Library;
+
+void SiWeatherStationTest::setUuid()
+{
+	QUuid uuid = QUuid::createUuid();
+	SiWeatherStation station;
+	station.setUuid(uuid.toString());
+	QCOMPARE(station.uuid(), uuid);
+}
+
+void SiWeatherStationTest::setName()
+{
+	QString value = "Station Name";
+	SiWeatherStation station;
+	station.setName(value);
+	QCOMPARE(station.name(), value);
+}
+
+void SiWeatherStationTest::setCity(){
+	QString value = "Station Name";
+	SiWeatherStation station;
+	station.setCity(value);
+	QCOMPARE(station.city(), value);
+}
+
+void SiWeatherStationTest::setLongitude(){
+	double coordinate = 12.12345;
+	SiWeatherStation station;
+	station.setLatitude(coordinate);
+	QCOMPARE(station.latitude(), coordinate);
+}
+
+void SiWeatherStationTest::setLatitude(){
+	double coordinate = 12.12345;
+	SiWeatherStation station;
+	station.setLongitude(coordinate);
+	QCOMPARE(station.longitude(), coordinate);
+}
+
+void SiWeatherStationTest::setType(){
+	QString value = "Station Type";
+	SiWeatherStation station;
+	station.setType(value);
+	QCOMPARE(station.type(), value);
+}
+
+void SiWeatherStationTest::setTypeUrl(){
+	QUrl value("http://example.org");
+	SiWeatherStation station;
+	station.setTypeUrl(value.toString());
+	QCOMPARE(station.typeUrl(), value);
+}
+
+void SiWeatherStationTest::setEMail(){
+	QString value = "test@example.org";
+	SiWeatherStation station;
+	station.setEMail(value);
+	QCOMPARE(station.eMail(), value);
+}
+
+void SiWeatherStationTest::constructor()
+{
+	QUuid uuid = QUuid::createUuid();
+	QString name = "Station Name";
+	SiWeatherStation station(uuid.toString(), name);
+	QCOMPARE(station.uuid(), uuid);
+	QCOMPARE(station.name(), name);
+}
+
+QTEST_MAIN(SiWeatherStationTest)
Index: src/tests/siweatherstationtest.h
===================================================================
--- src/tests/siweatherstationtest.h	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
+++ src/tests/siweatherstationtest.h	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+*/
+
+#ifndef SIWEATHERSTATIONTEST_H
+#define SIWEATHERSTATIONTEST_H
+
+#include <QObject>
+
+class SiWeatherStationTest : public QObject
+{
+	Q_OBJECT
+	private slots:
+		void setUuid();
+		void setName();
+		void setCity();
+		void setLongitude();
+		void setLatitude();
+		void setType();
+		void setTypeUrl();
+		void setEMail();
+		void constructor();
+};
+
+#endif // SIWEATHERSTATIONTEST_H
Index: src/tests/siwebserviceclienttest.cpp
===================================================================
--- src/tests/siwebserviceclienttest.cpp	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
+++ src/tests/siwebserviceclienttest.cpp	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
@@ -0,0 +1,116 @@
+/*
+    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+*/
+
+#include "siwebserviceclient.h"
+#include "moc_siwebserviceclienttest.cpp"
+
+#include <siwebserviceclient.h>
+#include <siweatherstation.h>
+
+#include <webserverprocess.h>
+
+#include <QTest>
+#include <QSignalSpy>
+
+using namespace SiWeather::Library;
+
+void SiWebserviceClientTest::initTestCase()
+{
+	_webserverProcess = new WebserverProcess(this);
+	_webserverProcess->start();
+	QCOMPARE(_webserverProcess->waitForStart(), true);
+}
+
+void SiWebserviceClientTest::cleanUpTestCase()
+{
+	QVERIFY(_webserverProcess);
+// 	QCOMPARE(_webserverProcess->stop(), true);
+	_webserverProcess->stopThread();
+}
+
+void SiWebserviceClientTest::apiVersion()
+{
+	QVERIFY(_webserverProcess);
+	QCOMPARE(_webserverProcess->isRunning(), true);
+
+	SiWebserviceClient *client = new SiWebserviceClient(_webserverProcess->webserviceBaseUrl(), this);
+	QCOMPARE(client->apiVersion(), _webserverProcess->webserviceApiVersion());
+
+	delete client;
+}
+
+void SiWebserviceClientTest::stationsRegister()
+{
+	QVERIFY(_webserverProcess);
+	QCOMPARE(_webserverProcess->isRunning(), true);
+
+	SiWebserviceClient *client = new SiWebserviceClient(_webserverProcess->webserviceBaseUrl(), this);
+	QSignalSpy spyError(client, SIGNAL(error(SiWeather::Library::SiWebserviceClient::ReplyType, const QString&)));
+	QSignalSpy spyFinished(client, SIGNAL(finished(SiWeather::Library::SiWebserviceClient::ReplyType, bool, const QByteArray&)));
+	QSignalSpy spyFinishedStationsRegister(client, SIGNAL(finishedStationsRegister(bool, const QUuid&, const QString&)));
+	QString errorMessage;
+
+	SiWeatherStation station;
+	QCOMPARE(client->stationsRegister(station, errorMessage), SiWebserviceClient::Error);
+	QCOMPARE(errorMessage.isEmpty(), false);
+	QCOMPARE(spyError.count(), 0);
+	QCOMPARE(spyFinished.count(), 0);
+	QCOMPARE(spyFinishedStationsRegister.count(), 0);
+
+	spyError.clear();
+	spyFinished.clear();
+	spyFinishedStationsRegister.clear();
+	errorMessage.clear();
+	station.setName("Test Station Name");
+	station.setCity("New York");
+	station.setEMail("test@example.org");
+	station.setLatitude(40.712778);
+	station.setLongitude(-74.005833);
+	station.setType("Test Type");
+
+	QCOMPARE(client->stationsRegister(station, errorMessage), SiWebserviceClient::StationsRegister);
+	QTest::qWarn(errorMessage.toUtf8());
+	QCOMPARE(errorMessage.isEmpty(), true);
+
+	// use long timeout to allow webservice query for geolocation!
+	QTime dieTime = QTime::currentTime().addSecs(10);
+	while(QTime::currentTime() < dieTime){
+		QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 100);
+		if(spyError.count() != 0 || spyFinished.count() != 0)
+			break;
+	}
+
+	if(spyError.count() > 0){
+		QVariantList data = spyError.takeFirst();
+		QCOMPARE(data.count(), 2);
+		QWARN(data[1].toString().toUtf8());
+	}
+	QCOMPARE(spyError.count(), 0);
+	QCOMPARE(spyFinished.count(), 1);
+	QCOMPARE(spyFinishedStationsRegister.count(), 1);
+	QVariantList data = spyFinishedStationsRegister.takeFirst();
+	QCOMPARE(data.count(), 3);
+	QCOMPARE(data[0].toBool(), true);
+	QCOMPARE(data[1].toUuid().isNull(), false);
+	QCOMPARE(data[2].toString().isEmpty(), false);
+
+	delete client;
+}
+
+QTEST_MAIN(SiWebserviceClientTest)
Index: src/tests/siwebserviceclienttest.h
===================================================================
--- src/tests/siwebserviceclienttest.h	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
+++ src/tests/siwebserviceclienttest.h	(revision 915dc1852a6aa7d67755cb64c0cff72edbe7dd4c)
@@ -0,0 +1,41 @@
+/*
+    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301  USA.
+*/
+
+#ifndef SIWEBSERVICECLIENTTEST_H
+#define SIWEBSERVICECLIENTTEST_H
+
+#include <QObject>
+
+class WebserverProcess;
+
+class SiWebserviceClientTest : public QObject
+{
+	Q_OBJECT
+	private slots:
+		void initTestCase();
+		void cleanUpTestCase();
+		
+		void apiVersion();
+		void stationsRegister();
+		
+	private:
+		WebserverProcess *_webserverProcess;
+};
+
+#endif // SIWEBSERVICECLIENTTEST_H
