Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #include <comphelper/processfactory.hxx>
11 : #include <unotest/filters-test.hxx>
12 : #include <unotest/bootstrapfixturebase.hxx>
13 : #include "com/sun/star/packages/zip/ZipFileAccess.hpp"
14 :
15 : using namespace ::com::sun::star;
16 :
17 : namespace
18 : {
19 4 : class PackageTest
20 : : public test::FiltersTest
21 : , public test::BootstrapFixtureBase
22 : {
23 : public:
24 2 : PackageTest() {}
25 :
26 : virtual bool load(const OUString &,
27 : const OUString &rURL, const OUString &,
28 : unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;
29 :
30 : void test();
31 :
32 4 : CPPUNIT_TEST_SUITE(PackageTest);
33 2 : CPPUNIT_TEST(test);
34 4 : CPPUNIT_TEST_SUITE_END();
35 : };
36 :
37 2 : bool PackageTest::load(const OUString &,
38 : const OUString &rURL, const OUString &,
39 : unsigned int, unsigned int, unsigned int)
40 : {
41 : try
42 : {
43 : uno::Reference<css::packages::zip::XZipFileAccess2> xZip(
44 4 : css::packages::zip::ZipFileAccess::createWithURL(comphelper::getProcessComponentContext(), rURL));
45 0 : return xZip.is();
46 : }
47 4 : catch(...)
48 : {
49 2 : return false;
50 : }
51 : }
52 :
53 2 : void PackageTest::test()
54 : {
55 : testDir(OUString(),
56 : getURLFromSrc("/package/qa/cppunit/data/"),
57 2 : OUString());
58 2 : }
59 :
60 2 : CPPUNIT_TEST_SUITE_REGISTRATION(PackageTest);
61 : }
62 :
63 8 : CPPUNIT_PLUGIN_IMPLEMENT();
64 :
65 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|