Kaydet (Commit) efe119aa authored tarafından Rahul Gurung's avatar Rahul Gurung Kaydeden (comit) Markus Mohrhard

tdf#45904 Move _XMergeable Java Tests to C++

Change-Id: I37dc759a64301810a7d32a3f160b9bcbf546dd01
Reviewed-on: https://gerrit.libreoffice.org/60211
Tested-by: Jenkins
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 8e12e517
/* -*- 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: */
...@@ -722,7 +722,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ ...@@ -722,7 +722,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/util/_XFlushable \ qadevOOo/tests/java/ifc/util/_XFlushable \
qadevOOo/tests/java/ifc/util/_XImportable \ qadevOOo/tests/java/ifc/util/_XImportable \
qadevOOo/tests/java/ifc/util/_XIndent \ qadevOOo/tests/java/ifc/util/_XIndent \
qadevOOo/tests/java/ifc/util/_XMergeable \
qadevOOo/tests/java/ifc/util/_XModeSelector \ qadevOOo/tests/java/ifc/util/_XModeSelector \
qadevOOo/tests/java/ifc/util/_XModifiable \ qadevOOo/tests/java/ifc/util/_XModifiable \
qadevOOo/tests/java/ifc/util/_XModifyBroadcaster \ qadevOOo/tests/java/ifc/util/_XModifyBroadcaster \
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
"ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional" "ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional" "ScCellCursorObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScCellCursorObj";"com::sun::star::table::CellProperties";"ShrinkToFit#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";"createSearchDescriptor()"
"ScCellCursorObj";"com::sun::star::util::XSearchable";"findAll()" "ScCellCursorObj";"com::sun::star::util::XSearchable";"findAll()"
"ScCellCursorObj";"com::sun::star::util::XSearchable";"findFirst()" "ScCellCursorObj";"com::sun::star::util::XSearchable";"findFirst()"
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
"ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional" "ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional" "ScCellRangeObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScCellRangeObj";"com::sun::star::table::CellProperties";"ShrinkToFit#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";"createSearchDescriptor()"
"ScCellRangeObj";"com::sun::star::util::XSearchable";"findAll()" "ScCellRangeObj";"com::sun::star::util::XSearchable";"findAll()"
"ScCellRangeObj";"com::sun::star::util::XSearchable";"findFirst()" "ScCellRangeObj";"com::sun::star::util::XSearchable";"findFirst()"
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
"ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional" "ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalTLBR#optional"
"ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional" "ScTableSheetObj";"com::sun::star::table::CellProperties";"DiagonalBLTR#optional"
"ScTableSheetObj";"com::sun::star::table::CellProperties";"ShrinkToFit#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";"createSearchDescriptor()"
"ScTableSheetObj";"com::sun::star::util::XSearchable";"findAll()" "ScTableSheetObj";"com::sun::star::util::XSearchable";"findAll()"
"ScTableSheetObj";"com::sun::star::util::XSearchable";"findFirst()" "ScTableSheetObj";"com::sun::star::util::XSearchable";"findFirst()"
......
/*
* 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
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <test/sheet/xusedareacursor.hxx> #include <test/sheet/xusedareacursor.hxx>
#include <test/table/xcellcursor.hxx> #include <test/table/xcellcursor.hxx>
#include <test/table/xcolumnrowrange.hxx> #include <test/table/xcolumnrowrange.hxx>
#include <test/util/xmergeable.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp>
...@@ -47,6 +48,7 @@ class ScCellCursorObj : public CalcUnoApiTest, public apitest::SheetCellRange, ...@@ -47,6 +48,7 @@ class ScCellCursorObj : public CalcUnoApiTest, public apitest::SheetCellRange,
public apitest::XCellSeries, public apitest::XCellSeries,
public apitest::XColumnRowRange, public apitest::XColumnRowRange,
public apitest::XFormulaQuery, public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation, public apitest::XMultipleOperation,
public apitest::XSheetCellCursor, public apitest::XSheetCellCursor,
public apitest::XSheetCellRange, public apitest::XSheetCellRange,
...@@ -106,6 +108,9 @@ public: ...@@ -106,6 +108,9 @@ public:
CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents); CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XMultipleOperation // XMultipleOperation
CPPUNIT_TEST(testSetTableOperation); CPPUNIT_TEST(testSetTableOperation);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <test/sheet/xsubtotalcalculatable.hxx> #include <test/sheet/xsubtotalcalculatable.hxx>
#include <test/sheet/xuniquecellformatrangessupplier.hxx> #include <test/sheet/xuniquecellformatrangessupplier.hxx>
#include <test/table/xcolumnrowrange.hxx> #include <test/table/xcolumnrowrange.hxx>
#include <test/util/xmergeable.hxx>
#include <test/util/xreplaceable.hxx> #include <test/util/xreplaceable.hxx>
#include <test/util/xsearchable.hxx> #include <test/util/xsearchable.hxx>
...@@ -62,6 +63,7 @@ class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties, ...@@ -62,6 +63,7 @@ class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties,
public apitest::XCellSeries, public apitest::XCellSeries,
public apitest::XColumnRowRange, public apitest::XColumnRowRange,
public apitest::XFormulaQuery, public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation, public apitest::XMultipleOperation,
public apitest::XReplaceable, public apitest::XReplaceable,
public apitest::XSearchable, public apitest::XSearchable,
...@@ -128,6 +130,9 @@ public: ...@@ -128,6 +130,9 @@ public:
CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents); CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XMultipleOperation // XMultipleOperation
CPPUNIT_TEST(testSetTableOperation); CPPUNIT_TEST(testSetTableOperation);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <test/sheet/xsubtotalcalculatable.hxx> #include <test/sheet/xsubtotalcalculatable.hxx>
#include <test/sheet/xuniquecellformatrangessupplier.hxx> #include <test/sheet/xuniquecellformatrangessupplier.hxx>
#include <test/table/xcolumnrowrange.hxx> #include <test/table/xcolumnrowrange.hxx>
#include <test/util/xmergeable.hxx>
#include <test/util/xreplaceable.hxx> #include <test/util/xreplaceable.hxx>
#include <test/util/xsearchable.hxx> #include <test/util/xsearchable.hxx>
...@@ -64,6 +65,7 @@ class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario, ...@@ -64,6 +65,7 @@ class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario,
public apitest::XColumnRowRange, public apitest::XColumnRowRange,
public apitest::XDataPilotTablesSupplier, public apitest::XDataPilotTablesSupplier,
public apitest::XFormulaQuery, public apitest::XFormulaQuery,
public apitest::XMergeable,
public apitest::XMultipleOperation, public apitest::XMultipleOperation,
public apitest::XPrintAreas, public apitest::XPrintAreas,
public apitest::XReplaceable, public apitest::XReplaceable,
...@@ -149,6 +151,9 @@ public: ...@@ -149,6 +151,9 @@ public:
CPPUNIT_TEST(testQueryDependents); CPPUNIT_TEST(testQueryDependents);
CPPUNIT_TEST(testQueryPrecedents); CPPUNIT_TEST(testQueryPrecedents);
// XMergeable
CPPUNIT_TEST(testGetIsMergedMerge);
// XSearchable // XSearchable
CPPUNIT_TEST(testFindAll); CPPUNIT_TEST(testFindAll);
CPPUNIT_TEST(testFindNext); CPPUNIT_TEST(testFindNext);
......
...@@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ ...@@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/text/xtext \ test/source/text/xtext \
test/source/text/xtextfield \ test/source/text/xtextfield \
test/source/text/xtextcontent \ test/source/text/xtextcontent \
test/source/util/xmergeable \
test/source/util/xreplaceable \ test/source/util/xreplaceable \
test/source/util/xsearchable \ test/source/util/xsearchable \
)) ))
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment