From 8c018651a0667ecdb0f9b31d2b0c53c646f990cd Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 1 Nov 2022 11:09:11 +0100 Subject: CppunitTest_lotuswordpro_import_test: inherit from UnoApiTest Change-Id: I6287ea3b0ed24a8dca002b95d59120ce302fc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142100 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- lotuswordpro/qa/cppunit/import_test.cxx | 48 +++++++++------------------------ 1 file changed, 12 insertions(+), 36 deletions(-) (limited to 'lotuswordpro/qa') diff --git a/lotuswordpro/qa/cppunit/import_test.cxx b/lotuswordpro/qa/cppunit/import_test.cxx index f691d778ecca..8fe223e4277f 100644 --- a/lotuswordpro/qa/cppunit/import_test.cxx +++ b/lotuswordpro/qa/cppunit/import_test.cxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include @@ -24,35 +23,15 @@ using namespace ::com::sun::star; -class LotusWordProTest : public test::BootstrapFixture, public unotest::MacrosTest +class LotusWordProTest : public UnoApiTest { public: - virtual void setUp() override; - - virtual void tearDown() override; - uno::Reference& getComponent() { return mxComponent; } - -private: - uno::Reference mxComponent; + LotusWordProTest() + : UnoApiTest("/lotuswordpro/qa/cppunit/data/") + { + } }; -void LotusWordProTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void LotusWordProTest::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - -constexpr OUStringLiteral DATA_DIRECTORY = u"/lotuswordpro/qa/cppunit/data/"; - CPPUNIT_TEST_FIXTURE(LotusWordProTest, testtdf33787OrderedBullets) { // Test if ordered bullets are incrementing correctly: @@ -65,9 +44,8 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, testtdf33787OrderedBullets) // 2) Numbered bullet w/ bracket two (2)) // a) Lettered bullet w/ bracket lowercase 1 (a)) // b) Lettered bullet w/ bracket lowercase 2 (b)) - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf33787-ordered-bullets.lwp"; - getComponent() = loadFromDesktop(aURL); - uno::Reference textDocument(getComponent(), uno::UNO_QUERY); + loadFromURL(u"tdf33787-ordered-bullets.lwp"); + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); @@ -157,9 +135,8 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, testtdf33787OrderedBullets) CPPUNIT_TEST_FIXTURE(LotusWordProTest, testTdf129993) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf129993.lwp"; - getComponent() = loadFromDesktop(aURL); - uno::Reference textDocument(getComponent(), uno::UNO_QUERY); + loadFromURL(u"tdf129993.lwp"); + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); @@ -172,9 +149,8 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, testTdf129993) CPPUNIT_TEST_FIXTURE(LotusWordProTest, paragraphProperties) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "paragraphProperties.lwp"; - getComponent() = loadFromDesktop(aURL); - uno::Reference textDocument(getComponent(), uno::UNO_QUERY); + loadFromURL(u"paragraphProperties.lwp"); + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); -- cgit