Branch libreoffice-5-0-4
[LibreOffice.git] / test / source / unoapi_test.cxx
blob7508f57a236d0b4d00a39f44ec8712dbc033e56a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include "test/unoapi_test.hxx"
12 #include <com/sun/star/util/XCloseable.hpp>
13 #include <com/sun/star/frame/Desktop.hpp>
14 #include <comphelper/processfactory.hxx>
16 using namespace css;
17 using namespace css::uno;
19 UnoApiTest::UnoApiTest(const OUString& path)
20 : m_aBaseString(path)
24 void UnoApiTest::setUp()
26 test::BootstrapFixture::setUp();
28 mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) );
29 CPPUNIT_ASSERT_MESSAGE("no desktop!", mxDesktop.is());
32 void UnoApiTest::tearDown()
34 test::BootstrapFixture::tearDown();
37 void UnoApiTest::createFileURL(const OUString& aFileBase, OUString& rFilePath)
39 rFilePath = getSrcRootURL() + m_aBaseString + "/" + aFileBase;
42 void UnoApiTest::closeDocument( uno::Reference< lang::XComponent > xDocument )
44 uno::Reference< util::XCloseable > xCloseable(xDocument, UNO_QUERY_THROW);
45 xCloseable->close(false);
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */