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 <unotest/filters-test.hxx>
11 : #include <test/bootstrapfixture.hxx>
12 : #include <com/sun/star/document/XFilter.hpp>
13 :
14 : #include <osl/file.hxx>
15 : #include <osl/process.h>
16 : #include <osl/thread.h>
17 :
18 : using namespace ::com::sun::star;
19 :
20 : namespace
21 : {
22 3 : class HwpFilterTest
23 : : public test::FiltersTest
24 : , public test::BootstrapFixture
25 : {
26 : public:
27 : virtual void setUp() SAL_OVERRIDE;
28 :
29 : virtual bool load(const OUString &,
30 : const OUString &rURL, const OUString &,
31 : unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;
32 :
33 : void test();
34 :
35 2 : CPPUNIT_TEST_SUITE(HwpFilterTest);
36 1 : CPPUNIT_TEST(test);
37 2 : CPPUNIT_TEST_SUITE_END();
38 : private:
39 : uno::Reference<document::XFilter> m_xFilter;
40 : };
41 :
42 1 : void HwpFilterTest::setUp()
43 : {
44 1 : test::BootstrapFixture::setUp();
45 :
46 3 : m_xFilter = uno::Reference< document::XFilter >(m_xSFactory->createInstance(
47 : OUString(
48 1 : "com.sun.comp.hwpimport.HwpImportFilter")),
49 1 : uno::UNO_QUERY_THROW);
50 1 : }
51 :
52 2 : bool HwpFilterTest::load(const OUString &,
53 : const OUString &rURL, const OUString &,
54 : unsigned int, unsigned int, unsigned int)
55 : {
56 2 : uno::Sequence< beans::PropertyValue > aDescriptor(1);
57 2 : aDescriptor[0].Name = "URL";
58 2 : aDescriptor[0].Value <<= rURL;
59 2 : return m_xFilter->filter(aDescriptor);
60 : }
61 :
62 1 : void HwpFilterTest::test()
63 : {
64 : testDir(OUString(),
65 : getURLFromSrc("/hwpfilter/qa/cppunit/data/"),
66 1 : OUString());
67 1 : }
68 :
69 1 : CPPUNIT_TEST_SUITE_REGISTRATION(HwpFilterTest);
70 : }
71 :
72 4 : CPPUNIT_PLUGIN_IMPLEMENT();
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|