office-gobmx/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx

74 lines
2 KiB
C++
Raw Normal View History

2011-04-11 15:35:58 -05:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
2011-04-11 15:35:58 -05:00
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
2011-04-11 15:35:58 -05:00
*/
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
2011-04-11 15:35:58 -05:00
#include <com/sun/star/document/XFilter.hpp>
#include <osl/file.hxx>
#include <osl/process.h>
using namespace ::com::sun::star;
namespace
{
class LotusWordProTest
: public test::FiltersTest
, public test::BootstrapFixture
2011-04-11 15:35:58 -05:00
{
public:
LotusWordProTest() : BootstrapFixture(true, false) {}
virtual void setUp() override;
2011-04-11 15:35:58 -05:00
virtual bool load(const OUString &,
const OUString &rURL, const OUString &,
SfxFilterFlags, SotClipboardFormatId, unsigned int) override;
2011-04-11 15:35:58 -05:00
void test();
CPPUNIT_TEST_SUITE(LotusWordProTest);
CPPUNIT_TEST(test);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<document::XFilter> m_xFilter;
};
void LotusWordProTest::setUp()
2011-04-11 15:35:58 -05:00
{
test::BootstrapFixture::setUp();
m_xFilter.set(m_xSFactory->createInstance(
"com.sun.star.comp.Writer.LotusWordProImportFilter"),
2011-04-11 15:35:58 -05:00
uno::UNO_QUERY_THROW);
2011-04-27 03:31:31 -05:00
}
bool LotusWordProTest::load(const OUString &,
const OUString &rURL, const OUString &,
SfxFilterFlags, SotClipboardFormatId, unsigned int)
2011-04-11 15:35:58 -05:00
{
uno::Sequence< beans::PropertyValue > aDescriptor(1);
aDescriptor[0].Name = "URL";
2011-04-11 15:35:58 -05:00
aDescriptor[0].Value <<= rURL;
2011-09-30 06:39:08 -05:00
return m_xFilter->filter(aDescriptor);
2011-04-11 15:35:58 -05:00
}
void LotusWordProTest::test()
{
testDir(OUString(),
m_directories.getURLFromSrc("/lotuswordpro/qa/cppunit/data/"));
2011-04-11 15:35:58 -05:00
}
CPPUNIT_TEST_SUITE_REGISTRATION(LotusWordProTest);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */