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 6 : 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 4 : CPPUNIT_TEST_SUITE(HwpFilterTest);
36 2 : CPPUNIT_TEST(test);
37 4 : CPPUNIT_TEST_SUITE_END();
38 : private:
39 : uno::Reference<document::XFilter> m_xFilter;
40 : };
41 :
42 2 : void HwpFilterTest::setUp()
43 : {
44 2 : test::BootstrapFixture::setUp();
45 :
46 6 : m_xFilter = uno::Reference< document::XFilter >(m_xSFactory->createInstance(
47 : OUString(
48 2 : "com.sun.comp.hwpimport.HwpImportFilter")),
49 2 : uno::UNO_QUERY_THROW);
50 2 : }
51 :
52 4 : bool HwpFilterTest::load(const OUString &,
53 : const OUString &rURL, const OUString &,
54 : unsigned int, unsigned int, unsigned int)
55 : {
56 4 : uno::Sequence< beans::PropertyValue > aDescriptor(1);
57 4 : aDescriptor[0].Name = "URL";
58 4 : aDescriptor[0].Value <<= rURL;
59 4 : return m_xFilter->filter(aDescriptor);
60 : }
61 :
62 2 : void HwpFilterTest::test()
63 : {
64 : testDir(OUString(),
65 : getURLFromSrc("/hwpfilter/qa/cppunit/data/"),
66 2 : OUString());
67 2 : }
68 :
69 2 : CPPUNIT_TEST_SUITE_REGISTRATION(HwpFilterTest);
70 : }
71 :
72 8 : CPPUNIT_PLUGIN_IMPLEMENT();
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|