diff options
author | Rahul Gurung <[email protected]> | 2018-09-09 19:15:15 +0530 |
---|---|---|
committer | Markus Mohrhard <[email protected]> | 2018-09-22 15:37:52 +0200 |
commit | b56ad4cbe0aa67b92211cf31d70eca0b35c62666 (patch) | |
tree | cc8eca82750d925c299a0b9fd029c578cdfb2b07 | |
parent | ac2dff01460f8ef0c23fbf51f3666218b00c0c66 (diff) |
tdf#45904 Move _XIndent Java Tests to C++
Change-Id: I65b594db595f0e08a50a9ea18baf44c496cf18e3
Reviewed-on: https://gerrit.libreoffice.org/60218
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <[email protected]>
-rw-r--r-- | include/test/util/xindent.hxx | 35 | ||||
-rw-r--r-- | qadevOOo/Jar_OOoRunner.mk | 1 | ||||
-rw-r--r-- | qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv | 2 | ||||
-rw-r--r-- | qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv | 2 | ||||
-rw-r--r-- | qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv | 2 | ||||
-rw-r--r-- | qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangesObj.csv | 2 | ||||
-rw-r--r-- | qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv | 2 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/util/_XIndent.java | 90 | ||||
-rw-r--r-- | sc/qa/extras/sccellcursorobj.cxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/sccellobj.cxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/sccellrangeobj.cxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/sccellrangesobj.cxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/sctablesheetobj.cxx | 6 | ||||
-rw-r--r-- | test/Library_subsequenttest.mk | 1 | ||||
-rw-r--r-- | test/source/util/xindent.cxx | 55 |
15 files changed, 121 insertions, 101 deletions
diff --git a/include/test/util/xindent.hxx b/include/test/util/xindent.hxx new file mode 100644 index 000000000000..bb3c0e5d3ede --- /dev/null +++ b/include/test/util/xindent.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* 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/. +*/ + +#ifndef INCLUDED_TEST_UTIL_XINDENT_HXX +#define INCLUDED_TEST_UTIL_XINDENT_HXX + +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/uno/Reference.hxx> + +#include <test/testdllapi.hxx> + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XIndent +{ +public: + virtual css::uno::Reference<css::uno::XInterface> init() = 0; + + void testIncrementIndent(); + void testDecrementIndent(); + +protected: + ~XIndent() {} +}; +} + +#endif // INCLUDED_TEST_UTIL_XINDENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index cbde0376703a..f7f56ae29046 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -721,7 +721,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/util/_XCloneable \ qadevOOo/tests/java/ifc/util/_XFlushable \ qadevOOo/tests/java/ifc/util/_XImportable \ - qadevOOo/tests/java/ifc/util/_XIndent \ qadevOOo/tests/java/ifc/util/_XModeSelector \ qadevOOo/tests/java/ifc/util/_XModifiable \ qadevOOo/tests/java/ifc/util/_XModifyBroadcaster \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv index 6e73814c7386..5b19c7d3bc96 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv @@ -105,8 +105,6 @@ "ScCellCursorObj";"com::sun::star::style::CharacterPropertiesComplex";"CharFontPitchComplex" "ScCellCursorObj";"com::sun::star::style::CharacterPropertiesComplex";"CharPostureComplex" "ScCellCursorObj";"com::sun::star::style::CharacterPropertiesComplex";"CharLocaleComplex" -"ScCellCursorObj";"com::sun::star::util::XIndent";"decrementIndent()" -"ScCellCursorObj";"com::sun::star::util::XIndent";"incrementIndent()" "ScCellCursorObj";"com::sun::star::table::XAutoFormattable";"autoFormat()" "ScCellCursorObj";"com::sun::star::sheet::XCellRangesQuery";"queryVisibleCells()" "ScCellCursorObj";"com::sun::star::sheet::XCellRangesQuery";"queryEmptyCells()" diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv index 036c38dea7ef..e54b4fc80ff0 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv @@ -109,8 +109,6 @@ "ScCellObj";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()" "ScCellObj";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()" "ScCellObj";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()" -"ScCellObj";"com::sun::star::util::XIndent";"decrementIndent()" -"ScCellObj";"com::sun::star::util::XIndent";"incrementIndent()" "ScCellObj";"com::sun::star::text::XSimpleText";"createTextCursor()" "ScCellObj";"com::sun::star::text::XSimpleText";"createTextCursorByRange()" "ScCellObj";"com::sun::star::text::XSimpleText";"insertString()" diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv index 46426fd1af09..179c8841d4ae 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv @@ -105,8 +105,6 @@ "ScCellRangeObj";"com::sun::star::style::CharacterPropertiesComplex";"CharFontPitchComplex" "ScCellRangeObj";"com::sun::star::style::CharacterPropertiesComplex";"CharPostureComplex" "ScCellRangeObj";"com::sun::star::style::CharacterPropertiesComplex";"CharLocaleComplex" -"ScCellRangeObj";"com::sun::star::util::XIndent";"decrementIndent()" -"ScCellRangeObj";"com::sun::star::util::XIndent";"incrementIndent()" "ScCellRangeObj";"com::sun::star::table::XAutoFormattable";"autoFormat()" "ScCellRangeObj";"com::sun::star::sheet::XCellRangesQuery";"queryVisibleCells()" "ScCellRangeObj";"com::sun::star::sheet::XCellRangesQuery";"queryEmptyCells()" diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangesObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangesObj.csv index 9bd9774410f5..8ccb63dc174b 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangesObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangesObj.csv @@ -113,8 +113,6 @@ "ScCellRangesObj";"com::sun::star::style::CharacterPropertiesComplex";"CharFontPitchComplex" "ScCellRangesObj";"com::sun::star::style::CharacterPropertiesComplex";"CharPostureComplex" "ScCellRangesObj";"com::sun::star::style::CharacterPropertiesComplex";"CharLocaleComplex" -"ScCellRangesObj";"com::sun::star::util::XIndent";"decrementIndent()" -"ScCellRangesObj";"com::sun::star::util::XIndent";"incrementIndent()" "ScCellRangesObj";"com::sun::star::sheet::XCellRangesQuery";"queryVisibleCells()" "ScCellRangesObj";"com::sun::star::sheet::XCellRangesQuery";"queryEmptyCells()" "ScCellRangesObj";"com::sun::star::sheet::XCellRangesQuery";"queryContentCells()" diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv index 992fc793726a..5ee16311af93 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv @@ -108,8 +108,6 @@ "ScTableSheetObj";"com::sun::star::util::XProtectable";"protect()" "ScTableSheetObj";"com::sun::star::util::XProtectable";"unprotect()" "ScTableSheetObj";"com::sun::star::util::XProtectable";"isProtected()" -"ScTableSheetObj";"com::sun::star::util::XIndent";"decrementIndent()" -"ScTableSheetObj";"com::sun::star::util::XIndent";"incrementIndent()" "ScTableSheetObj";"com::sun::star::table::XAutoFormattable";"autoFormat()" "ScTableSheetObj";"com::sun::star::table::XTableChartsSupplier";"getCharts()" "ScTableSheetObj";"com::sun::star::sheet::XCellRangesQuery";"queryVisibleCells()" diff --git a/qadevOOo/tests/java/ifc/util/_XIndent.java b/qadevOOo/tests/java/ifc/util/_XIndent.java deleted file mode 100644 index 769b21eb9ac9..000000000000 --- a/qadevOOo/tests/java/ifc/util/_XIndent.java +++ /dev/null @@ -1,90 +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.util; - -import lib.MultiMethodTest; -import lib.Status; -import lib.StatusException; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.util.XIndent; - -/** -* Testing <code>com.sun.star.util.XCancellable</code> -* interface methods : -* <ul> -* <li><code> decrementIndent()</code></li> -* <li><code> incrementIndent()</code></li> -* </ul> <p> -* @see com.sun.star.util.XIndent -*/ -public class _XIndent extends MultiMethodTest { - - // oObj filled by MultiMethodTest - public XIndent oObj = null ; - - protected XPropertySet PropSet = null; - - /** - * Ensures that the ObjRelation PropSet is given. - */ - @Override - public void before() { - PropSet = (XPropertySet) tEnv.getObjRelation("PropSet"); - if (PropSet == null) { - throw new StatusException(Status.failed("No PropertySet given")); - } - } - - /** - * Calls the method. <p> - * Has <b>OK</b> status if the property 'ParaIndent' is incremented afterwards<p> - */ - public void _incrementIndent() { - int oldValue = getIndent(); - oObj.incrementIndent(); - int newValue = getIndent(); - tRes.tested("incrementIndent()", oldValue < newValue) ; - } - - /** - * Calls the method. <p> - * Has <b>OK</b> status if the property 'ParaIndent' is decremented afterwards<p> - * requires 'incrementIndent()' to be executed first. - */ - public void _decrementIndent() { - requiredMethod("incrementIndent()"); - int oldValue = getIndent(); - oObj.decrementIndent(); - int newValue = getIndent(); - tRes.tested("decrementIndent()", oldValue > newValue) ; - } - - public short getIndent() { - short ret = 0; - try { - ret = ((Short) PropSet.getPropertyValue("ParaIndent")).shortValue(); - } catch (com.sun.star.beans.UnknownPropertyException upe) { - } catch (com.sun.star.lang.WrappedTargetException wte) { - } - return ret; - } - -} // finish class _XCancellable - diff --git a/sc/qa/extras/sccellcursorobj.cxx b/sc/qa/extras/sccellcursorobj.cxx index 7630211c1820..9402c8cb2780 100644 --- a/sc/qa/extras/sccellcursorobj.cxx +++ b/sc/qa/extras/sccellcursorobj.cxx @@ -27,6 +27,7 @@ #include <test/sheet/xusedareacursor.hxx> #include <test/table/xcellcursor.hxx> #include <test/table/xcolumnrowrange.hxx> +#include <test/util/xindent.hxx> #include <test/util/xmergeable.hxx> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> @@ -48,6 +49,7 @@ class ScCellCursorObj : public CalcUnoApiTest, public apitest::SheetCellRange, public apitest::XCellSeries, public apitest::XColumnRowRange, public apitest::XFormulaQuery, + public apitest::XIndent, public apitest::XMergeable, public apitest::XMultipleOperation, public apitest::XSheetCellCursor, @@ -108,6 +110,10 @@ public: CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryPrecedents); + // XIndent + CPPUNIT_TEST(testIncrementIndent); + CPPUNIT_TEST(testDecrementIndent); + // XMergeable CPPUNIT_TEST(testGetIsMergedMerge); diff --git a/sc/qa/extras/sccellobj.cxx b/sc/qa/extras/sccellobj.cxx index 1a3ffb2ec66c..5ade0aef45f3 100644 --- a/sc/qa/extras/sccellobj.cxx +++ b/sc/qa/extras/sccellobj.cxx @@ -14,6 +14,7 @@ #include <test/sheet/xformulaquery.hxx> #include <test/sheet/xsheetannotationanchor.hxx> #include <test/table/xcolumnrowrange.hxx> +#include <test/util/xindent.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp> @@ -35,6 +36,7 @@ class ScCellObj : public CalcUnoApiTest, public apitest::SheetCell, public apitest::XCellAddressable, public apitest::XColumnRowRange, public apitest::XFormulaQuery, + public apitest::XIndent, public apitest::XSheetAnnotationAnchor { public: @@ -67,6 +69,10 @@ public: CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryPrecedents); + // XIndent + CPPUNIT_TEST(testIncrementIndent); + CPPUNIT_TEST(testDecrementIndent); + // XSheetAnnotationAnchor CPPUNIT_TEST(testGetAnnotation); diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx index b330290491c2..a529c9b4eb1f 100644 --- a/sc/qa/extras/sccellrangeobj.cxx +++ b/sc/qa/extras/sccellrangeobj.cxx @@ -26,6 +26,7 @@ #include <test/sheet/xsubtotalcalculatable.hxx> #include <test/sheet/xuniquecellformatrangessupplier.hxx> #include <test/table/xcolumnrowrange.hxx> +#include <test/util/xindent.hxx> #include <test/util/xmergeable.hxx> #include <test/util/xreplaceable.hxx> #include <test/util/xsearchable.hxx> @@ -63,6 +64,7 @@ class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties, public apitest::XCellSeries, public apitest::XColumnRowRange, public apitest::XFormulaQuery, + public apitest::XIndent, public apitest::XMergeable, public apitest::XMultipleOperation, public apitest::XReplaceable, @@ -130,6 +132,10 @@ public: CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryPrecedents); + // XIndent + CPPUNIT_TEST(testIncrementIndent); + CPPUNIT_TEST(testDecrementIndent); + // XMergeable CPPUNIT_TEST(testGetIsMergedMerge); diff --git a/sc/qa/extras/sccellrangesobj.cxx b/sc/qa/extras/sccellrangesobj.cxx index 9bfe1dd88721..01785b538cb9 100644 --- a/sc/qa/extras/sccellrangesobj.cxx +++ b/sc/qa/extras/sccellrangesobj.cxx @@ -13,6 +13,7 @@ #include <test/sheet/xsheetcellrangecontainer.hxx> #include <test/sheet/xsheetcellranges.hxx> #include <test/sheet/xsheetoperation.hxx> +#include <test/util/xindent.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -32,6 +33,7 @@ namespace sc_apitest { class ScCellRangesObj : public CalcUnoApiTest, public apitest::SheetCellRanges, public apitest::XFormulaQuery, + public apitest::XIndent, public apitest::XSheetCellRangeContainer, public apitest::XSheetCellRanges, public apitest::XSheetOperation @@ -54,6 +56,10 @@ public: CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryPrecedents); + // XIndent + CPPUNIT_TEST(testIncrementIndent); + CPPUNIT_TEST(testDecrementIndent); + // XSheetCellRangeContainer CPPUNIT_TEST(testAddRemoveRangeAddress); CPPUNIT_TEST(testAddRemoveRangeAddresses); diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx index 19ba24d51691..5b3114d620b3 100644 --- a/sc/qa/extras/sctablesheetobj.cxx +++ b/sc/qa/extras/sctablesheetobj.cxx @@ -37,6 +37,7 @@ #include <test/sheet/xsubtotalcalculatable.hxx> #include <test/sheet/xuniquecellformatrangessupplier.hxx> #include <test/table/xcolumnrowrange.hxx> +#include <test/util/xindent.hxx> #include <test/util/xmergeable.hxx> #include <test/util/xreplaceable.hxx> #include <test/util/xsearchable.hxx> @@ -65,6 +66,7 @@ class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario, public apitest::XColumnRowRange, public apitest::XDataPilotTablesSupplier, public apitest::XFormulaQuery, + public apitest::XIndent, public apitest::XMergeable, public apitest::XMultipleOperation, public apitest::XPrintAreas, @@ -151,6 +153,10 @@ public: CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryPrecedents); + // XIndent + CPPUNIT_TEST(testIncrementIndent); + CPPUNIT_TEST(testDecrementIndent); + // XMergeable CPPUNIT_TEST(testGetIsMergedMerge); diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index c37b5eefb6bc..7903bc49f2ae 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/text/xtext \ test/source/text/xtextfield \ test/source/text/xtextcontent \ + test/source/util/xindent \ test/source/util/xmergeable \ test/source/util/xreplaceable \ test/source/util/xsearchable \ diff --git a/test/source/util/xindent.cxx b/test/source/util/xindent.cxx new file mode 100644 index 000000000000..1bbc9da57195 --- /dev/null +++ b/test/source/util/xindent.cxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* 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 <test/cppunitasserthelper.hxx> +#include <test/util/xindent.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/XIndent.hpp> + +#include <com/sun/star/uno/Any.hxx> +#include <com/sun/star/uno/Reference.hxx> + +#include <cppunit/extensions/HelperMacros.h> + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace apitest +{ +void XIndent::testIncrementIndent() +{ + uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW); + uno::Any aAny = xPropertySet->getPropertyValue("ParaIndent"); + sal_Int32 nOldValue = aAny.get<sal_Int32>(); + + xIndent->incrementIndent(); + + uno::Any aAny2 = xPropertySet->getPropertyValue("ParaIndent"); + sal_Int32 nNewValue = aAny2.get<sal_Int32>(); + CPPUNIT_ASSERT_MESSAGE("Successfully able to Increment Indent", nOldValue < nNewValue); +} +void XIndent::testDecrementIndent() +{ + uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW); + xIndent->incrementIndent(); + uno::Any aAny = xPropertySet->getPropertyValue("ParaIndent"); + sal_Int32 nOldValue = aAny.get<sal_Int32>(); + + xIndent->decrementIndent(); + + uno::Any aAny2 = xPropertySet->getPropertyValue("ParaIndent"); + sal_Int32 nNewValue = aAny2.get<sal_Int32>(); + CPPUNIT_ASSERT_MESSAGE("Successfully able to Decrement Indent", nOldValue > nNewValue); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |