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/.
9 #ifndef INCLUDED_UNOUNOTEST_BOOTSTRAPFIXTUREBASE_HXX
10 #define INCLUDED_UNOUNOTEST_BOOTSTRAPFIXTUREBASE_HXX
12 #include <sal/config.h>
14 #include <rtl/string.hxx>
15 #include <com/sun/star/uno/XComponentContext.hpp>
16 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
17 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
19 #include "cppunit/TestAssert.h"
20 #include "cppunit/TestFixture.h"
21 #include "cppunit/extensions/HelperMacros.h"
22 #include "cppunit/plugin/TestPlugIn.h"
23 #include "unotest/detail/unotestdllapi.hxx"
27 // Class to do lots of heavy-lifting UNO & environment
28 // bootstrapping for unit tests, such that we can use
29 // almost an entire LibreOffice during compile - so
30 // that we can get pieces of code alone to beat them up.
32 // NB. this class is instantiated multiple times during a
33 // run of unit tests ...
34 class OOO_DLLPUBLIC_UNOTEST BootstrapFixtureBase
: public CppUnit::TestFixture
37 OUString m_aSrcRootURL
;
38 OUString m_aSrcRootPath
;
39 OUString m_aSolverRootURL
;
40 OUString m_aSolverRootPath
;
41 OUString m_aWorkdirRootURL
;
42 OUString m_aWorkdirRootPath
;
44 com::sun::star::uno::Reference
<com::sun::star::uno::XComponentContext
> m_xContext
;
45 com::sun::star::uno::Reference
<com::sun::star::lang::XMultiServiceFactory
> m_xSFactory
;
46 com::sun::star::uno::Reference
<com::sun::star::lang::XMultiComponentFactory
> m_xFactory
;
49 BootstrapFixtureBase();
50 virtual ~BootstrapFixtureBase();
52 com::sun::star::uno::Reference
<com::sun::star::uno::XComponentContext
>
53 getComponentContext() { return m_xContext
; }
54 com::sun::star::uno::Reference
<com::sun::star::lang::XMultiServiceFactory
>
55 getMultiServiceFactory() { return m_xSFactory
; }
57 OUString
getSrcRootURL() { return m_aSrcRootURL
; }
58 OUString
getSrcRootPath() { return m_aSrcRootPath
; }
60 // return a URL to a given c-str path from the source directory
61 OUString
getURLFromSrc( const char *pPath
);
63 // return a Path to a given c-str path from the source directory
64 OUString
getPathFromSrc( const char *pPath
);
67 // return a URL to a given c-str path from the workdir directory
68 OUString
getURLFromWorkdir( const char *pPath
);
70 // return a Path to a given c-str path from the workdir directory
71 OUString
getPathFromWorkdir( const char *pPath
);
73 virtual void tearDown();
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */