Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : : *
5 : : * The contents of this file are subject to the Mozilla Public License Version
6 : : * 1.1 (the "License"); you may not use this file except in compliance with
7 : : * the License or as specified alternatively below. You may obtain a copy of
8 : : * the License at http://www.mozilla.org/MPL/
9 : : *
10 : : * Software distributed under the License is distributed on an "AS IS" basis,
11 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : : * for the specific language governing rights and limitations under the
13 : : * License.
14 : : *
15 : : * Major Contributor(s):
16 : : * Copyright (C) 2011 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
17 : : * (initial developer)
18 : : *
19 : : * All Rights Reserved.
20 : : *
21 : : * For minor contributions see the git repository.
22 : : *
23 : : * Alternatively, the contents of this file may be used under the terms of
24 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
25 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
26 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
27 : : * instead of those above.
28 : : */
29 : :
30 : : #include <unotest/filters-test.hxx>
31 : : #include <test/bootstrapfixture.hxx>
32 : : #include <com/sun/star/document/XFilter.hpp>
33 : :
34 : : #include <osl/file.hxx>
35 : : #include <osl/process.h>
36 : :
37 : : using namespace ::com::sun::star;
38 : :
39 : : namespace
40 : : {
41 [ + - ][ - + ]: 6 : class LotusWordProTest
42 : : : public test::FiltersTest
43 : : , public test::BootstrapFixture
44 : : {
45 : : public:
46 [ + - ]: 3 : LotusWordProTest() : BootstrapFixture(true, false) {}
47 : :
48 : : virtual void setUp();
49 : :
50 : : virtual bool load(const rtl::OUString &,
51 : : const rtl::OUString &rURL, const rtl::OUString &);
52 : :
53 : : void test();
54 : :
55 [ + - ][ + - ]: 6 : CPPUNIT_TEST_SUITE(LotusWordProTest);
[ + - ][ + - ]
[ # # ]
56 [ + - ][ + - ]: 3 : CPPUNIT_TEST(test);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
57 [ + - ][ + - ]: 6 : CPPUNIT_TEST_SUITE_END();
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
58 : : private:
59 : : uno::Reference<document::XFilter> m_xFilter;
60 : : };
61 : :
62 : 3 : void LotusWordProTest::setUp()
63 : : {
64 : 3 : test::BootstrapFixture::setUp();
65 : :
66 : 3 : m_xFilter = uno::Reference< document::XFilter >(m_xSFactory->createInstance(
67 : : ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
68 : 3 : "com.sun.star.comp.Writer.LotusWordProImportFilter"))),
69 [ + - ][ + - ]: 3 : uno::UNO_QUERY_THROW);
[ + - ]
70 : 3 : }
71 : :
72 : 18 : bool LotusWordProTest::load(const rtl::OUString &,
73 : : const rtl::OUString &rURL, const rtl::OUString &)
74 : : {
75 [ + - ]: 18 : uno::Sequence< beans::PropertyValue > aDescriptor(1);
76 [ + - ][ + - ]: 18 : aDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
77 [ + - ][ + - ]: 18 : aDescriptor[0].Value <<= rURL;
78 [ + - ][ + - ]: 18 : return m_xFilter->filter(aDescriptor);
[ + - ]
79 : : }
80 : :
81 : 3 : void LotusWordProTest::test()
82 : : {
83 : : testDir(rtl::OUString(),
84 : : getURLFromSrc("/lotuswordpro/qa/cppunit/data/"),
85 [ + - ][ + - ]: 3 : rtl::OUString());
86 : 3 : }
87 : :
88 : 3 : CPPUNIT_TEST_SUITE_REGISTRATION(LotusWordProTest);
89 : : }
90 : :
91 [ + - ][ + - ]: 12 : CPPUNIT_PLUGIN_IMPLEMENT();
[ + - ][ + - ]
[ + - ][ # # ]
92 : :
93 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|