summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-01 11:09:11 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-01 12:33:55 +0100
commit8c018651a0667ecdb0f9b31d2b0c53c646f990cd (patch)
tree31e038d1ff56d8dd2a9effc6c56ce27c9e6419b8 /lotuswordpro
parent39ed6101c95368697bfaedf73f070129b24d03c9 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/CppunitTest_lotuswordpro_import_test.mk1
-rw-r--r--lotuswordpro/qa/cppunit/import_test.cxx48
2 files changed, 13 insertions, 36 deletions
diff --git a/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk b/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk
index 315fea09a04d..31492dd6cd57 100644
--- a/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk
+++ b/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,lotuswordpro_import_test, \
cppu \
cppuhelper \
sal \
+ subsequenttest \
test \
tl \
unotest \
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 <test/bootstrapfixture.hxx>
-#include <unotest/macros_test.hxx>
+#include <test/unoapi_test.hxx>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontSlant.hpp>
@@ -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<lang::XComponent>& getComponent() { return mxComponent; }
-
-private:
- uno::Reference<lang::XComponent> 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<text::XTextDocument> textDocument(getComponent(), uno::UNO_QUERY);
+ loadFromURL(u"tdf33787-ordered-bullets.lwp");
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(),
uno::UNO_QUERY);
uno::Reference<container::XEnumeration> 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<text::XTextDocument> textDocument(getComponent(), uno::UNO_QUERY);
+ loadFromURL(u"tdf129993.lwp");
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(),
uno::UNO_QUERY);
uno::Reference<container::XEnumeration> 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<text::XTextDocument> textDocument(getComponent(), uno::UNO_QUERY);
+ loadFromURL(u"paragraphProperties.lwp");
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(),
uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();