tdf#45904 Move XPropertySet Java tests to C++

Move XPropertySet Java tests to C++ for ScSpreadsheetSettingsObj.

Change-Id: I59da149983ee3b897c1cdeaf5f40962b917c91ba
Reviewed-on: https://gerrit.libreoffice.org/67101
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
diff --git a/framework/qa/complex/api_internal/api.lst b/framework/qa/complex/api_internal/api.lst
index 751bb7cc..64cfe9d 100644
--- a/framework/qa/complex/api_internal/api.lst
+++ b/framework/qa/complex/api_internal/api.lst
@@ -83,7 +83,6 @@
job98=sc.ScHeaderFieldObj
job99=sc.ScHeaderFieldsObj
job126=sc.ScSheetLinkObj
job129=sc.ScSpreadsheetSettingsObj
job131=sc.ScStyleFamilyObj
job132=sc.ScStyleObj
job134=sc.ScTableColumnObj
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index a80f138..61623c3 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -980,7 +980,6 @@
    qadevOOo/tests/java/mod/_sc/ScModelObj \
    qadevOOo/tests/java/mod/_sc/ScShapeObj \
    qadevOOo/tests/java/mod/_sc/ScSheetLinkObj \
    qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj \
    qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj \
    qadevOOo/tests/java/mod/_sc/ScStyleObj \
    qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv
deleted file mode 100644
index 7a473c2..0000000
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv
+++ /dev/null
@@ -1,7 +0,0 @@
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"addPropertyChangeListener()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"removePropertyChangeListener()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"addVetoableChangeListener()"
"ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"removeVetoableChangeListener()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java
deleted file mode 100644
index 84b6eeb..0000000
--- a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java
+++ /dev/null
@@ -1,94 +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 mod._sc;

import java.io.PrintWriter;

import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.SOfficeFactory;

import com.sun.star.lang.XComponent;
import com.sun.star.sheet.XSpreadsheetDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;

/**
* Test for object which is represented by service
* <code>com.sun.star.sheet.SpreadsheetDocumentSettings</code>. <p>
* Object implements the following interfaces :
* <ul>
*  <li> <code>com::sun::star::sheet::SpreadsheetDocumentSettings</code></li>
*  <li> <code>com::sun::star::beans::XPropertySet</code></li>
* </ul>
* @see com.sun.star.sheet.SpreadsheetDocumentSettings
* @see com.sun.star.beans.XPropertySet
* @see ifc.sheet._SpreadsheetDocumentSettings
* @see ifc.beans._XPropertySet
*/
public class ScSpreadsheetSettingsObj extends TestCase {
    private XSpreadsheetDocument xSheetDoc = null;

    /**
    * Creates Spreadsheet document.
    */
    @Override
    protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
        SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
        log.println( "creating a Spreadsheet document" );
        xSheetDoc = SOF.createCalcDoc(null);
    }

    /**
    * Disposes Spreadsheet document.
    */
    @Override
    protected void cleanup( TestParameters tParam, PrintWriter log ) {
        log.println( "    disposing xSheetDoc " );
        XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
        util.DesktopTools.closeDoc(oComp);
    }

    /**
    * Creating a TestEnvironment for the interfaces to be tested.
    * The spreadsheet document is the instance of the service
    * <code>com.sun.star.sheet.SpreadsheetDocumentSettings</code>.
    */
    @Override
    public TestEnvironment createTestEnvironment(
        TestParameters Param, PrintWriter log) throws StatusException {

        XInterface oObj = null;

        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println( "Creating a test environment" );

        oObj = xSheetDoc;

        TestEnvironment tEnv = new TestEnvironment( oObj );

        return tEnv;
    }

}


diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx
index fa79cc6..7a4ed74 100644
--- a/sc/qa/extras/scspreadsheetsettingsobj.cxx
+++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx
@@ -8,6 +8,7 @@
 */

#include <test/calc_unoapi_test.hxx>
#include <test/beans/xpropertyset.hxx>
#include <test/sheet/spreadsheetdocumentsettings.hxx>

#include <com/sun/star/lang/XComponent.hpp>
@@ -23,7 +24,9 @@

namespace sc_apitest
{
class ScSpreadsheetSettingsObj : public CalcUnoApiTest, public apitest::SpreadsheetDocumentSettings
class ScSpreadsheetSettingsObj : public CalcUnoApiTest,
                                 public apitest::SpreadsheetDocumentSettings,
                                 public apitest::XPropertySet
{
public:
    ScSpreadsheetSettingsObj();
@@ -37,6 +40,13 @@
    // SpreadsheetDocumentSettings
    CPPUNIT_TEST(testSpreadsheetDocumentSettingsProperties);

    // XPropertySet
    CPPUNIT_TEST(testGetPropertySetInfo);
    CPPUNIT_TEST(testGetPropertyValue);
    CPPUNIT_TEST(testSetPropertyValue);
    CPPUNIT_TEST(testPropertyChangeListener);
    CPPUNIT_TEST(testVetoableChangeListener);

    CPPUNIT_TEST_SUITE_END();

private:
@@ -45,6 +55,21 @@

ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
    : CalcUnoApiTest("/sc/qa/extras/testdocuments")
    , XPropertySet({
          "AreaLinks",
          "CharLocale",
          "CharLocaleAsian",
          "CharLocaleComplex",
          "ColumnLabelRanges",
          "DDELinks",
          "DatabaseRanges",
          "ExternalDocLinks",
          "InteropGrabBag",
          "NamedRanges",
          "NullDate",
          "RowLabelRanges",
          "SheetLinks",
      })
{
}

@@ -69,7 +94,7 @@

CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettingsObj);

} // end namespace
} // namespace sc_apitest

CPPUNIT_PLUGIN_IMPLEMENT();

diff --git a/sc/qa/unoapi/sc_6.sce b/sc/qa/unoapi/sc_6.sce
index 0f73be8..1077a05 100644
--- a/sc/qa/unoapi/sc_6.sce
+++ b/sc/qa/unoapi/sc_6.sce
@@ -18,5 +18,4 @@
-o sc.ScModelObj
# -o sc.ScShapeObj
# -o sc.ScSheetLinkObj
-o sc.ScSpreadsheetSettingsObj
-o sc.ScStyleFamilyObj