Kaydet (Commit) acc24edf authored tarafından Jens Carl's avatar Jens Carl

tdf#45904 Move _XConsolidatable Java tests to C++

Change-Id: Id851121d424e88d28f0c941d50ab115eba5cea18
Reviewed-on: https://gerrit.libreoffice.org/46485Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst aac4e447
/* -*- 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_SHEET_XCONSOLIDATABLE_HXX
#define INCLUDED_TEST_SHEET_XCONSOLIDATABLE_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 XConsolidatable
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testCreateConsolidationDescriptor();
void testConsolidate();
protected:
~XConsolidatable() {}
};
}
#endif // INCLUDED_TEST_SHEET_XCONSOLIDATABLE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -593,7 +593,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement \
qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer \
qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery \
qadevOOo/tests/java/ifc/sheet/_XConsolidatable \
qadevOOo/tests/java/ifc/sheet/_XDDELink \
qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing \
qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster \
......
......@@ -30,8 +30,6 @@
"ScModelObj";"com::sun::star::frame::XStorable";"store()"
"ScModelObj";"com::sun::star::frame::XStorable";"storeAsURL()"
"ScModelObj";"com::sun::star::frame::XStorable";"storeToURL()"
"ScModelObj";"com::sun::star::sheet::XConsolidatable";"createConsolidationDescriptor()"
"ScModelObj";"com::sun::star::sheet::XConsolidatable";"consolidate()"
"ScModelObj";"com::sun::star::document::XEventsSupplier#optional";"getEvents()"
"ScModelObj";"com::sun::star::util::XModifiable";"isModified()"
"ScModelObj";"com::sun::star::util::XModifiable";"setModified()"
......
/*
* 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.sheet;
import com.sun.star.sheet.XConsolidatable;
import com.sun.star.sheet.XConsolidationDescriptor;
import lib.MultiMethodTest;
/**
* Test the XConsolidatable interface
*/
public class _XConsolidatable extends MultiMethodTest {
public XConsolidatable oObj = null;
XConsolidationDescriptor xDescriptor = null;
/**
* Check consolidation
*/
public void _consolidate() {
requiredMethod("createConsolidationDescriptor()");
oObj.consolidate(xDescriptor);
tRes.tested("consolidate()", true);
}
/**
* Check the creation of a ConsolidationDescriptor
*/
public void _createConsolidationDescriptor() {
xDescriptor = oObj.createConsolidationDescriptor(true);
tRes.tested("createConsolidationDescriptor()", xDescriptor != null);
}
}
......@@ -8,16 +8,23 @@
*/
#include <test/unoapi_test.hxx>
#include <test/sheet/xconsolidatable.hxx>
#include <test/sheet/xgoalseek.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
using namespace css;
using namespace css::uno;
namespace sc_apitest {
#define NUMBER_OF_TESTS 1
#define NUMBER_OF_TESTS 3
class ScModelObj : public UnoApiTest, public apitest::XGoalSeek
class ScModelObj : public UnoApiTest, public apitest::XConsolidatable,
public apitest::XGoalSeek
{
public:
virtual void setUp() override;
......@@ -28,7 +35,14 @@ public:
ScModelObj();
CPPUNIT_TEST_SUITE(ScModelObj);
// XConsolidatable
CPPUNIT_TEST(testCreateConsolidationDescriptor);
CPPUNIT_TEST(testConsolidate);
// XGoalSeek
CPPUNIT_TEST(testSeekGoal);
CPPUNIT_TEST_SUITE_END();
private:
......
......@@ -54,6 +54,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xcellrangereferrer \
test/source/sheet/xcellrangesquery \
test/source/sheet/xcellseries \
test/source/sheet/xconsolidatable \
test/source/sheet/xconsolidationdescriptor \
test/source/sheet/xgoalseek \
test/source/sheet/xdatabaserange \
......
/* -*- 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/sheet/xconsolidatable.hxx>
#include <com/sun/star/sheet/GeneralFunction.hpp>
#include <com/sun/star/sheet/XConsolidatable.hpp>
#include <com/sun/star/sheet/XConsolidationDescriptor.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace css;
using namespace css::uno;
namespace apitest
{
void XConsolidatable::testCreateConsolidationDescriptor()
{
uno::Reference<sheet::XConsolidatable> xConsolidatable(init(), UNO_QUERY_THROW);
uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
xConsolidatable->createConsolidationDescriptor(true), UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("Unable to create ConsolidationDescriptor",
xConsolidationDescriptor.is());
}
void XConsolidatable::testConsolidate()
{
uno::Reference<sheet::XConsolidatable> xConsolidatable(init(), UNO_QUERY_THROW);
uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
xConsolidatable->createConsolidationDescriptor(true), UNO_QUERY_THROW);
xConsolidatable->consolidate(xConsolidationDescriptor);
CPPUNIT_ASSERT_MESSAGE("consolidate()", true);
}
}
/* 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