[Libreoffice-commits] core.git: ucb/CppunitTest_ucb_webdav_local_neon.mk ucb/Module_ucb.mk ucb/qa

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Mon Jan 25 22:41:42 PST 2016


 ucb/CppunitTest_ucb_webdav_local_neon.mk    |   55 +++++++++++++++++++++++
 ucb/Module_ucb.mk                           |   14 +++++
 ucb/qa/cppunit/webdav/webdav_local_neon.cxx |   66 ++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+)

New commits:
commit 1f9f1fe342ebe65db8f48a4c38c92acf74122966
Author: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
Date:   Tue Jan 19 07:44:51 2016 +0100

    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 at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/ucb/CppunitTest_ucb_webdav_local_neon.mk b/ucb/CppunitTest_ucb_webdav_local_neon.mk
new file mode 100644
index 0000000..bb0ef42
--- /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 990161c..a69b937 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 0000000..d65e6f7
--- /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: */


More information about the Libreoffice-commits mailing list