diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-03-20 04:53:31 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-04-15 00:58:31 +0200 |
commit | c8c74a0b4ca6f3a3619f423b6548c80c52392ae0 (patch) | |
tree | 711f4dbb45e0840f26f66a3d984fe17627d1f776 /qadevOOo | |
parent | 3fb48f0b6a542bb6d91cc35c0dbd3454758ffb2d (diff) |
tdf#45904 Move _FunctionDescription Java tests to C++
Change-Id: Ib4baf75dddb3b63bab25ab13967a20c65d692ce2
Reviewed-on: https://gerrit.libreoffice.org/52613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/Jar_OOoRunner.mk | 2 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java | 140 | ||||
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java | 96 |
3 files changed, 0 insertions, 238 deletions
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 4f0b38f9400e..56d52e04ffc6 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -562,7 +562,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer \ qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer \ qadevOOo/tests/java/ifc/sdb/_XSQLErrorBroadcaster \ - qadevOOo/tests/java/ifc/sheet/_FunctionDescription \ qadevOOo/tests/java/ifc/sheet/_SheetSortDescriptor \ qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument \ qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField \ @@ -1003,7 +1002,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/mod/_sc/ScDrawPageObj \ qadevOOo/tests/java/mod/_sc/ScDrawPagesObj \ qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase \ - qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj \ qadevOOo/tests/java/mod/_sc/ScFunctionListObj \ qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj \ qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj \ diff --git a/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java b/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java deleted file mode 100644 index 800d74514cb1..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_FunctionDescription.java +++ /dev/null @@ -1,140 +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.sheet; - -import lib.MultiMethodTest; -import util.ValueChanger; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.sheet.FunctionArgument; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -/** -* Testing <code>com.sun.star.sheet.FunctionDescription</code> -* service properties: -* <ul> -* <li><code>Arguments</code></li> -* <li><code>Category</code></li> -* <li><code>Description</code></li> -* <li><code>Id</code></li> -* <li><code>Name</code></li> -* </ul> <p> -* @see com.sun.star.sheet.FunctionDescription -*/ -public class _FunctionDescription extends MultiMethodTest { - - public XPropertySet oObj = null; // oObj filled by MultiMethodTest - - public void _Arguments() { - // check if Service is available - XServiceInfo xInfo = UnoRuntime.queryInterface(XServiceInfo.class, oObj ); - - if ( ! xInfo.supportsService - ( "com.sun.star.sheet.FunctionDescription" ) ) { - log.println( "Service not available !" ); - tRes.tested( "Supported", false ); - } - - try { - XMultiServiceFactory oDocMSF = tParam.getMSF(); - - XInterface FA = (XInterface)oDocMSF. - createInstance("com.sun.star.sheet.FunctionArgument"); - FunctionArgument arg = (FunctionArgument)AnyConverter.toObject - (FunctionArgument.class, FA); - - arg.Description = "FunctionDescription argument description" ; - arg.Name = "FunctionDescriptiuon argument name" ; - arg.IsOptional = true ; - - Object sValue = oObj.getPropertyValue("Arguments") ; - oObj.setPropertyValue("Arguments", new FunctionArgument[] {arg}) ; - Object nValue = oObj.getPropertyValue("Arguments") ; - - if (sValue.equals(nValue)) { - log.println("Property 'Arguments' didn't change: OK") ; - tRes.tested("Arguments", true) ; - } else { - log.println("Readonly property 'Arguments' changed: Failed") ; - tRes.tested("Arguments", false) ; - } - } catch (Exception e) { - log.println( - "Exception occurred while testing property 'Arguments'" ); - e.printStackTrace( log ); - tRes.tested( "Arguments", false ); - } - } - - public void _Category() { - tryChangeProp("Category") ; - } - - public void _Description() { - tryChangeProp( "Category" ); - } - - public void _Id() { - tryChangeProp( "Id" ); - } - - public void _Name() { - tryChangeProp( "Name" ); - } - - public void tryChangeProp( String name ) { - - Object gValue = null; - Object sValue = null; - Object ValueToSet = null; - - - try { - gValue = oObj.getPropertyValue( name ); - - ValueToSet = ValueChanger.changePValue( gValue ); - oObj.setPropertyValue( name, ValueToSet ); - sValue = oObj.getPropertyValue( name ); - - //check get-set methods - if( gValue.equals( sValue ) ) { - log.println( "Value for '"+name+"' hasn't changed. OK." ); - tRes.tested( name, true ); - } - else { - log.println( "Property '" + name + - "' changes its value : Failed !" ); - tRes.tested( name, false ); - } - } - catch ( Exception e ) { - log.println( - "Exception occurred while testing property '" + name + "'" ); - e.printStackTrace( log ); - tRes.tested( name, false ); - } - } // end of changeProp - -} //finish class _TextContent - - diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java deleted file mode 100644 index 6d2fbdaa4250..000000000000 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java +++ /dev/null @@ -1,96 +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 java.util.Random; - -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.container.XNameAccess; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -public class ScFunctionDescriptionObj extends TestCase { - private XSpreadsheetDocument xSheetDoc = null; - - @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); - } - - @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 - */ - @Override - public TestEnvironment createTestEnvironment( - TestParameters Param, PrintWriter log ) - throws Exception { - - 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" ); - - log.println("Getting test object ") ; - - XMultiServiceFactory oDocMSF = Param.getMSF(); - - XInterface FDs = (XInterface)oDocMSF. - createInstance("com.sun.star.sheet.FunctionDescriptions"); - XNameAccess NA = UnoRuntime.queryInterface - (XNameAccess.class, FDs); - - String names[] = NA.getElementNames(); - Random rnd = new Random(); - int idx = rnd.nextInt(names.length); - - oObj = (XInterface)NA.getByName(names[idx]); - - log.println("Creating object - " + - ((oObj == null) ? "FAILED" : "OK")); - - TestEnvironment tEnv = new TestEnvironment( oObj ); - - // Other parameters required for interface tests - - return tEnv; - } - -} - - |