summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-19 07:44:51 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-01-26 06:41:12 +0000
commit1f9f1fe342ebe65db8f48a4c38c92acf74122966 (patch)
tree0a60ac55a1d91c21688cfc70279df3f65b0e8454 /ucb
parentc43fdd74097cb12f69f86fd1217dd2f41ccae101 (diff)
Add initial cppunit test to webdav, 'local' only, neon version
This is a 'local' test, meaning it can be done without a WebDAV server. It's the first one, so very trivial... Change-Id: Idf660c7482c86251be02536106f079ac6bdef4b4 Reviewed-on: https://gerrit.libreoffice.org/21658 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/CppunitTest_ucb_webdav_local_neon.mk55
-rw-r--r--ucb/Module_ucb.mk14
-rw-r--r--ucb/qa/cppunit/webdav/webdav_local_neon.cxx66
3 files changed, 135 insertions, 0 deletions
diff --git a/ucb/CppunitTest_ucb_webdav_local_neon.mk b/ucb/CppunitTest_ucb_webdav_local_neon.mk
new file mode 100644
index 000000000000..bb0ef420a241
--- /dev/null
+++ b/ucb/CppunitTest_ucb_webdav_local_neon.mk
@@ -0,0 +1,55 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,ucb_webdav_local))
+
+$(eval $(call gb_CppunitTest_use_api,ucb_webdav_local, \
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,ucb_webdav_local, \
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ salhelper \
+ test \
+ ucbhelper \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,ucb_webdav_local, \
+ ucpdav1 \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,ucb_webdav_local,\
+ boost_headers \
+ libxml2 \
+ neon \
+ openssl \
+))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,ucb_webdav_local,\
+ officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,ucb_webdav_local, \
+ ucb/qa/cppunit/webdav/webdav_local_neon \
+))
+
+$(eval $(call gb_CppunitTest_set_include,ucb_webdav_local,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/ucb/source/ucp/webdav-neon \
+))
+
+$(eval $(call gb_CppunitTest_use_static_libraries,ucb_webdav_local))
+
+# vim: set noet sw=4 ts=4:
diff --git a/ucb/Module_ucb.mk b/ucb/Module_ucb.mk
index 990161c95393..a69b9378f164 100644
--- a/ucb/Module_ucb.mk
+++ b/ucb/Module_ucb.mk
@@ -31,6 +31,20 @@ $(eval $(call gb_Module_add_targets,ucb,\
))
endif
+ifeq ($(WITH_WEBDAV),neon)
+
+$(eval $(call gb_Module_add_check_targets,ucb,\
+ CppunitTest_ucb_webdav_local_neon \
+))
+
+endif
+
+ifeq ($(WITH_WEBDAV),serf)
+
+## Placeholder for future serf local test implementation
+
+endif
+
$(eval $(call gb_Module_add_subsequentcheck_targets,ucb,\
JunitTest_ucb_complex \
JunitTest_ucb_unoapi \
diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
new file mode 100644
index 000000000000..d65e6f756de7
--- /dev/null
+++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/bootstrapfixture.hxx>
+#include <cppunit/plugin/TestPlugIn.h>
+#include "NeonUri.hxx"
+
+
+namespace
+{
+
+ class webdav_local_test: public test::BootstrapFixture
+ {
+
+ public:
+ webdav_local_test() : BootstrapFixture( true, true ) {}
+
+ // initialise your test code values here.
+ void setUp( ) override;
+
+ void tearDown( ) override;
+
+ void NeonUriTest();
+
+ // Change the following lines only, if you add, remove or rename
+ // member functions of the current class,
+ // because these macros are need by auto register mechanism.
+
+ CPPUNIT_TEST_SUITE( webdav_local_test );
+ CPPUNIT_TEST( NeonUriTest );
+ CPPUNIT_TEST_SUITE_END();
+ }; // class webdav_local_test
+
+ // initialise your test code values here.
+ void webdav_local_test::setUp()
+ {
+ }
+
+ void webdav_local_test::tearDown()
+ {
+ }
+
+ void webdav_local_test::NeonUriTest()
+ {
+ //try URL decomposition
+ OUString aURL( "http://user%40anothername@server.biz:8040/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" );
+ webdav_ucp::NeonUri aURI( aURL );
+ CPPUNIT_ASSERT_EQUAL( OUString( "http" ), aURI.GetScheme() );
+ CPPUNIT_ASSERT_EQUAL( OUString( "server.biz" ), aURI.GetHost() );
+ CPPUNIT_ASSERT_EQUAL( OUString( "user%40anothername" ), aURI.GetUserInfo() );
+ CPPUNIT_ASSERT_EQUAL( sal_Int32( 8040 ), aURI.GetPort() );
+ CPPUNIT_ASSERT_EQUAL( OUString( "/aService/asegment/nextsegment/check.this?test=true&link=http://anotherserver.com/%3Fcheck=theapplication%26os=linuxintel%26lang=en-US%26version=5.2.0" ), aURI.GetPath( ) );
+ }
+
+ CPPUNIT_TEST_SUITE_REGISTRATION( webdav_local_test );
+} // namespace rtl_random
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */