include/test/text/footnote.hxx | 27 ++++++ qadevOOo/Jar_OOoRunner.mk | 1 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv | 1 qadevOOo/tests/java/ifc/text/_Footnote.java | 47 ------------ sw/qa/api/SwXFootnote.cxx | 5 + test/Library_subsequenttest.mk | 1 test/source/text/footnote.cxx | 31 +++++++ 7 files changed, 63 insertions(+), 50 deletions(-)
New commits: commit 8496f805da8ea9f2585b7485b448dda52557db9a Author: anfanite396 <[email protected]> AuthorDate: Thu Aug 24 19:50:12 2023 +0530 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Sun Aug 27 10:51:38 2023 +0200 tdf#45904: Move _Footnote Java tests to C++ Change-Id: I1e69267a72296f55fac12326ec69d3c29e63561a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156055 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/include/test/text/footnote.hxx b/include/test/text/footnote.hxx new file mode 100644 index 000000000000..9970ee43cc3b --- /dev/null +++ b/include/test/text/footnote.hxx @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * 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/. + */ + +#pragma once + +#include <test/testdllapi.hxx> + +#include <com/sun/star/uno/Reference.hxx> + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST Footnote +{ +public: + virtual css::uno::Reference<css::uno::XInterface> init() = 0; + virtual ~Footnote(); + void testFootnoteProperties(); +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index d71eb77d943b..65ed25b15758 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -594,7 +594,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/text/_Defaults \ qadevOOo/tests/java/ifc/text/_DocumentIndex \ qadevOOo/tests/java/ifc/text/_DocumentSettings \ - qadevOOo/tests/java/ifc/text/_Footnote \ qadevOOo/tests/java/ifc/text/_FootnoteSettings \ qadevOOo/tests/java/ifc/text/_GenericTextDocument \ qadevOOo/tests/java/ifc/text/_LineNumberingProperties \ diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv index 125fef2ec96d..98181e7e1929 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv @@ -14,4 +14,3 @@ "SwXFootnote";"com::sun::star::text::XTextContent";"getAnchor()" "SwXFootnote";"com::sun::star::text::XText";"insertTextContent()" "SwXFootnote";"com::sun::star::text::XText";"removeTextContent()" -"SwXFootnote";"com::sun::star::text::Footnote";"ReferenceId#optional" diff --git a/qadevOOo/tests/java/ifc/text/_Footnote.java b/qadevOOo/tests/java/ifc/text/_Footnote.java deleted file mode 100644 index 4af1725644be..000000000000 --- a/qadevOOo/tests/java/ifc/text/_Footnote.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -package ifc.text; - -import lib.MultiPropertyTest; - -/** -* Testing <code>com.sun.star.text.Footnote</code> -* service properties : -* <ul> -* <li><code> ReferenceId</code></li> -* </ul> <p> -* Properties testing is automated by <code>lib.MultiPropertyTest</code>. -* @see com.sun.star.text.Footnote -*/ -public class _Footnote extends MultiPropertyTest { - - /** - * This property can be VOID, and in case if it is so new - * value must be defined. - */ - public void _ReferenceId() { - final Short val1 = Short.valueOf( (short) 1); - final Short val2 = Short.valueOf( (short) 2); - - log.println("Testing with custom Property tester"); - testProperty("ReferenceId", val1, val2); - } - -} //finish class _Footnote - diff --git a/sw/qa/api/SwXFootnote.cxx b/sw/qa/api/SwXFootnote.cxx index ea3ec0231e55..5c6f7418d941 100644 --- a/sw/qa/api/SwXFootnote.cxx +++ b/sw/qa/api/SwXFootnote.cxx @@ -9,6 +9,7 @@ #include <test/bootstrapfixture.hxx> #include <test/lang/xcomponent.hxx> +#include <test/text/footnote.hxx> #include <test/text/xsimpletext.hxx> #include <test/text/xtextrange.hxx> #include <test/text/xtextcontent.hxx> @@ -41,7 +42,8 @@ class SwXFootnote final : public test::BootstrapFixture, public apitest::XTextRange, public apitest::XTextContent, public apitest::XText, - public apitest::XFootnote + public apitest::XFootnote, + public apitest::Footnote { public: virtual void setUp() override; @@ -68,6 +70,7 @@ public: CPPUNIT_TEST(testGetSetString); CPPUNIT_TEST(testGetStart); CPPUNIT_TEST(testGetText); + CPPUNIT_TEST(testFootnoteProperties); // CPPUNIT_TEST(testInsertRemoveTextContent); CPPUNIT_TEST(testGetSetLabel); CPPUNIT_TEST_SUITE_END(); diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 9d06b435eb6b..f306904b321e 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -191,6 +191,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/text/baseindexmark \ test/source/text/documentindexmark \ test/source/text/numberingrules \ + test/source/text/footnote \ test/source/text/textcontent \ test/source/text/xautotextcontainer \ test/source/text/xfootnote \ diff --git a/test/source/text/footnote.cxx b/test/source/text/footnote.cxx new file mode 100644 index 000000000000..9f484cfd30cc --- /dev/null +++ b/test/source/text/footnote.cxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * 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/. + */ + +#include <cppunit/TestAssert.h> + +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <test/unoapi_property_testers.hxx> +#include <test/text/footnote.hxx> + +namespace apitest +{ +Footnote::~Footnote() {} + +void Footnote::testFootnoteProperties() +{ + css::uno::Reference<css::beans::XPropertySet> xFootnote(init(), css::uno::UNO_QUERY_THROW); + + short aReferenceIdGet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue ReferenceId", + xFootnote->getPropertyValue("ReferenceId") >>= aReferenceIdGet); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
