1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <cppunit/TestFixture.h>
11 #include <cppunit/extensions/HelperMacros.h>
12 #include <cppunit/plugin/TestPlugIn.h>
13 #include <NeonUri.hxx>
15 using namespace webdav_ucp
;
20 class webdav_local_test
: public CppUnit::TestFixture
26 // Change the following lines only, if you add, remove or rename
27 // member functions of the current class,
28 // because these macros are need by auto register mechanism.
30 CPPUNIT_TEST_SUITE( webdav_local_test
);
31 CPPUNIT_TEST( NeonUriTest
);
32 CPPUNIT_TEST_SUITE_END();
33 }; // class webdav_local_test
35 void webdav_local_test::NeonUriTest()
37 //try URL decomposition
38 NeonUri
aURI( "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" );
39 CPPUNIT_ASSERT_EQUAL( OUString( "http" ), aURI
.GetScheme() );
40 CPPUNIT_ASSERT_EQUAL( OUString( "server.biz" ), aURI
.GetHost() );
41 CPPUNIT_ASSERT_EQUAL( OUString( "user%40anothername" ), aURI
.GetUserInfo() );
42 CPPUNIT_ASSERT_EQUAL( sal_Int32( 8040 ), aURI
.GetPort() );
43 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( ) );
46 CPPUNIT_TEST_SUITE_REGISTRATION( webdav_local_test
);
47 } // namespace rtl_random
49 CPPUNIT_PLUGIN_IMPLEMENT();
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */