diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-01-19 07:44:51 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-01-26 06:41:12 +0000 |
commit | 1f9f1fe342ebe65db8f48a4c38c92acf74122966 (patch) | |
tree | 0a60ac55a1d91c21688cfc70279df3f65b0e8454 /ucb/qa | |
parent | c43fdd74097cb12f69f86fd1217dd2f41ccae101 (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/qa')
-rw-r--r-- | ucb/qa/cppunit/webdav/webdav_local_neon.cxx | 66 |
1 files changed, 66 insertions, 0 deletions
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: */ |