tdf#45904 Move _XMergeable Java Tests to C++
Change-Id: I37dc759a64301810a7d32a3f160b9bcbf546dd01
Reviewed-on: https://gerrit.libreoffice.org/60211
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/include/test/util/xmergeable.hxx b/include/test/util/xmergeable.hxx
new file mode 100644
index 0000000..046c5df
--- /dev/null
+++ b/include/test/util/xmergeable.hxx
@@ -0,0 +1,34 @@
/* -*- 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_TABLE_XMERGEABLE_HXX
#define INCLUDED_TEST_TABLE_XMERGEABLE_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 XMergeable
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testGetIsMergedMerge();
protected:
~XMergeable() {}
};
}
#endif // INCLUDED_TEST_TABLE_XMERGEABLE_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 e348176..cbde037 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -722,7 +722,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/util/_XFlushable \
qadevOOo/tests/java/ifc/util/_XImportable \
qadevOOo/tests/java/ifc/util/_XIndent \
qadevOOo/tests/java/ifc/util/_XMergeable \
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 c68950d..6e73814 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv
@@ -21,8 +21,6 @@
"ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScCellCursorObj";"com::sun::star::table::CellProperties";"ShrinkToFit#optional"
"ScCellCursorObj";"com::sun::star::util::XMergeable";"merge()"
"ScCellCursorObj";"com::sun::star::util::XMergeable";"getIsMerged()"
"ScCellCursorObj";"com::sun::star::util::XSearchable";"createSearchDescriptor()"
"ScCellCursorObj";"com::sun::star::util::XSearchable";"findAll()"
"ScCellCursorObj";"com::sun::star::util::XSearchable";"findFirst()"
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 1c44171..46426fd 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
@@ -21,8 +21,6 @@
"ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScCellRangeObj";"com::sun::star::table::CellProperties";"ShrinkToFit#optional"
"ScCellRangeObj";"com::sun::star::util::XMergeable";"merge()"
"ScCellRangeObj";"com::sun::star::util::XMergeable";"getIsMerged()"
"ScCellRangeObj";"com::sun::star::util::XSearchable";"createSearchDescriptor()"
"ScCellRangeObj";"com::sun::star::util::XSearchable";"findAll()"
"ScCellRangeObj";"com::sun::star::util::XSearchable";"findFirst()"
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 a195cb4..992fc79 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
@@ -21,8 +21,6 @@
"ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScTableSheetObj";"com::sun::star::table::CellProperties";"ShrinkToFit#optional"
"ScTableSheetObj";"com::sun::star::util::XMergeable";"merge()"
"ScTableSheetObj";"com::sun::star::util::XMergeable";"getIsMerged()"
"ScTableSheetObj";"com::sun::star::util::XSearchable";"createSearchDescriptor()"
"ScTableSheetObj";"com::sun::star::util::XSearchable";"findAll()"
"ScTableSheetObj";"com::sun::star::util::XSearchable";"findFirst()"
diff --git a/qadevOOo/tests/java/ifc/util/_XMergeable.java b/qadevOOo/tests/java/ifc/util/_XMergeable.java
deleted file mode 100644
index 0119906..0000000
--- a/qadevOOo/tests/java/ifc/util/_XMergeable.java
+++ /dev/null
@@ -1,65 +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 com.sun.star.util.XMergeable;
/**
* Testing <code>com.sun.star.util.XMergeable</code>
* interface methods :
* <ul>
* <li><code> merge()</code></li>
* <li><code> getIsMerged()</code></li>
* </ul> <p>
* Test is <b> NOT </b> multithread compliant. <p>
* @see com.sun.star.util.XMergeable
*/
public class _XMergeable extends MultiMethodTest {
public XMergeable oObj = null; // oObj filled by MultiMethodTest
/**
* Checks the property <code>IsMerged</code> and sets it
* to the opposite value. <p>
* Has <b> OK </b> status if the property value has changed. <p>
*/
public void _getIsMerged () {
boolean isMerged = oObj.getIsMerged();
oObj.merge(!isMerged);
tRes.tested("getIsMerged()", isMerged != oObj.getIsMerged());
}
/**
* Checks the property <code>IsMerged</code> and sets it
* to the opposite value. <p>
* Has <b> OK </b> status if the property value has changed. <p>
*/
public void _merge () {
boolean isMerged = oObj.getIsMerged();
oObj.merge(!isMerged);
tRes.tested("merge()", isMerged != oObj.getIsMerged());
}
} // finish class _XMergeable
diff --git a/sc/qa/extras/sccellcursorobj.cxx b/sc/qa/extras/sccellcursorobj.cxx
index ed1fd27..7630211 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/xmergeable.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -47,6 +48,7 @@ class ScCellCursorObj : public CalcUnoApiTest, public apitest::SheetCellRange,
public apitest::XCellSeries,
public apitest::XColumnRowRange,
public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation,
public apitest::XSheetCellCursor,
public apitest::XSheetCellRange,
@@ -106,6 +108,9 @@ public:
CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XMultipleOperation
CPPUNIT_TEST(testSetTableOperation);
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 2cb241c..b330290 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/xmergeable.hxx>
#include <test/util/xreplaceable.hxx>
#include <test/util/xsearchable.hxx>
@@ -62,6 +63,7 @@ class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties,
public apitest::XCellSeries,
public apitest::XColumnRowRange,
public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation,
public apitest::XReplaceable,
public apitest::XSearchable,
@@ -128,6 +130,9 @@ public:
CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XMultipleOperation
CPPUNIT_TEST(testSetTableOperation);
diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index f7eadb1..19ba24d 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/xmergeable.hxx>
#include <test/util/xreplaceable.hxx>
#include <test/util/xsearchable.hxx>
@@ -64,6 +65,7 @@ class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario,
public apitest::XColumnRowRange,
public apitest::XDataPilotTablesSupplier,
public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation,
public apitest::XPrintAreas,
public apitest::XReplaceable,
@@ -149,6 +151,9 @@ public:
CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XSearchable
CPPUNIT_TEST(testFindAll);
CPPUNIT_TEST(testFindNext);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index f916567..c37b5ee 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/xmergeable \
test/source/util/xreplaceable \
test/source/util/xsearchable \
))
diff --git a/test/source/util/xmergeable.cxx b/test/source/util/xmergeable.cxx
new file mode 100644
index 0000000..a0c99c1
--- /dev/null
+++ b/test/source/util/xmergeable.cxx
@@ -0,0 +1,34 @@
/* -*- 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/xmergeable.hxx>
#include <com/sun/star/util/XMergeable.hpp>
#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 XMergeable::testGetIsMergedMerge()
{
uno::Reference<util::XMergeable> xMergeable(init(), UNO_QUERY_THROW);
bool aIsMerged = xMergeable->getIsMerged();
xMergeable->merge(!aIsMerged);
bool aIsMerged2 = xMergeable->getIsMerged();
CPPUNIT_ASSERT_MESSAGE("Successfully able to Get is Merged and Merge", aIsMerged != aIsMerged2);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */