From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- qadevOOo/tests/java/ifc/text/_BaseFrame.java | 116 ++++++++ .../tests/java/ifc/text/_BaseFrameProperties.java | 37 +++ qadevOOo/tests/java/ifc/text/_BaseIndex.java | 201 ++++++++++++++ qadevOOo/tests/java/ifc/text/_BaseIndexMark.java | 36 +++ qadevOOo/tests/java/ifc/text/_CellProperties.java | 150 +++++++++++ qadevOOo/tests/java/ifc/text/_CellRange.java | 94 +++++++ qadevOOo/tests/java/ifc/text/_Defaults.java | 32 +++ qadevOOo/tests/java/ifc/text/_DocumentIndex.java | 45 ++++ .../tests/java/ifc/text/_DocumentIndexMark.java | 38 +++ .../tests/java/ifc/text/_DocumentSettings.java | 26 ++ qadevOOo/tests/java/ifc/text/_Footnote.java | 47 ++++ .../tests/java/ifc/text/_FootnoteSettings.java | 95 +++++++ .../tests/java/ifc/text/_GenericTextDocument.java | 39 +++ .../java/ifc/text/_LineNumberingProperties.java | 54 ++++ qadevOOo/tests/java/ifc/text/_MailMerge.java | 167 ++++++++++++ qadevOOo/tests/java/ifc/text/_NumberingLevel.java | 163 +++++++++++ qadevOOo/tests/java/ifc/text/_NumberingRules.java | 39 +++ qadevOOo/tests/java/ifc/text/_PrintSettings.java | 47 ++++ qadevOOo/tests/java/ifc/text/_Text.java | 26 ++ qadevOOo/tests/java/ifc/text/_TextColumns.java | 64 +++++ qadevOOo/tests/java/ifc/text/_TextContent.java | 37 +++ qadevOOo/tests/java/ifc/text/_TextDocument.java | 39 +++ .../tests/java/ifc/text/_TextEmbeddedObject.java | 59 ++++ qadevOOo/tests/java/ifc/text/_TextFieldMaster.java | 37 +++ qadevOOo/tests/java/ifc/text/_TextFrame.java | 61 +++++ .../tests/java/ifc/text/_TextGraphicObject.java | 162 +++++++++++ qadevOOo/tests/java/ifc/text/_TextPortion.java | 48 ++++ qadevOOo/tests/java/ifc/text/_TextSection.java | 142 ++++++++++ qadevOOo/tests/java/ifc/text/_TextTable.java | 110 ++++++++ qadevOOo/tests/java/ifc/text/_TextTableRow.java | 43 +++ qadevOOo/tests/java/ifc/text/_ViewSettings.java | 61 +++++ .../tests/java/ifc/text/_XAutoTextContainer.java | 132 +++++++++ qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java | 69 +++++ qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java | 299 +++++++++++++++++++++ .../tests/java/ifc/text/_XBookmarksSupplier.java | 55 ++++ .../java/ifc/text/_XChapterNumberingSupplier.java | 54 ++++ .../java/ifc/text/_XDefaultNumberingProvider.java | 65 +++++ qadevOOo/tests/java/ifc/text/_XDocumentIndex.java | 115 ++++++++ .../java/ifc/text/_XDocumentIndexesSupplier.java | 54 ++++ .../tests/java/ifc/text/_XEndnotesSupplier.java | 72 +++++ qadevOOo/tests/java/ifc/text/_XFootnote.java | 101 +++++++ .../java/ifc/text/_XFootnotesSettingsSupplier.java | 54 ++++ .../tests/java/ifc/text/_XFootnotesSupplier.java | 73 +++++ .../java/ifc/text/_XLineNumberingProperties.java | 52 ++++ .../java/ifc/text/_XMailMergeBroadcaster.java | 140 ++++++++++ qadevOOo/tests/java/ifc/text/_XPageCursor.java | 162 +++++++++++ qadevOOo/tests/java/ifc/text/_XPagePrintable.java | 152 +++++++++++ .../tests/java/ifc/text/_XParagraphCursor.java | 128 +++++++++ .../java/ifc/text/_XReferenceMarksSupplier.java | 57 ++++ .../java/ifc/text/_XRelativeTextContentInsert.java | 126 +++++++++ qadevOOo/tests/java/ifc/text/_XSentenceCursor.java | 118 ++++++++ qadevOOo/tests/java/ifc/text/_XSimpleText.java | 126 +++++++++ qadevOOo/tests/java/ifc/text/_XText.java | 157 +++++++++++ qadevOOo/tests/java/ifc/text/_XTextColumns.java | 105 ++++++++ qadevOOo/tests/java/ifc/text/_XTextContent.java | 108 ++++++++ qadevOOo/tests/java/ifc/text/_XTextCursor.java | 235 ++++++++++++++++ qadevOOo/tests/java/ifc/text/_XTextDocument.java | 62 +++++ .../ifc/text/_XTextEmbeddedObjectsSupplier.java | 52 ++++ qadevOOo/tests/java/ifc/text/_XTextField.java | 57 ++++ .../tests/java/ifc/text/_XTextFieldsSupplier.java | 178 ++++++++++++ qadevOOo/tests/java/ifc/text/_XTextFrame.java | 59 ++++ .../tests/java/ifc/text/_XTextFramesSupplier.java | 55 ++++ .../ifc/text/_XTextGraphicObjectsSupplier.java | 58 ++++ qadevOOo/tests/java/ifc/text/_XTextRange.java | 170 ++++++++++++ .../tests/java/ifc/text/_XTextRangeCompare.java | 174 ++++++++++++ qadevOOo/tests/java/ifc/text/_XTextRangeMover.java | 88 ++++++ qadevOOo/tests/java/ifc/text/_XTextSection.java | 68 +++++ .../java/ifc/text/_XTextSectionsSupplier.java | 66 +++++ qadevOOo/tests/java/ifc/text/_XTextTable.java | 173 ++++++++++++ .../tests/java/ifc/text/_XTextTableCursor.java | 283 +++++++++++++++++++ .../tests/java/ifc/text/_XTextTablesSupplier.java | 57 ++++ .../java/ifc/text/_XTextViewCursorSupplier.java | 53 ++++ qadevOOo/tests/java/ifc/text/_XWordCursor.java | 124 +++++++++ 73 files changed, 6901 insertions(+) create mode 100644 qadevOOo/tests/java/ifc/text/_BaseFrame.java create mode 100644 qadevOOo/tests/java/ifc/text/_BaseFrameProperties.java create mode 100644 qadevOOo/tests/java/ifc/text/_BaseIndex.java create mode 100644 qadevOOo/tests/java/ifc/text/_BaseIndexMark.java create mode 100644 qadevOOo/tests/java/ifc/text/_CellProperties.java create mode 100644 qadevOOo/tests/java/ifc/text/_CellRange.java create mode 100644 qadevOOo/tests/java/ifc/text/_Defaults.java create mode 100644 qadevOOo/tests/java/ifc/text/_DocumentIndex.java create mode 100644 qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java create mode 100644 qadevOOo/tests/java/ifc/text/_DocumentSettings.java create mode 100644 qadevOOo/tests/java/ifc/text/_Footnote.java create mode 100644 qadevOOo/tests/java/ifc/text/_FootnoteSettings.java create mode 100644 qadevOOo/tests/java/ifc/text/_GenericTextDocument.java create mode 100644 qadevOOo/tests/java/ifc/text/_LineNumberingProperties.java create mode 100644 qadevOOo/tests/java/ifc/text/_MailMerge.java create mode 100644 qadevOOo/tests/java/ifc/text/_NumberingLevel.java create mode 100644 qadevOOo/tests/java/ifc/text/_NumberingRules.java create mode 100644 qadevOOo/tests/java/ifc/text/_PrintSettings.java create mode 100644 qadevOOo/tests/java/ifc/text/_Text.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextColumns.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextContent.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextDocument.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextEmbeddedObject.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextFieldMaster.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextFrame.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextGraphicObject.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextPortion.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextSection.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextTable.java create mode 100644 qadevOOo/tests/java/ifc/text/_TextTableRow.java create mode 100644 qadevOOo/tests/java/ifc/text/_ViewSettings.java create mode 100644 qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java create mode 100644 qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java create mode 100644 qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java create mode 100644 qadevOOo/tests/java/ifc/text/_XBookmarksSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XChapterNumberingSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XDefaultNumberingProvider.java create mode 100644 qadevOOo/tests/java/ifc/text/_XDocumentIndex.java create mode 100644 qadevOOo/tests/java/ifc/text/_XDocumentIndexesSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XEndnotesSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XFootnote.java create mode 100644 qadevOOo/tests/java/ifc/text/_XFootnotesSettingsSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XFootnotesSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XLineNumberingProperties.java create mode 100644 qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java create mode 100644 qadevOOo/tests/java/ifc/text/_XPageCursor.java create mode 100644 qadevOOo/tests/java/ifc/text/_XPagePrintable.java create mode 100644 qadevOOo/tests/java/ifc/text/_XParagraphCursor.java create mode 100644 qadevOOo/tests/java/ifc/text/_XReferenceMarksSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java create mode 100644 qadevOOo/tests/java/ifc/text/_XSentenceCursor.java create mode 100644 qadevOOo/tests/java/ifc/text/_XSimpleText.java create mode 100644 qadevOOo/tests/java/ifc/text/_XText.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextColumns.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextContent.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextCursor.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextDocument.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextEmbeddedObjectsSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextField.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextFrame.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextFramesSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextGraphicObjectsSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextRange.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextRangeMover.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextSection.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextSectionsSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextTable.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextTableCursor.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextTablesSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XTextViewCursorSupplier.java create mode 100644 qadevOOo/tests/java/ifc/text/_XWordCursor.java (limited to 'qadevOOo/tests/java/ifc/text') diff --git a/qadevOOo/tests/java/ifc/text/_BaseFrame.java b/qadevOOo/tests/java/ifc/text/_BaseFrame.java new file mode 100644 index 000000000..8bfd80dc5 --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_BaseFrame.java @@ -0,0 +1,116 @@ +/* + * 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.text; + +import lib.MultiPropertyTest; + +/** +* Testing com.sun.star.text.BaseFrame +* service properties : +*

+* Properties testing is automated by lib.MultiPropertyTest. +* @see com.sun.star.text.BaseFrame +*/ +public class _BaseFrame extends MultiPropertyTest { + public String str1 = "Graphics"; + public String str2 = "Watermark"; + + /** + * Redefined method returns value, that differs from property value. + */ + protected PropertyTester StringTester = new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + if (str1.equals(oldValue)) + return str2; + else + return str1; + } + }; + + /** + * This property can be VOID, and in case if it is so new + * value must be defined. + */ + public void _FrameStyleName() { + log.println("Testing with custom Property tester") ; + testProperty("FrameStyleName", StringTester) ; + } + + /** + * This property can be VOID, and in case if it is so new + * value must be defined. + */ + public void _BackColorTransparency() { + testProperty("BackColorTransparency", Integer.valueOf(10), Integer.valueOf(50)) ; + } + +} //finish class _BaseFrame + diff --git a/qadevOOo/tests/java/ifc/text/_BaseFrameProperties.java b/qadevOOo/tests/java/ifc/text/_BaseFrameProperties.java new file mode 100644 index 000000000..9b0cf03c8 --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_BaseFrameProperties.java @@ -0,0 +1,37 @@ +/* + * 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.text; + +import lib.MultiPropertyTest; + + +public class _BaseFrameProperties extends MultiPropertyTest { + protected PropertyTester FrameTester = new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + Object frame = tEnv.getObjRelation("TextFrame"); + + return frame; + } + }; + + public void _AnchorFrame() { + log.println("Testing with custom Property tester"); + testProperty("AnchorFrame", FrameTester); + } +} \ No newline at end of file diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndex.java b/qadevOOo/tests/java/ifc/text/_BaseIndex.java new file mode 100644 index 000000000..006796724 --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_BaseIndex.java @@ -0,0 +1,201 @@ +/* + * 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.text; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.container.XIndexAccess; +import com.sun.star.container.XIndexReplace; +import com.sun.star.text.XTextColumns; +import com.sun.star.uno.UnoRuntime; + +import lib.MultiPropertyTest; + + +/** +* Testing com.sun.star.text.BaseIndex +* service properties : +*

+* Properties testing is automated by lib.MultiPropertyTest. +* @see com.sun.star.text.BaseIndex +*/ +public class _BaseIndex extends MultiPropertyTest { + /** + * Redefined method returns object, that contains changed property value. + */ + protected PropertyTester CustomTester = new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + XTextColumns TC = UnoRuntime.queryInterface( + XTextColumns.class, oldValue); + TC.setColumnCount((short) (TC.getColumnCount() + (short) 1)); + + return TC; + } + }; + + /** + * New value must be defined for this property. + */ + public void _TextColumns() { + log.println( + "Testing property 'TextColumns' with custom property tester"); + testProperty("TextColumns", CustomTester); + } + + /** + * The value of this property is a collection of document index + * level formats. This property is tested in the following manner : + * the property value (a collection) is obtained, the first element + * of this collection is replaced with new non-empty array + * (PropertyValue[][]) with some properties set. + * After that the collection is set back as property value.

+ * + * Comparing of set and got PropertyValue arrays + * is difficult because values can be changed after setting + * by service implementation.

+ * + * Has OK status if the collection again gotten, has a + * new first element (i.e. lengths of the old array and the array + * get are different or their contents differ). + */ + public void _LevelFormat() { + log.println( + "Testing property 'LevelFormat' with custom property tester"); + testProperty("LevelFormat", + new PropertyTester() { + PropertyValue[][] newVal = null; + PropertyValue[][] oldVal = null; + + @Override + protected Object getNewValue(String propName, Object oldValue) { + XIndexReplace indProp = UnoRuntime.queryInterface( + XIndexReplace.class, oldValue); + + try { + oldVal = (PropertyValue[][]) indProp.getByIndex(0); + + log.println("Get:"); + printLevelFormatProperty(oldValue); + + newVal = new PropertyValue[1][2]; + + for (int i = 0; i < newVal[0].length; i++) { + newVal[0][i] = new PropertyValue(); + } + + newVal[0][1].Name = "TokenType"; + newVal[0][1].Value = "TokenEntryText"; + newVal[0][0].Name = "Text"; + newVal[0][0].Value = "BaseIndex"; + + indProp.replaceByIndex(0, newVal); + } catch (com.sun.star.lang.WrappedTargetException e) { + log.println("Exception occurred while testing LevelFormat"); + e.printStackTrace(log); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + log.println("Exception occurred while testing LevelFormat"); + e.printStackTrace(log); + } catch (com.sun.star.lang.IllegalArgumentException e) { + log.println("Exception occurred while testing LevelFormat"); + e.printStackTrace(log); + } + + return indProp; + } + + @Override + protected void checkResult(String propName, Object oldValue, + Object newValue, Object resValue, + Exception exception) + throws Exception { + + super.checkResult(propName, oldValue, newValue, resValue, exception); + + PropertyValue[][] res = (PropertyValue[][]) UnoRuntime.queryInterface( + XIndexAccess.class, + resValue).getByIndex(0); + + log.println("Result:"); + printLevelFormatProperty(resValue); + + boolean result = (res.length != oldVal.length) || + !util.ValueComparer.equalValue(res, oldVal); + + tRes.tested(propName, result); + } + }); + } + + /** + * Outputs full description of 'LevelFormat' property + * value into log. + */ + private void printLevelFormatProperty(Object value) { + XIndexReplace indProp = UnoRuntime.queryInterface( + XIndexReplace.class, value); + PropertyValue[][] val = null; + + try { + log.println(" \u0421ollection has " + indProp.getCount() + + " elements : "); + + for (int i = 0; i < indProp.getCount(); i++) { + val = (PropertyValue[][]) indProp.getByIndex(i); + + log.println(" " + i + ": has " + val.length + " levels :"); + + for (int j = 0; j < val.length; j++) { + log.println(" " + j + " level :"); + + for (int k = 0; k < val[j].length; k++) { + log.println(" " + val[j][k].Name + "=" + + val[j][k].Value); + } + } + } + } catch (com.sun.star.lang.WrappedTargetException e) { + log.println("Exception occurred while printing LevelFormat"); + e.printStackTrace(log); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + log.println("Exception occurred while printing LevelFormat"); + e.printStackTrace(log); + } + } +} // finish class _NumberingRules diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java b/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java new file mode 100644 index 000000000..a80d7488a --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java @@ -0,0 +1,36 @@ +/* + * 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.text; + +import lib.MultiPropertyTest; + +/** +* Testing com.sun.star.text.BaseIndexMark +* service properties : +*

+* Properties testing is automated by lib.MultiPropertyTest. +* @see com.sun.star.text.BaseIndexMark +*/ +public class _BaseIndexMark extends MultiPropertyTest { + +} // finish class _BaseIndexMark + + diff --git a/qadevOOo/tests/java/ifc/text/_CellProperties.java b/qadevOOo/tests/java/ifc/text/_CellProperties.java new file mode 100644 index 000000000..25b739cc7 --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_CellProperties.java @@ -0,0 +1,150 @@ +/* + * 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.text; + +import lib.MultiPropertyTest; + +import com.sun.star.container.XNameContainer; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Type; +import com.sun.star.xml.AttributeData; + +/** +* Testing com.sun.star.text.CellProperties +* service properties : +*

+* This test needs the following object relations : +*

+* The following predefined files needed to complete the test: +*

+* Properties testing is automated by lib.MultiPropertyTest. +* @see com.sun.star.text.CellProperties +*/ +public class _CellProperties extends MultiPropertyTest { + + /** + * This property can be void, so new value must be specified from + * corresponding object relation. + */ + public void _TextSection() { + log.println("Testing with custom Property tester") ; + testProperty("TextSection", new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + return tEnv.getObjRelation("CellProperties.TextSection"); + } + }); + } + + + /** + * Redefined method returns value, that differs from property value. + */ + public void _BackColor() { + final Short val1 = Short.valueOf( (short) 4 ); + final Short val2 = Short.valueOf( (short) 6 ); + log.println("Testing with custom Property tester") ; + testProperty("BackColor", new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + if ( oldValue.equals(val1) ) + return val2; + else + return val1; + } + }); + } + + + /** + * Redefined method returns value, that differs from property value. + */ + public void _BackGraphicURL() { + log.println("Testing with custom Property tester") ; + testProperty("BackGraphicURL", new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + if (oldValue.equals(util.utils.getFullTestURL + ("space-metal.jpg"))) + return util.utils.getFullTestURL("crazy-blue.jpg"); + else + return util.utils.getFullTestURL("space-metal.jpg"); + } + }); + } + + + /** + * Redefined method returns object, that contains changed property value. + */ + public void _UserDefinedAttributes() { + log.println("Testing with custom property tester"); + testProperty("UserDefinedAttributes", new PropertyTester() { + @Override + protected Object getNewValue(String propName, Object oldValue) { + XNameContainer NC = null; + try { + NC = (XNameContainer) + AnyConverter.toObject(new Type(XNameContainer.class),oldValue); + NC.insertByName("MyAttribute", + new AttributeData("","CDATA","Value")); + } catch ( com.sun.star.lang.IllegalArgumentException e ) { + log.println("Failed to check 'UserDefinedAttributes'"); + e.printStackTrace(log); + } catch ( com.sun.star.lang.WrappedTargetException e ) { + log.println("Failed to check 'UserDefinedAttributes'"); + e.printStackTrace(log); + } catch ( com.sun.star.container.ElementExistException e ) { + log.println("Failed to check 'UserDefinedAttributes'"); + e.printStackTrace(log); + } + return NC; + } + }); + } + +} //finish class _CellProperties + diff --git a/qadevOOo/tests/java/ifc/text/_CellRange.java b/qadevOOo/tests/java/ifc/text/_CellRange.java new file mode 100644 index 000000000..c2942a1c5 --- /dev/null +++ b/qadevOOo/tests/java/ifc/text/_CellRange.java @@ -0,0 +1,94 @@ +/* + * 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.text; + +import lib.MultiPropertyTest; + +/** +* Testing com.sun.star.text.CellRange +* service properties : +*