summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/mod')
-rw-r--r--qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java122
-rw-r--r--qadevOOo/tests/java/mod/_acceptor/Acceptor.java127
-rw-r--r--qadevOOo/tests/java/mod/_acceptor/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_adabas/ODriver.java121
-rw-r--r--qadevOOo/tests/java/mod/_ado/ODriver.java105
-rw-r--r--qadevOOo/tests/java/mod/_basctl/AccessibleShape.java155
-rw-r--r--qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java118
-rw-r--r--qadevOOo/tests/java/mod/_brdgfctr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_bridgefac.uno/BridgeFactory.java116
-rw-r--r--qadevOOo/tests/java/mod/_bridgefac.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java186
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java176
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java183
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java169
-rw-r--r--qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java71
-rw-r--r--qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java110
-rw-r--r--qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java131
-rw-r--r--qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java86
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java57
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java54
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java51
-rw-r--r--qadevOOo/tests/java/mod/_connector.uno/Connector.java122
-rw-r--r--qadevOOo/tests/java/mod/_connector.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_connectr/Connector.java125
-rw-r--r--qadevOOo/tests/java/mod/_connectr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_corefl/CoreReflection.java87
-rw-r--r--qadevOOo/tests/java/mod/_corefl/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_corereflection.uno/CoreReflection.java83
-rw-r--r--qadevOOo/tests/java/mod/_corereflection.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java117
-rw-r--r--qadevOOo/tests/java/mod/_cpld/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java421
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java110
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java392
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java91
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java149
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java245
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java100
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java332
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java117
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java325
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ORowSet.java644
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java157
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java283
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java485
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java380
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java114
-rw-r--r--qadevOOo/tests/java/mod/_defreg/NestedRegistry.java202
-rw-r--r--qadevOOo/tests/java/mod/_defreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dtrans/generic.java77
-rw-r--r--qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java101
-rw-r--r--qadevOOo/tests/java/mod/_file/calc/ODriver.java112
-rw-r--r--qadevOOo/tests/java/mod/_file/dbase/ODriver.java109
-rw-r--r--qadevOOo/tests/java/mod/_file/flat/ODriver.java107
-rw-r--r--qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java86
-rw-r--r--qadevOOo/tests/java/mod/_fileacc/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_fop/FolderPicker.java102
-rw-r--r--qadevOOo/tests/java/mod/_forms/GenericModelTest.java565
-rw-r--r--qadevOOo/tests/java/mod/_forms/OButtonControl.java223
-rw-r--r--qadevOOo/tests/java/mod/_forms/OButtonModel.java134
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java237
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java149
-rw-r--r--qadevOOo/tests/java/mod/_forms/OComboBoxControl.java244
-rw-r--r--qadevOOo/tests/java/mod/_forms/OComboBoxModel.java164
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCurrencyControl.java251
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCurrencyModel.java159
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODatabaseForm.java901
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODateControl.java243
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODateModel.java178
-rw-r--r--qadevOOo/tests/java/mod/_forms/OEditControl.java261
-rw-r--r--qadevOOo/tests/java/mod/_forms/OEditModel.java170
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFileControlModel.java210
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFixedTextModel.java128
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormattedControl.java240
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java162
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormsCollection.java184
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGridControlModel.java431
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java214
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java128
-rw-r--r--qadevOOo/tests/java/mod/_forms/OHiddenModel.java203
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageButtonControl.java219
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageButtonModel.java132
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageControlControl.java220
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageControlModel.java161
-rw-r--r--qadevOOo/tests/java/mod/_forms/OListBoxControl.java180
-rw-r--r--qadevOOo/tests/java/mod/_forms/OListBoxModel.java236
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java180
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONavigationBarModel.java81
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONumericControl.java245
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONumericModel.java160
-rw-r--r--qadevOOo/tests/java/mod/_forms/OPatternControl.java243
-rw-r--r--qadevOOo/tests/java/mod/_forms/OPatternModel.java166
-rw-r--r--qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java222
-rw-r--r--qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java173
-rw-r--r--qadevOOo/tests/java/mod/_forms/OScrollBarModel.java99
-rw-r--r--qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java102
-rw-r--r--qadevOOo/tests/java/mod/_forms/OTimeControl.java258
-rw-r--r--qadevOOo/tests/java/mod/_forms/OTimeModel.java237
-rw-r--r--qadevOOo/tests/java/mod/_forms/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_fps/FilePicker.java133
-rw-r--r--qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java91
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/ControlMenuController.java110
-rw-r--r--qadevOOo/tests/java/mod/_fwk/Desktop.java137
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java174
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java74
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DocumentProperties.java130
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/FontMenuController.java60
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java60
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/FooterMenuController.java60
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/FormatMenuController.java60
-rw-r--r--qadevOOo/tests/java/mod/_fwk/Frame.java119
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/HeaderMenuController.java60
-rw-r--r--qadevOOo/tests/java/mod/_fwk/JobExecutor.java317
-rw-r--r--qadevOOo/tests/java/mod/_fwk/JobHandler.java91
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/LayoutManager.java124
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/MacrosMenuController.java60
-rw-r--r--qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java80
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/MenuBarFactory.java58
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/ModuleManager.java281
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java245
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java60
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/ObjectMenuController.java97
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java124
-rw-r--r--qadevOOo/tests/java/mod/_fwk/ServiceHandler.java80
-rw-r--r--qadevOOo/tests/java/mod/_fwk/SoundHandler.java81
-rw-r--r--qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java74
-rw-r--r--qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java60
-rw-r--r--qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java60
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/UICommandDescription.java61
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java205
-rwxr-xr-xqadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java101
-rw-r--r--qadevOOo/tests/java/mod/_fwk/URLTransformer.java73
-rw-r--r--qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java115
-rw-r--r--qadevOOo/tests/java/mod/_fwl/FilterFactory.java205
-rw-r--r--qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java113
-rw-r--r--qadevOOo/tests/java/mod/_fwl/PathSettings.java161
-rw-r--r--qadevOOo/tests/java/mod/_fwl/SubstituteVariables.java94
-rw-r--r--qadevOOo/tests/java/mod/_fwl/TypeDetection.java187
-rw-r--r--qadevOOo/tests/java/mod/_i18n/BreakIterator.java123
-rw-r--r--qadevOOo/tests/java/mod/_i18n/CalendarImpl.java80
-rw-r--r--qadevOOo/tests/java/mod/_i18n/ChapterCollator.java84
-rw-r--r--qadevOOo/tests/java/mod/_i18n/CharacterClassification.java87
-rw-r--r--qadevOOo/tests/java/mod/_i18n/Collator.java81
-rw-r--r--qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java86
-rw-r--r--qadevOOo/tests/java/mod/_i18n/LocaleData.java85
-rw-r--r--qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java91
-rw-r--r--qadevOOo/tests/java/mod/_i18n/TextSearch.java81
-rw-r--r--qadevOOo/tests/java/mod/_i18n/Transliteration.java81
-rw-r--r--qadevOOo/tests/java/mod/_implreg.uno/ImplementationRegistration.java81
-rw-r--r--qadevOOo/tests/java/mod/_implreg.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java86
-rw-r--r--qadevOOo/tests/java/mod/_impreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_insp/Introspection.java81
-rw-r--r--qadevOOo/tests/java/mod/_insp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_introspection.uno/Introspection.java76
-rw-r--r--qadevOOo/tests/java/mod/_introspection.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_inv/Invocation.java106
-rw-r--r--qadevOOo/tests/java/mod/_inv/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java75
-rw-r--r--qadevOOo/tests/java/mod/_invadp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_invocadapt.uno/InvocationAdapterFactory.java74
-rw-r--r--qadevOOo/tests/java/mod/_invocadapt.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_invocation.uno/Invocation.java104
-rw-r--r--qadevOOo/tests/java/mod/_invocation.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java96
-rw-r--r--qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java101
-rw-r--r--qadevOOo/tests/java/mod/_javavm.uno/JavaVirtualMachine.java75
-rw-r--r--qadevOOo/tests/java/mod/_javavm.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java123
-rw-r--r--qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java77
-rw-r--r--qadevOOo/tests/java/mod/_jen/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_lng/DicList.java113
-rw-r--r--qadevOOo/tests/java/mod/_lng/LinguProps.java98
-rw-r--r--qadevOOo/tests/java/mod/_lng/LngSvcMgr.java92
-rw-r--r--qadevOOo/tests/java/mod/_lnn/Hyphenator.java111
-rw-r--r--qadevOOo/tests/java/mod/_lnn/SpellChecker.java109
-rw-r--r--qadevOOo/tests/java/mod/_lnn/Thesaurus.java98
-rw-r--r--qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java90
-rw-r--r--qadevOOo/tests/java/mod/_mozab/MozabDriver.java104
-rw-r--r--qadevOOo/tests/java/mod/_namingservice.uno/NamingService.java99
-rw-r--r--qadevOOo/tests/java/mod/_namingservice/NamingService.java102
-rw-r--r--qadevOOo/tests/java/mod/_namingservice/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java198
-rw-r--r--qadevOOo/tests/java/mod/_nestedreg.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_odbc/ODBCDriver.java101
-rw-r--r--qadevOOo/tests/java/mod/_pcr/ObjectInspector.java215
-rw-r--r--qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java174
-rw-r--r--qadevOOo/tests/java/mod/_proxyfac.uno/ProxyFactory.java76
-rw-r--r--qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java78
-rw-r--r--qadevOOo/tests/java/mod/_proxyfac/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java144
-rw-r--r--qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java145
-rwxr-xr-xqadevOOo/tests/java/mod/_qadevOOo/SelfTest.java92
-rw-r--r--qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java131
-rw-r--r--qadevOOo/tests/java/mod/_rdbtdp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_regtypeprov.uno/RegistryTypeDescriptionProvider.java126
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge.uno/various.java309
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge/various.java305
-rw-r--r--qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java220
-rw-r--r--qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java193
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java200
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java208
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java202
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java229
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java172
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java242
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java282
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java233
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java208
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java293
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java222
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java168
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java178
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java213
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java152
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java175
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java152
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java150
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java106
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java109
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java158
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java326
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java196
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java157
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java141
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellObj.java216
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java312
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java264
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java151
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java195
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java172
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellsObj.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScChartObj.java289
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScChartsObj.java273
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java116
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java245
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java208
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java371
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java369
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java367
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java396
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java183
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java414
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java402
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java355
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java195
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java258
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java154
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java90
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java162
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java135
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java159
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java118
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java130
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java241
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java221
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java190
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java228
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java278
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java149
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java138
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java131
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java187
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java165
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java408
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java166
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java134
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java113
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java126
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java133
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java145
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java148
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java116
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java97
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java141
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java105
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java238
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java129
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java207
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java128
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java166
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java154
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java147
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScModelObj.java232
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java177
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java178
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java133
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScScenariosObj.java174
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScShapeObj.java117
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java193
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java151
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java84
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java110
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java121
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java216
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleObj.java270
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java154
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java169
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTabViewObj.java283
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java176
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java153
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java230
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java208
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableRowObj.java161
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java148
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java421
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java171
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java164
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java145
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java139
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java209
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLContentExporter.java216
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLContentImporter.java198
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLExporter.java224
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLImporter.java195
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java205
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java197
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java206
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java219
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java211
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java215
-rw-r--r--qadevOOo/tests/java/mod/_sc/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccArea.java121
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccAxis.java119
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDataPoint.java120
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDataSeries.java120
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDiagram.java120
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccFloor.java145
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccGrid.java121
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccLegend.java119
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccLegendEntry.java119
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java124
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccTitle.java119
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccWall.java144
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java133
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartAxis.java130
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartData.java102
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java106
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartDocument.java172
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartView.java147
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDataPoint.java162
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDataRow.java169
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDiagram.java413
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartArea.java122
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartGrid.java122
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartLegend.java142
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartLine.java150
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartTitle.java120
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java183
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java182
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java191
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java303
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java337
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java334
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java334
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java334
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java111
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDrawPage.java216
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java129
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java189
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdLayer.java139
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdLayerManager.java171
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdMasterPage.java194
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java122
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java153
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java299
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java246
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoPresView.java301
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java222
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java243
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java212
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java199
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXPresentation.java164
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXShape.java219
-rw-r--r--qadevOOo/tests/java/mod/_sd/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_servicemgr.uno/OServiceManager.java169
-rw-r--r--qadevOOo/tests/java/mod/_servicemgr.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java104
-rw-r--r--qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java97
-rw-r--r--qadevOOo/tests/java/mod/_sfx/FrameLoader.java103
-rw-r--r--qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java107
-rw-r--r--qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java133
-rw-r--r--qadevOOo/tests/java/mod/_shlibloader.uno/DLLComponentLoader.java117
-rw-r--r--qadevOOo/tests/java/mod/_shlibloader.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_simplereg.uno/SimpleRegistry.java163
-rw-r--r--qadevOOo/tests/java/mod/_simplereg.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java167
-rw-r--r--qadevOOo/tests/java/mod/_simreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmEditAccessible.java178
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java182
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmModel.java100
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLExporter.java197
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLImporter.java170
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java198
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java198
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java198
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java180
-rw-r--r--qadevOOo/tests/java/mod/_smgr/OServiceManager.java171
-rw-r--r--qadevOOo/tests/java/mod/_smgr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java121
-rw-r--r--qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java83
-rw-r--r--qadevOOo/tests/java/mod/_stm/DataInputStream.java197
-rw-r--r--qadevOOo/tests/java/mod/_stm/DataOutputStream.java182
-rw-r--r--qadevOOo/tests/java/mod/_stm/MarkableInputStream.java147
-rw-r--r--qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java207
-rw-r--r--qadevOOo/tests/java/mod/_stm/ObjectInputStream.java299
-rw-r--r--qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java320
-rw-r--r--qadevOOo/tests/java/mod/_stm/Pipe.java115
-rw-r--r--qadevOOo/tests/java/mod/_stm/Pump.java190
-rw-r--r--qadevOOo/tests/java/mod/_stm/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java194
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java179
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java144
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java204
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java296
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java317
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/Pipe.java111
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/Pump.java187
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java202
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java255
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java240
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java238
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java226
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java287
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java264
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java162
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java194
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java209
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java249
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java295
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java125
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java162
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java129
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java151
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java141
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java149
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java158
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java147
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleShape.java128
-rw-r--r--qadevOOo/tests/java/mod/_svx/GraphicExporter.java237
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxDrawPage.java224
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java251
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java263
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShape.java227
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java247
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java148
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java204
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeControl.java158
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java169
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java195
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java265
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java278
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java94
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoText.java170
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java150
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java152
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java144
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java161
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java156
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java157
-rw-r--r--qadevOOo/tests/java/mod/_svx/package.html6
-rwxr-xr-xqadevOOo/tests/java/mod/_sw/CharacterStyle.java207
-rwxr-xr-xqadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java201
-rw-r--r--qadevOOo/tests/java/mod/_sw/DocumentSettings.java85
-rwxr-xr-xqadevOOo/tests/java/mod/_sw/PageStyle.java201
-rwxr-xr-xqadevOOo/tests/java/mod/_sw/ParagraphStyle.java192
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java187
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java195
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java195
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java188
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java286
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java139
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java154
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java174
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java156
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java187
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java177
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java89
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java217
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java178
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBodyText.java148
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBookmark.java121
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBookmarks.java119
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXCell.java135
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXCellRange.java169
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java123
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java144
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java145
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java135
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDrawPage.java164
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java134
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java176
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java111
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnote.java158
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java132
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java176
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnotes.java134
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFrames.java143
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java198
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java119
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXMailMerge.java439
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXModule.java90
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java178
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXParagraph.java279
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java154
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java110
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySet.java85
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java97
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java142
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java164
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXShape.java133
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyle.java248
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java111
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java197
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableCellText.java172
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableColumns.java136
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableRows.java128
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextColumns.java184
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextCursor.java316
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java123
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDocument.java268
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java173
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java137
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextField.java168
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java140
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java140
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrame.java159
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java156
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java207
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java165
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortion.java187
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java161
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextRange.java99
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextRanges.java129
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSearch.java131
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSection.java187
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSections.java152
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTable.java261
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java124
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java127
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTables.java154
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextView.java297
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java122
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXViewSettings.java112
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentExporter.java196
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentImporter.java178
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLExporter.java199
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLImporter.java171
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java189
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java209
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java208
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java203
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java188
-rw-r--r--qadevOOo/tests/java/mod/_sw/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java60
-rw-r--r--qadevOOo/tests/java/mod/_sysdtrans/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java60
-rw-r--r--qadevOOo/tests/java/mod/_tcv/TypeConverter.java71
-rw-r--r--qadevOOo/tests/java/mod/_tcv/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java89
-rw-r--r--qadevOOo/tests/java/mod/_tdmgr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java83
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java246
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java261
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java246
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java139
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java154
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java235
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java209
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleList.java237
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java250
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java241
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java196
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java156
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java203
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java170
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java230
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java310
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java186
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java182
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java197
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java282
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java292
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java188
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java207
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java207
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java105
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java191
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabController.java143
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java105
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/Toolkit.java142
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java156
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java87
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java164
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java87
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java160
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java252
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java66
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java85
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java166
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java254
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java189
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java161
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java97
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java152
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java167
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java85
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java151
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java160
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java161
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java171
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java94
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java152
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java97
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java62
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java179
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java149
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java69
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java303
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java84
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_typeconverter.uno/TypeConverter.java66
-rw-r--r--qadevOOo/tests/java/mod/_typeconverter.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_typemgr.uno/TypeDescriptionManager.java84
-rw-r--r--qadevOOo/tests/java/mod/_typemgr.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java77
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java68
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbStore.java77
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java88
-rw-r--r--qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java82
-rw-r--r--qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java90
-rw-r--r--qadevOOo/tests/java/mod/_ucpfile/FileProvider.java80
-rw-r--r--qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java81
-rw-r--r--qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java80
-rw-r--r--qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java68
-rw-r--r--qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java83
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java118
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java72
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java81
-rw-r--r--qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java82
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver.uno/UnoUrlResolver.java68
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver.uno/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java81
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java201
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java206
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java204
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java204
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java191
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java185
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java215
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java211
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java215
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java211
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java205
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java189
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java211
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java199
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java214
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java197
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java207
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java221
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java210
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java180
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java206
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java189
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java219
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java213
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java209
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java202
694 files changed, 110503 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java
new file mode 100644
index 000000000000..9351ff0e145b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._acceptor.uno;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+* Here <code>com.sun.star.connection.Acceptor</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.connection.Acceptor
+* @see com.sun.star.connection.XAcceptor
+* @see com.sun.star.connection.XConnector
+* @see ifc.connection._XAcceptor
+*/
+public class Acceptor extends TestCase {
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 10000;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ public void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. <p>
+ * Creates <code>Acceptor</code> service and passed as relation
+ * connection string where port for accepting is unique among
+ * different object test threads. <p>
+ * The following object relations are created :
+ * <ul>
+ * <li> <code>'XAcceptor.connectStr'</code> : String variable for
+ * <code>XAcceptor</code> interface test. Has the following format :
+ * <code>'socket,host=<SOHost>,port=<UniquePort>' where <SOHost> is
+ * the host where StarOffice is started. </li>
+ * <li> <code>'Acceptor.Port'</code> : Integer value which specifies
+ * port on which Acceptor must listen, and which is required
+ * when disposing environment, to free this port number. </li>
+ * <ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface acceptor = null;
+
+ try {
+ acceptor = (XInterface)
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.connection.Acceptor");
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+ oObj = acceptor;
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // adding connection string as relation
+ tEnv.addObjRelation("XAcceptor.connectStr",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Acceptor.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+
+ curPort = ((Integer)tEnv.getObjRelation("Acceptor.Port")).intValue();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
new file mode 100644
index 000000000000..4ab9809c9bb4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._acceptor;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.connection.Acceptor</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.connection.Acceptor
+* @see com.sun.star.connection.XAcceptor
+* @see com.sun.star.connection.XConnector
+* @see ifc.connection._XAcceptor
+*/
+public class Acceptor extends TestCase {
+
+
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 10000;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ public void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. <p>
+ * Creates <code>Acceptor</code> service and passed as relation
+ * connection string where port for accepting is unique among
+ * different object test threads. <p>
+ * The following object relations are created :
+ * <ul>
+ * <li> <code>'XAcceptor.connectStr'</code> : String variable for
+ * <code>XAcceptor</code> interface test. Has the following format :
+ * <code>'socket,host=<SOHost>,port=<UniquePort>' where <SOHost> is
+ * the host where StarOffice is started. </li>
+ * <li> <code>'Acceptor.Port'</code> : Integer value which specifies
+ * port on which Acceptor must listen, and which is required
+ * when disposing environment, to free this port number. </li>
+ * <ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ XInterface acceptor = null;
+
+ try {
+ acceptor = (XInterface)
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.connection.Acceptor");
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+ oObj = acceptor;
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // adding connection string as relation
+ tEnv.addObjRelation("XAcceptor.connectStr",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Acceptor.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+
+ curPort = ((Integer)tEnv.getObjRelation("Acceptor.Port")).intValue();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_acceptor/package.html b/qadevOOo/tests/java/mod/_acceptor/package.html
new file mode 100644
index 000000000000..569314727946
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_acceptor/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'acceptor'.</P>
+</BODY>
+</HTML>
diff --git a/qadevOOo/tests/java/mod/_adabas/ODriver.java b/qadevOOo/tests/java/mod/_adabas/ODriver.java
new file mode 100644
index 000000000000..76dce8f9553c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_adabas/ODriver.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._adabas;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class ODriver extends TestCase {
+ /**
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>adabas.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments.
+ * The values for list are obtained from the parameter
+ * <code>adabas.user</code> and <code>adabas.password</code>.</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.comp.sdbcx.adabas.ODriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String adabasURL = (String) Param.get("adabas.url");
+ if (adabasURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'adabas.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:adabas:" + adabasURL);
+
+
+ String user = (String) Param.get("adabas.user");
+ if (user == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'adabas.user' from ini-file"));
+ }
+ String password = (String) Param.get("adabas.password");
+ if (password == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'adabas.password' from ini-file"));
+ }
+ PropertyValue[] info = new PropertyValue[2];
+ info[0] = new PropertyValue();
+ info[0].Name = "user"; info[0].Value = user;
+ info[1] = new PropertyValue();
+ info[1].Name = "password"; info[1].Value = password;
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_ado/ODriver.java b/qadevOOo/tests/java/mod/_ado/ODriver.java
new file mode 100644
index 000000000000..11a00fb7c8fd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ado/ODriver.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ado;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class ODriver extends TestCase {
+ /**
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>ado.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments.
+ * </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.comp.sdbc.ado.ODriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String adoURL = (String) Param.get("ado.url");
+ if (adoURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'ado.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:ado:" + adoURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java
new file mode 100644
index 000000000000..c59a731d8838
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+package mod._basctl;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatchHelper;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.WriterTools;
+import util.utils;
+
+public class AccessibleShape extends TestCase {
+
+ XTextDocument xTextDoc = null;
+ XInterface oObj = null;
+
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("Cleaning up");
+ DesktopTools.closeDoc(xTextDoc);
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+ Object o = xMSF.createInstance("com.sun.star.frame.Desktop");
+ XDesktop xDesk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, o);
+ DesktopTools.closeDoc(xDesk.getCurrentFrame());
+ } catch (Exception e) {
+ log.println("Couldn't close IDE");
+ }
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ log.println( "creating a test environment" );
+ String aURL=utils.getFullTestURL("basDialog.odt");
+ xTextDoc = WriterTools.loadTextDoc(xMSF,aURL);
+ XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
+ XFrame xFrame = xModel.getCurrentController().getFrame();
+ XDispatchProvider xDPP = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, xFrame);
+
+ log.println( "opening the basic dialog editor" );
+ try {
+ Object o = xMSF.createInstance("com.sun.star.frame.DispatchHelper");
+ XDispatchHelper xDPH = (XDispatchHelper) UnoRuntime.queryInterface(XDispatchHelper.class, o);
+ PropertyValue[] aArgs = new PropertyValue[4];
+ aArgs[0] = new PropertyValue();
+ aArgs[0].Name = "Document";
+ aArgs[0].Value = aURL;
+ aArgs[1] = new PropertyValue();
+ aArgs[1].Name = "LibName";
+ aArgs[1].Value = "basctl";
+ aArgs[2] = new PropertyValue();
+ aArgs[2].Name = "Name";
+ aArgs[2].Value = "Dialog1";
+ aArgs[3] = new PropertyValue();
+ aArgs[3].Name = "Type";
+ aArgs[3].Value = "Dialog";
+ xDPH.executeDispatch(xDPP, ".uno:BasicIDEAppear", "", 0, aArgs);
+ } catch (Exception e) {
+ throw new StatusException("Couldn't open Basic Dialog",e);
+ }
+
+ utils.shortWait(3000);
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ final XWindow basicIDE = xFrame.getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(basicIDE);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("Destroy", Boolean.TRUE);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle oldPosSize = basicIDE.getPosSize();
+ Rectangle newPosSize = new Rectangle();
+ newPosSize.Width = oldPosSize.Width/2;
+ newPosSize.Height = oldPosSize.Height/2;
+ newPosSize.X = oldPosSize.X + 20;
+ newPosSize.Y = oldPosSize.Y + 20;
+ basicIDE.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, PosSize.POSSIZE);
+ utils.shortWait(1000);
+ basicIDE.setPosSize(oldPosSize.X, oldPosSize.Y, oldPosSize.Width,
+ oldPosSize.Height, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+
+
+
+}
diff --git a/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java b/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java
new file mode 100644
index 000000000000..1a287789a9ea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._brdgfctr;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Tests <code>com.sun.star.bridge.BridgeFactory</code>
+* service. <p>
+* @see com.sun.star.bridge.XBridgeFactory
+* @see com.sun.star.lang.XComponent
+* @see ifc.bridge._XBridgeFactory
+* @see ifc.lang._XComponent
+*/
+public class BridgeFactory extends TestCase {
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ }
+
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 50003 ;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Just creates <code>com.sun.star.bridge.BridgeFactory</code>
+ * service as object to be tested.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null ;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.bridge.BridgeFactory") ;
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ if (oObj == null)
+ throw new StatusException("Can't create service",
+ new NullPointerException());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ // adding connection string as relation
+ tEnv.addObjRelation("CNNCTSTR",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Connector.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+ curPort = ((Integer)tEnv.getObjRelation("Connector.Port")).intValue() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_brdgfctr/package.html b/qadevOOo/tests/java/mod/_brdgfctr/package.html
new file mode 100644
index 000000000000..d6abad1bb7ea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_brdgfctr/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'brdgfctr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_bridgefac.uno/BridgeFactory.java b/qadevOOo/tests/java/mod/_bridgefac.uno/BridgeFactory.java
new file mode 100644
index 000000000000..c4203e07cff5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_bridgefac.uno/BridgeFactory.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._bridgefac.uno;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+* Tests <code>com.sun.star.bridge.BridgeFactory</code>
+* service. <p>
+* @see com.sun.star.bridge.XBridgeFactory
+* @see com.sun.star.lang.XComponent
+* @see ifc.bridge._XBridgeFactory
+* @see ifc.lang._XComponent
+*/
+public class BridgeFactory extends TestCase {
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ }
+
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 50003 ;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Just creates <code>com.sun.star.bridge.BridgeFactory</code>
+ * service as object to be tested.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null ;
+
+ try {
+ oObj = (XInterface)
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.bridge.BridgeFactory") ;
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ if (oObj == null)
+ throw new StatusException("Can't create service",
+ new NullPointerException());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ // adding connection string as relation
+ tEnv.addObjRelation("CNNCTSTR",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Connector.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+ curPort = ((Integer)tEnv.getObjRelation("Connector.Port")).intValue() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_bridgefac.uno/package.html b/qadevOOo/tests/java/mod/_bridgefac.uno/package.html
new file mode 100644
index 000000000000..d6abad1bb7ea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_bridgefac.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'brdgfctr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java
new file mode 100644
index 000000000000..cb83a6c2ff1c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cached;
+
+import com.sun.star.beans.Property;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.NumberedSortingInfo;
+import com.sun.star.ucb.OpenCommandArgument2;
+import com.sun.star.ucb.OpenMode;
+import com.sun.star.ucb.XCachedContentResultSetStubFactory;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.ucb.XContent;
+import com.sun.star.ucb.XContentIdentifier;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.AnyConverter;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.CachedContentResultSetFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XCachedContentResultSetFactory</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XCachedContentResultSetFactory
+* @see com.sun.star.ucb.CachedContentResultSetFactory
+* @see ifc.ucb._XCachedContentResultSetFactory
+*/
+public class CachedContentResultSetFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.CachedContentResultSetFactory</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CachedContentResultSetStub'</code> for
+ * {@link ifc.XCachedContentResultSetFactory} : the destination
+ * interface requires as its parameter an instance of
+ * <code>CachedContentResultSetStub</code> service. It is created
+ * using <code>UniversalContentBroker</code> and queriing it for
+ * <code>PackageContent</code> which represents JAR file mentioned
+ * above. Then the dynamic list of file contents (entries) is retrieved,
+ * and a static list is created from it. Using
+ * <code>CachedContentResultSetStubFactory</code> service a stub of
+ * Cached result set is created which is relation required.
+ * </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object relationContainer = null ;
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.CachedContentResultSetFactory" );
+
+ // adding one child container
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // creating relation for XCachedContentResultSetFactory
+ XResultSet resSetStub = null ;
+ try {
+ Object oUCB = xMSF.createInstanceWithArguments
+ ("com.sun.star.ucb.UniversalContentBroker",
+ new Object[] {"Local", "Office"}) ;
+
+ XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ;
+
+ String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ;
+ String escUrl = "" ;
+
+ // In base URL of a JAR file in content URL all directory
+ // separators ('/') must be replaced with escape symbol '%2F'.
+ int idx = url.indexOf("/") ;
+ int lastIdx = -1 ;
+ while (idx >= 0) {
+ escUrl += url.substring(lastIdx + 1, idx) + "%2F" ;
+ lastIdx = idx ;
+ idx = url.indexOf("/", idx + 1) ;
+ }
+ escUrl += url.substring(lastIdx + 1) ;
+ String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ;
+
+ XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;
+
+ XContentProvider cntProv = (XContentProvider)
+ UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;
+
+ XContent cnt = cntProv.queryContent(CI) ;
+
+ XCommandProcessor cmdProc = (XCommandProcessor)
+ UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;
+
+ Property prop = new Property() ;
+ prop.Name = "Title" ;
+
+ Command cmd = new Command("open", -1, new OpenCommandArgument2
+ (OpenMode.ALL, 10000, null, new Property[] {prop},
+ new NumberedSortingInfo[0])) ;
+
+ XDynamicResultSet dynResSet = null;
+ try {
+ dynResSet = (XDynamicResultSet)
+ AnyConverter.toObject(new Type(XDynamicResultSet.class),
+ cmdProc.execute(cmd, 0, null));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("Couldn't convert Any ",iae);
+ }
+
+ XResultSet resSet = dynResSet.getStaticResultSet() ;
+
+ Object oStubFactory = xMSF.createInstance
+ ("com.sun.star.ucb.CachedContentResultSetStubFactory") ;
+
+ XCachedContentResultSetStubFactory xStubFactory =
+ (XCachedContentResultSetStubFactory) UnoRuntime.queryInterface
+ (XCachedContentResultSetStubFactory.class, oStubFactory) ;
+
+ resSetStub = xStubFactory.createCachedContentResultSetStub(resSet) ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create relation." );
+ e.printStackTrace(log) ;
+ throw new StatusException( "Can't create relation", e );
+ }
+
+ tEnv.addObjRelation("CachedContentResultSetStub", resSetStub) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java
new file mode 100644
index 000000000000..ad908857fd75
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cached;
+
+import com.sun.star.beans.Property;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.NumberedSortingInfo;
+import com.sun.star.ucb.OpenCommandArgument2;
+import com.sun.star.ucb.OpenMode;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.ucb.XContent;
+import com.sun.star.ucb.XContentIdentifier;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.AnyConverter;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.CachedContentResultSetStubFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XCachedContentResultSetStubFactory</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XCachedContentResultSetStubFactory
+* @see com.sun.star.ucb.CachedContentResultSetStubFactory
+* @see ifc.ucb._XCachedContentResultSetStubFactory
+*/
+public class CachedContentResultSetStubFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.CachedContentResultSetStubFactory</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ContentResultSet'</code> for
+ * {@link ifc.XCachedContentResultSetStubFactory} : the destination
+ * interface requires as its parameter an instance of
+ * <code>ContentResultSet</code> service. It is created
+ * using <code>UniversalContentBroker</code> and queriing it for
+ * <code>PackageContent</code> which represents JAR file mentioned
+ * above. Then the dynamic list of file contents (entries) is retrieved,
+ * and a static list is created from it. It represents
+ * <code>ContentResultSet</code> service instance required.
+ * </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object relationContainer = null ;
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.CachedContentResultSetStubFactory" );
+
+ // adding one child container
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // creating relation for XCachedContentResultSetStubFactory
+ XResultSet resSet = null ;
+ try {
+ Object oUCB = xMSF.createInstanceWithArguments
+ ("com.sun.star.ucb.UniversalContentBroker",
+ new Object[] {"Local", "Office"}) ;
+
+ XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ;
+
+ String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ;
+ String escUrl = "" ;
+
+ // In base URL of a JAR file in content URL all directory
+ // separators ('/') must be replaced with escape symbol '%2F'.
+ int idx = url.indexOf("/") ;
+ int lastIdx = -1 ;
+ while (idx >= 0) {
+ escUrl += url.substring(lastIdx + 1, idx) + "%2F" ;
+ lastIdx = idx ;
+ idx = url.indexOf("/", idx + 1) ;
+ }
+ escUrl += url.substring(lastIdx + 1) ;
+ String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ;
+ log.println("Getting Content of '" + cntUrl + "'") ;
+
+ XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;
+
+ XContentProvider cntProv = (XContentProvider)
+ UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;
+
+ XContent cnt = cntProv.queryContent(CI) ;
+
+ XCommandProcessor cmdProc = (XCommandProcessor)
+ UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;
+
+ Property prop = new Property() ;
+ prop.Name = "Title" ;
+
+ Command cmd = new Command("open", -1, new OpenCommandArgument2
+ (OpenMode.ALL, 10000, null, new Property[] {prop},
+ new NumberedSortingInfo[0])) ;
+
+ XDynamicResultSet dynResSet = null;
+ try {
+ dynResSet = (XDynamicResultSet)
+ AnyConverter.toObject(new Type(XDynamicResultSet.class),
+ cmdProc.execute(cmd, 0, null));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("Couldn't convert Any ",iae);
+ }
+
+ resSet = dynResSet.getStaticResultSet() ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create relation." );
+ e.printStackTrace(log) ;
+ throw new StatusException( "Can't create relation", e );
+ }
+
+ tEnv.addObjRelation("ContentResultSet", resSet) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java
new file mode 100644
index 000000000000..ccd8956994ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cached;
+
+import com.sun.star.beans.Property;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.NumberedSortingInfo;
+import com.sun.star.ucb.OpenCommandArgument2;
+import com.sun.star.ucb.OpenMode;
+import com.sun.star.ucb.XCachedDynamicResultSetStubFactory;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.ucb.XContent;
+import com.sun.star.ucb.XContentIdentifier;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.AnyConverter;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.CachedDynamicResultSetFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XCachedDynamicResultSetFactory</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XCachedDynamicResultSetFactory
+* @see com.sun.star.ucb.CachedDynamicResultSetFactory
+* @see ifc.ucb._XCachedDynamicResultSetFactory
+*/
+public class CachedDynamicResultSetFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.CachedDynamicResultSetFactory</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CachedDynamicResultSetStub'</code> for
+ * {@link ifc.XCachedDynamicResultSetFactory} : the destination
+ * interface requires as its parameter an instance of
+ * <code>CachedDynamicResultSetStub</code> service. It is created
+ * using <code>UniversalContentBroker</code> and queriing it for
+ * <code>PackageContent</code> which represents JAR file mentioned
+ * above. Then the dynamic list of file contents (entries) is retrieved.
+ * Using <code>CachedDynamicResultSetStubFactory</code> service a stub of
+ * Cached result set is created which is relation required.
+ * </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object relationContainer = null ;
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.CachedDynamicResultSetFactory" );
+
+ // adding one child container
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // creating relation for XCachedDynamicResultSetFactory
+ XDynamicResultSet resSetStub = null ;
+ try {
+ Object oUCB = xMSF.createInstanceWithArguments
+ ("com.sun.star.ucb.UniversalContentBroker",
+ new Object[] {"Local", "Office"}) ;
+
+ XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ;
+
+ String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ;
+ String escUrl = "" ;
+
+ // In base URL of a JAR file in content URL all directory
+ // separators ('/') must be replaced with escape symbol '%2F'.
+ int idx = url.indexOf("/") ;
+ int lastIdx = -1 ;
+ while (idx >= 0) {
+ escUrl += url.substring(lastIdx + 1, idx) + "%2F" ;
+ lastIdx = idx ;
+ idx = url.indexOf("/", idx + 1) ;
+ }
+ escUrl += url.substring(lastIdx + 1) ;
+ String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ;
+
+ XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;
+
+ XContentProvider cntProv = (XContentProvider)
+ UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;
+
+ XContent cnt = cntProv.queryContent(CI) ;
+
+ XCommandProcessor cmdProc = (XCommandProcessor)
+ UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;
+
+ Property prop = new Property() ;
+ prop.Name = "Title" ;
+
+ Command cmd = new Command("open", -1, new OpenCommandArgument2
+ (OpenMode.ALL, 10000, null, new Property[] {prop},
+ new NumberedSortingInfo[0])) ;
+
+ XDynamicResultSet dynResSet = null;
+ try {
+ dynResSet = (XDynamicResultSet)
+ AnyConverter.toObject(new Type(XDynamicResultSet.class),
+ cmdProc.execute(cmd, 0, null));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("Couldn't convert Any ",iae);
+ }
+
+ Object oStubFactory = xMSF.createInstance
+ ("com.sun.star.ucb.CachedDynamicResultSetStubFactory") ;
+
+ XCachedDynamicResultSetStubFactory xStubFactory =
+ (XCachedDynamicResultSetStubFactory) UnoRuntime.queryInterface
+ (XCachedDynamicResultSetStubFactory.class, oStubFactory) ;
+
+ resSetStub =
+ xStubFactory.createCachedDynamicResultSetStub(dynResSet) ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create relation." );
+ e.printStackTrace(log) ;
+ throw new StatusException( "Can't create relation", e );
+ }
+
+ tEnv.addObjRelation("CachedDynamicResultSetStub", resSetStub) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
new file mode 100644
index 000000000000..6bffda511898
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cached;
+
+import com.sun.star.beans.Property;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.NumberedSortingInfo;
+import com.sun.star.ucb.OpenCommandArgument2;
+import com.sun.star.ucb.OpenMode;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.ucb.XContent;
+import com.sun.star.ucb.XContentIdentifier;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.AnyConverter;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.CachedDynamicResultSetStubFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XCachedDynamicResultSetStubFactory</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XCachedDynamicResultSetStubFactory
+* @see com.sun.star.ucb.CachedDynamicResultSetStubFactory
+* @see ifc.ucb._XCachedDynamicResultSetStubFactory
+*/
+public class CachedDynamicResultSetStubFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.CachedDynamicResultSetStubFactory</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DynamicResultSet'</code> for
+ * {@link ifc.XCachedDynamicResultSetStubFactory} : the destination
+ * interface requires as its parameter an instance of
+ * <code>DynamicResultSet</code> service. It is created
+ * using <code>UniversalContentBroker</code> and queriing it for
+ * <code>PackageContent</code> which represents JAR file mentioned
+ * above. Then the dynamic list of file contents (entries) is retrieved.
+ * </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object relationContainer = null ;
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.CachedDynamicResultSetStubFactory" );
+
+ // adding one child container
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // creating relation for XCachedDynamicResultSetStubFactory
+ XDynamicResultSet dynResSet = null ;
+ try {
+ Object oUCB = xMSF.createInstanceWithArguments
+ ("com.sun.star.ucb.UniversalContentBroker",
+ new Object[] {"Local", "Office"}) ;
+
+ XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ;
+
+ String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ;
+ String escUrl = "" ;
+
+ // In base URL of a JAR file in content URL all directory
+ // separators ('/') must be replaced with escape symbol '%2F'.
+ int idx = url.indexOf("/") ;
+ int lastIdx = -1 ;
+ while (idx >= 0) {
+ escUrl += url.substring(lastIdx + 1, idx) + "%2F" ;
+ lastIdx = idx ;
+ idx = url.indexOf("/", idx + 1) ;
+ }
+ escUrl += url.substring(lastIdx + 1) ;
+ String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ;
+
+ XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;
+
+ XContentProvider cntProv = (XContentProvider)
+ UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;
+
+ XContent cnt = cntProv.queryContent(CI) ;
+
+ XCommandProcessor cmdProc = (XCommandProcessor)
+ UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;
+
+ Property prop = new Property() ;
+ prop.Name = "Title" ;
+
+ Command cmd = new Command("open", -1, new OpenCommandArgument2
+ (OpenMode.ALL, 10000, null, new Property[] {prop},
+ new NumberedSortingInfo[0])) ;
+
+ dynResSet = null;
+ try {
+ dynResSet = (XDynamicResultSet)
+ AnyConverter.toObject(new Type(XDynamicResultSet.class),
+ cmdProc.execute(cmd, 0, null));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("Couldn't convert Any ",iae);
+ }
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create relation." );
+ e.printStackTrace(log) ;
+ throw new StatusException( "Can't create relation", e );
+ }
+
+ tEnv.addObjRelation("DynamicResultSet", dynResSet) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java b/qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java
new file mode 100644
index 000000000000..3918dc67341e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cmdmail;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+public class SimpleCommandMail extends TestCase {
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.system.SimpleCommandMail" );
+
+ if (oInterface == null) log.println("!!! NULL !!!") ;
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java b/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java
new file mode 100644
index 000000000000..b22b2a9b3f7b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.cnt.ChaosContentProvider</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XContentProvider</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XContentProvider
+* @see com.sun.star.ucb.ChaosContentProvider
+* @see ifc.ucb._XContentProvider
+*/
+public class ChaosContentProvider extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.cnt.ChaosContentProvider</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FACTORY'</code> for
+ * {@link ifc.ucb._XContentProvider} factory for
+ * content identifiers. Here it is
+ * <code>UniversalContentBroker</code> service.</li>
+ * <li> <code>'CONTENT1'</code> for
+ * {@link ifc.ucb._XContentProvider}: suitable
+ * content URL for this provider </li>
+ * <li> <code>'CONTENT2'</code> for
+ * {@link ifc.ucb._XContentProvider}: another suitable
+ * content URL for this provider </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object cntFactory = null ;
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.ChaosContentProvider" );
+ cntFactory = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XContentProvider
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class, cntFactory);
+
+ tEnv.addObjRelation("FACTORY", CIF) ;
+ tEnv.addObjRelation("CONTENT1", "ftp://localhost") ;
+ tEnv.addObjRelation("CONTENT2", "ftp://sva.dorms.spbu.ru") ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java b/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java
new file mode 100644
index 000000000000..dbf57e5782ae
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.cnt.CntUnoDataContainer</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* <li> <code>com::sun::star::container::XIndexContainer</code></li>
+* <li> <code>com::sun::star::ucb::XDataContainer</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexReplace</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XActiveDataSink
+* @see com.sun.star.container.XIndexContainer
+* @see com.sun.star.ucb.XDataContainer
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XIndexReplace
+* @see ifc.io._XActiveDataSink
+* @see ifc.container._XIndexContainer
+* @see ifc.ucb._XDataContainer
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XIndexReplace
+*/
+public class CntUnoDataContainer extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.cnt.CntUnoDataContainer</code> and adds
+ * to it one <code>CntUnoDataContainer</code> instance. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'INSTANCE1'</code> for
+ * {@link ifc.container._XIndexContainer},
+ * {@link ifc.container._XIndexReplace} : for this object
+ * elements contained in it are <code>CntUnoDataContainer</code>
+ * instances. (only one relation for one interface thread is now
+ * passed).</li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink} : a stream to set and get.
+ * </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object relationContainer = null ;
+ Object xIn = null;
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.DataContainer" );
+
+ // adding one child container
+ XIndexContainer xIC = (XIndexContainer) UnoRuntime.queryInterface
+ (XIndexContainer.class, oInterface) ;
+
+ Object child = xMSF.createInstance
+ ( "com.sun.star.ucb.DataContainer" );
+ xIC.insertByIndex(0, child) ;
+
+ relationContainer = xMSF.createInstance
+ ( "com.sun.star.ucb.DataContainer" );
+
+ xIn = xMSF.createInstance
+ ( "com.sun.star.io.DataInputStream" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("INSTANCE1", relationContainer) ;
+ tEnv.addObjRelation("InputStream", xIn) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class BreakIterator
+
diff --git a/qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java b/qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java
new file mode 100644
index 000000000000..56609c37c0ff
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.cnt.CntUnoDataContainer</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XPropertyMatcherFactory</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XPropertyMatcherFactory
+* @see com.sun.star.ucb.PropertyMatcherFactory
+* @see ifc.ucb._XPropertyMatcherFactory
+*/
+public class PropertyMatcherFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.cnt.PropertyMatcherFactory</code>. <p>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.PropertyMatcherFactory" );
+
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java b/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java
new file mode 100644
index 000000000000..6626ceaa3a9b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java
@@ -0,0 +1,57 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.uno.XComponentContext;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import java.io.PrintWriter;
+
+public final class ConfigurationProvider extends TestCase {
+ public ConfigurationProvider() {}
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log)
+ {
+ // Create a non-default ConfigurationProvider instance, so that testing
+ // its XComponent.dispose does not accidentally dispose the
+ // DefaultProvider:
+ XComponentContext ctxt = tParam.getComponentContext();
+ try {
+ return ProviderTestEnvironment.create(
+ ctxt.getServiceManager().createInstanceWithArgumentsAndContext(
+ "com.sun.star.configuration.ConfigurationProvider",
+ new Object[] { new NamedValue("Locale", "*") },
+ ctxt));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java b/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java
new file mode 100644
index 000000000000..f8a023ea2f12
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.XInterface;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import java.io.PrintWriter;
+
+public final class DefaultProvider extends TestCase {
+ public DefaultProvider() {}
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log)
+ {
+ try {
+ return ProviderTestEnvironment.create(
+ AnyConverter.toObject(
+ XInterface.class,
+ tParam.getComponentContext().getValueByName(
+ "/singletons/" +
+ "com.sun.star.configuration.theDefaultProvider")));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java b/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java
new file mode 100644
index 000000000000..ebd487305f3b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.uno.XInterface;
+import lib.TestEnvironment;
+
+final class ProviderTestEnvironment {
+ private ProviderTestEnvironment() {}
+
+ public static TestEnvironment create(Object provider) {
+ TestEnvironment env = new TestEnvironment((XInterface) provider);
+ env.addObjRelation(
+ "XMSF.serviceNamesWithArgs",
+ new String[] {
+ "com.sun.star.configuration.ConfigurationAccess",
+ "com.sun.star.configuration.ConfigurationUpdateAccess" });
+ Object[] args = new Object[] {
+ new NamedValue("nodepath", "/org.openoffice.Setup") };
+ env.addObjRelation("XMSF.Args", new Object[][] { args, args });
+ env.addObjRelation(
+ "needArgs", "com.sun.star.configuration.ConfigurationProvider");
+ return env;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_connector.uno/Connector.java b/qadevOOo/tests/java/mod/_connector.uno/Connector.java
new file mode 100644
index 000000000000..06fec0390fa5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_connector.uno/Connector.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._connector.uno;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.connection.Connector</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::connection::XConnector</code></li>
+* </ul>
+* Can be run in several threads.
+* @see com.sun.star.connection.XConnector
+* @see ifc.connection._XConnector
+*/
+public class Connector extends TestCase {
+
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 10000 ;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ /**
+ * Does nothing.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Just creates service <code>com.sun.star.connection.Connector</code>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null ;
+
+ try {
+ XInterface connector = (XInterface)
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.connection.Connector") ;
+
+ oObj = connector ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create object environment", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ // adding connection string as relation
+ tEnv.addObjRelation("XConnector.connectStr",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Connector.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+
+ curPort = ((Integer)tEnv.getObjRelation("Connector.Port")).intValue();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_connector.uno/package.html b/qadevOOo/tests/java/mod/_connector.uno/package.html
new file mode 100644
index 000000000000..9f100d8e3924
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_connector.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'connectr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_connectr/Connector.java b/qadevOOo/tests/java/mod/_connectr/Connector.java
new file mode 100644
index 000000000000..118729c01863
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_connectr/Connector.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._connectr;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.connection.Connector</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::connection::XConnector</code></li>
+* </ul>
+* Can be run in several threads.
+* @see com.sun.star.connection.XConnector
+* @see ifc.connection._XConnector
+*/
+public class Connector extends TestCase {
+
+ /**
+ * Acceptor chooses the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 10000 ;
+ private int curPort ;
+ private static String sOfficeHost = null ;
+
+ /**
+ * Retrieves host name where StarOffice is started from test
+ * parameter <code>'CNCSTR'</code>.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+ sOfficeHost = cncstr.substring(idx, cncstr.indexOf(",", idx)) ;
+ }
+
+ /**
+ * Does nothing.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Just creates service <code>com.sun.star.connection.Connector</code>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null ;
+
+ try {
+ XInterface connector = (XInterface)
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.connection.Connector") ;
+
+ oObj = connector ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create object environment", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // select the port
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ // adding connection string as relation
+ tEnv.addObjRelation("XConnector.connectStr",
+ "socket,host=" + sOfficeHost + ",port=" + curPort) ;
+
+ // adding port number for freeing it.
+ tEnv.addObjRelation("Connector.Port", new Integer(curPort)) ;
+
+ return tEnv ;
+ }
+
+ /**
+ * Just clears flag which indicates that port is free now.
+ */
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam) {
+
+ curPort = ((Integer)tEnv.getObjRelation("Connector.Port")).intValue();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_connectr/package.html b/qadevOOo/tests/java/mod/_connectr/package.html
new file mode 100644
index 000000000000..9f100d8e3924
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_connectr/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'connectr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_corefl/CoreReflection.java b/qadevOOo/tests/java/mod/_corefl/CoreReflection.java
new file mode 100644
index 000000000000..cada4acf14d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_corefl/CoreReflection.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._corefl;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.CoreReflection</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::reflection::XIdlReflection</code></li>
+* </ul>
+* @see com.sun.star.reflection.XIdlReflection
+* @see ifc.reflection._XIdlReflection
+*/
+public class CoreReflection extends TestCase {
+
+ /**
+ * Does nothing.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.reflection.CoreReflection</code> service.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.reflection.CoreReflection");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ log.println("CoreReflection Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for CoreReflection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class CoreReflection
+
diff --git a/qadevOOo/tests/java/mod/_corefl/package.html b/qadevOOo/tests/java/mod/_corefl/package.html
new file mode 100644
index 000000000000..c485660c40f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_corefl/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'corefl'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_corereflection.uno/CoreReflection.java b/qadevOOo/tests/java/mod/_corereflection.uno/CoreReflection.java
new file mode 100644
index 000000000000..362311ce7cfc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_corereflection.uno/CoreReflection.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._corereflection.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.CoreReflection</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::reflection::XIdlReflection</code></li>
+* </ul>
+* @see com.sun.star.reflection.XIdlReflection
+* @see ifc.reflection._XIdlReflection
+*/
+public class CoreReflection extends TestCase {
+
+ /**
+ * Does nothing.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.reflection.CoreReflection</code> service.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.reflection.CoreReflection");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ log.println("CoreReflection Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for CoreReflection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class CoreReflection
+
diff --git a/qadevOOo/tests/java/mod/_corereflection.uno/package.html b/qadevOOo/tests/java/mod/_corereflection.uno/package.html
new file mode 100644
index 000000000000..c485660c40f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_corereflection.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'corefl'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java b/qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java
new file mode 100644
index 000000000000..bc200665e9c5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._cpld;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for <code>com.sun.star.comp.stoc.DLLComponentLoader</code> service <p>
+* Files which are used :
+* <ul>
+* <li> <code>XImpReg.dll</code> : DLL which will be loaded in
+* <code>XImplementationLoader</code> interface test. </li>
+* <ul>
+* Multithread testing compilant.
+* @see com.sun.star.loader.XImplementationLoader
+* @see com.sun.star.lang.XServiceInfo
+* @see ifc.loader._XImplementationLoader
+* @see ifc.lang._XServiceInfo
+*/
+public class DLLComponentLoader extends TestCase {
+
+ /**
+ * Does nothing.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.comp.stoc.DLLComponentLoader</code>
+ * service. <p>
+ * The following object relations created :
+ * <ul>
+ * <li> <code>'ImplementationLoader'</code> : service which is
+ * responsible for loading DLL implementations. </li>
+ * <li> <code>'ImplementationUrl'</code> : DLL file location. </li>
+ * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.DLLComponentLoader" );
+ }
+ catch( Exception e ) {
+ log.println("DLLComponentLoader Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for DLLComponentLoader object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding object relation for XImplementationLoader ifc test
+ tEnv.addObjRelation("ImplementationLoader",
+ "com.sun.star.loader.SharedLibrary") ;
+ String os = (String) Param.get("OS");
+ if (os == null || os == "")
+ throw new StatusException(
+ "Couldn't determine operating system for naming convention.",
+ new NullPointerException());
+ String name = "javaloader";
+ if (!os.equals("wntmsci"))
+ name = "lib" + name + ".so";
+ else
+ name += ".dll";
+ String implURL = utils.getFullTestURL(os + "/" + name);
+ tEnv.addObjRelation("ImplementationUrl", implURL) ;
+ log.println("looking for shared lib: " + implURL);
+ tEnv.addObjRelation("ImplementationName",
+ "com.sun.star.comp.stoc.JavaComponentLoader") ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class DLLComponentLoader
+
diff --git a/qadevOOo/tests/java/mod/_cpld/package.html b/qadevOOo/tests/java/mod/_cpld/package.html
new file mode 100644
index 000000000000..55c1c1ffd2c3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cpld/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'cpld'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
new file mode 100644
index 000000000000..c2494f6c0541
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
@@ -0,0 +1,421 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import util.DesktopTools;
+import util.utils;
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>::com::sun::star::accessibility::XAccessible</code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul><p>
+ * @see com.sun.star.accessibility.XAccessible
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessible
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ */
+public class ConnectionLineAccessibility extends TestCase
+{
+ XWindow xWindow = null;
+ Object oDBSource = null;
+ String aFile = "";
+ XConnection connection = null;
+ XIsolatedConnection isolConnection = null;
+ XComponent QueryComponent = null;
+ String user = "";
+ String password="";
+
+ /**
+ * Creates a new DataSource and stores it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens the QueryComponent.with loadComponentFromURL
+ * and gets the object with the role UNKNOWN and the Impplementation
+ * name that contains ConnectionLine
+ * @param Param test parameters
+ * @param log writer to log information while testing
+ * @return
+ * @throws StatusException
+ * @see TestEnvironment
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ {
+ XInterface oObj = null;
+
+ Object oDBContext = null;
+ Object oDBSource = null;
+ Object newQuery = null;
+ Object toolkit = null;
+ XStorable store = null;
+
+ try
+ {
+ oDBContext = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.DatabaseContext");
+ oDBSource = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.DataSource");
+ newQuery = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.QueryDefinition");
+ toolkit = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.awt.Toolkit");
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ String mysqlURL = (String) Param.get("mysql.url");
+
+ if (mysqlURL == null)
+ {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'mysql.url' from ini-file"));
+ }
+
+ user = (String) Param.get("jdbc.user");
+ password = (String) Param.get("jdbc.password");
+
+ if ((user == null) || (password == null))
+ {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
+ }
+
+ PropertyValue[] info = new PropertyValue[2];
+ info[0] = new PropertyValue();
+ info[0].Name = "user";
+ info[0].Value = user;
+ info[1] = new PropertyValue();
+ info[1].Name = "password";
+ info[1].Value = password;
+
+ XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDBSource);
+
+ try
+ {
+ propSetDBSource.setPropertyValue("URL", mysqlURL);
+ propSetDBSource.setPropertyValue("Info", info);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+
+ try
+ {
+ log.println("writing database file ...");
+ XDocumentDataSource xDDS = (XDocumentDataSource)
+ UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
+ store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ xDDS.getDatabaseDocument());
+
+ aFile = utils.getOfficeTemp((XMultiServiceFactory) Param.getMSF())+"ConnectionLine.odb";
+ log.println("... filename will be "+aFile);
+ store.storeAsURL(aFile,new PropertyValue[]
+ {});
+ log.println("... done");
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't register object"));
+ }
+
+ isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface(
+ XIsolatedConnection.class,
+ oDBSource);
+
+ XConnection connection = null;
+ XStatement statement = null;
+
+ final String tbl_name1 = "tst_table1";
+ final String tbl_name2 = "tst_table2";
+ final String col_name1 = "id1";
+ final String col_name2 = "id2";
+
+ try
+ {
+ connection = isolConnection.getIsolatedConnection(user, password);
+ statement = connection.createStatement();
+ statement.executeUpdate("drop table if exists " + tbl_name1);
+ statement.executeUpdate("drop table if exists " + tbl_name2);
+ statement.executeUpdate("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ }
+ catch (com.sun.star.sdbc.SQLException e)
+ {
+ try
+ {
+ shortWait();
+ connection = isolConnection.getIsolatedConnection(user,
+ password);
+ statement = connection.createStatement();
+ statement.executeUpdate("drop table if exists " + tbl_name1);
+ statement.executeUpdate("drop table if exists " + tbl_name2);
+ statement.executeUpdate("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ }
+ catch (com.sun.star.sdbc.SQLException e2)
+ {
+ e2.printStackTrace(log);
+ throw new StatusException(Status.failed("SQLException"));
+ }
+ }
+
+ XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface(
+ XQueryDefinitionsSupplier.class,
+ oDBSource);
+
+ XNameAccess defContainer = querySuppl.getQueryDefinitions();
+
+ XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, newQuery);
+
+ try
+ {
+ final String query = "select * from " + tbl_name1 + ", " +
+ tbl_name2 + " where " + tbl_name1 + "." +
+ col_name1 + "=" + tbl_name2 + "." +
+ col_name2;
+ queryProp.setPropertyValue("Command", query);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+
+ XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class,
+ defContainer);
+
+ try
+ {
+ queryContainer.insertByName("Query1", newQuery);
+ store.store();
+ connection.close();
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+ catch (com.sun.star.container.ElementExistException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+ catch (com.sun.star.sdbc.SQLException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+
+ PropertyValue[] loadProps = new PropertyValue[3];
+ loadProps[0] = new PropertyValue();
+ loadProps[0].Name = "QueryDesignView";
+ loadProps[0].Value = Boolean.TRUE;
+
+ loadProps[1] = new PropertyValue();
+ loadProps[1].Name = "CurrentQuery";
+ loadProps[1].Value = "Query1";
+
+ loadProps[2] = new PropertyValue();
+ loadProps[2].Name = "DataSource";
+ loadProps[2].Value = oDBSource;
+
+ QueryComponent = DesktopTools.loadDoc((XMultiServiceFactory) Param.getMSF(),".component:DB/QueryDesign",loadProps);
+
+ util.utils.shortWait(1000);
+
+ xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ AccessibilityTools.printAccessibleTree (log,xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = AccessibilityTools.getAccessibleObjectForRoleIgnoreShowing(xRoot, AccessibleRole.UNKNOWN, "", "ConnectionLine");
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println("creating TestEnvironment");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ shortWait();
+
+ final XWindow queryWin = xWindow;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer()
+ {
+ public void fireEvent()
+ {
+ Rectangle rect = queryWin.getPosSize();
+ queryWin.setPosSize(rect.X, rect.Y, rect.Height-5, rect.Width-5, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes the DatasourceAdministration dialog and Query Dialog.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log)
+ {
+ try
+ {
+
+ log.println("closing QueryComponent ...");
+ DesktopTools.closeDoc(QueryComponent);
+ log.println("... done");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object sfa = xMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, sfa);
+ log.println("deleting database file");
+ xSFA.kill(aFile);
+ log.println("Could delete file "+aFile+": "+!xSFA.exists(aFile));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Sleeps for 1.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait()
+ {
+ try
+ {
+ Thread.sleep(1500);
+ }
+ catch (InterruptedException e)
+ {
+ log.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java b/qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java
new file mode 100644
index 000000000000..c79c189addac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.ContentLoader</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::frame::FrameLoader</code></li>
+* <li> <code>com::sun::star::frame::XFrameLoader</code></li>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.frame.FrameLoader
+* @see com.sun.star.frame.XSynchronousFrameLoader
+* @see com.sun.star.lang.XInitialization
+* @see ifc.beans._XPropertySet
+* @see ifc.frame._FrameLoader
+* @see ifc.frame._XSynchronousFrameLoader
+* @see ifc.lang._XInitialization
+*/
+public class DBContentLoader extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdb.ContentLoader</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FrameLoader.URL"'</code> for
+ * {@link ifc.frame._XFrameLoader} </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sdb.ContentLoader") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XFrameLoader
+ tEnv.addObjRelation("FrameLoader.URL",
+ ".component:DB/DataSourceBrowser") ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
new file mode 100644
index 000000000000..b882e0242558
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
@@ -0,0 +1,392 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import util.DesktopTools;
+import util.utils;
+
+
+/**
+* Object implements the following interfaces :
+* <ul>
+* <li><code>::com::sun::star::accessibility::XAccessible</code></li>
+* <li><code>::com::sun::star::accessibility::XAccessibleContext
+* </code></li>
+* <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+* </code></li>
+* </ul><p>
+* @see com.sun.star.accessibility.XAccessible
+* @see com.sun.star.accessibility.XAccessibleContext
+* @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+* @see ifc.accessibility._XAccessible
+* @see ifc.accessibility._XAccessibleContext
+* @see ifc.accessibility._XAccessibleEventBroadcaster
+*/
+public class JoinViewAccessibility extends TestCase {
+ XWindow xWindow = null;
+ Object oDBSource = null;
+ String aFile = "";
+ XConnection connection = null;
+ XIsolatedConnection isolConnection = null;
+ XComponent QueryComponent = null;
+ String user = "";
+ String password="";
+
+ /**
+ * Creates a new DataSource and stores it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens the QueryComponent.with loadComponentFromURL
+ * and gets the object with the role UNKNOWN and the Impplementation
+ * name that contains ConnectionLine
+ * @param Param test parameters
+ * @param log writer to log information while testing
+ * @return
+ * @throws StatusException
+ * @see TestEnvironment
+ */
+ protected TestEnvironment createTestEnvironment (TestParameters Param,
+ PrintWriter log)
+ {
+ XInterface oObj = null;
+
+ Object oDBContext = null;
+ Object oDBSource = null;
+ Object newQuery = null;
+ Object toolkit = null;
+ XStorable store = null;
+
+ try
+ {
+ oDBContext = ((XMultiServiceFactory) Param.getMSF ())
+ .createInstance ("com.sun.star.sdb.DatabaseContext");
+ oDBSource = ((XMultiServiceFactory) Param.getMSF ())
+ .createInstance ("com.sun.star.sdb.DataSource");
+ newQuery = ((XMultiServiceFactory) Param.getMSF ())
+ .createInstance ("com.sun.star.sdb.QueryDefinition");
+ toolkit = ((XMultiServiceFactory) Param.getMSF ())
+ .createInstance ("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't create instance"));
+ }
+
+ String mysqlURL = (String) Param.get ("mysql.url");
+
+ if (mysqlURL == null)
+ {
+ throw new StatusException (Status.failed (
+ "Couldn't get 'mysql.url' from ini-file"));
+ }
+
+ user = (String) Param.get ("jdbc.user");
+ password = (String) Param.get ("jdbc.password");
+
+ if ((user == null) || (password == null))
+ {
+ throw new StatusException (Status.failed (
+ "Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
+ }
+
+ PropertyValue[] info = new PropertyValue[2];
+ info[0] = new PropertyValue ();
+ info[0].Name = "user";
+ info[0].Value = user;
+ info[1] = new PropertyValue ();
+ info[1].Name = "password";
+ info[1].Value = password;
+
+ XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDBSource);
+
+ try
+ {
+ propSetDBSource.setPropertyValue ("URL", mysqlURL);
+ propSetDBSource.setPropertyValue ("Info", info);
+ } catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ }
+
+ try
+ {
+ log.println ("writing database file ...");
+ XDocumentDataSource xDDS = (XDocumentDataSource)
+ UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
+ store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ xDDS.getDatabaseDocument());
+ aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"JoinView.odb";
+ log.println ("... filename will be "+aFile);
+ store.storeAsURL (aFile,new PropertyValue[]
+ {});
+ log.println ("... done");
+ } catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't register object"));
+ }
+
+ isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface (
+ XIsolatedConnection.class,
+ oDBSource);
+
+ XConnection connection = null;
+ XStatement statement = null;
+
+ final String tbl_name1 = "tst_table1";
+ final String tbl_name2 = "tst_table2";
+ final String col_name1 = "id1";
+ final String col_name2 = "id2";
+
+ try
+ {
+ connection = isolConnection.getIsolatedConnection (user, password);
+ statement = connection.createStatement ();
+ statement.executeUpdate ("drop table if exists " + tbl_name1);
+ statement.executeUpdate ("drop table if exists " + tbl_name2);
+ statement.executeUpdate ("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate ("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ } catch (com.sun.star.sdbc.SQLException e)
+ {
+ try
+ {
+ shortWait ();
+ connection = isolConnection.getIsolatedConnection (user,
+ password);
+ statement = connection.createStatement ();
+ statement.executeUpdate ("drop table if exists " + tbl_name1);
+ statement.executeUpdate ("drop table if exists " + tbl_name2);
+ statement.executeUpdate ("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate ("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ } catch (com.sun.star.sdbc.SQLException e2)
+ {
+ e2.printStackTrace (log);
+ throw new StatusException (Status.failed ("SQLException"));
+ }
+ }
+
+ XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface (
+ XQueryDefinitionsSupplier.class,
+ oDBSource);
+
+ XNameAccess defContainer = querySuppl.getQueryDefinitions ();
+
+ XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, newQuery);
+
+ try
+ {
+ final String query = "select * from " + tbl_name1 + ", " +
+ tbl_name2 + " where " + tbl_name1 + "." +
+ col_name1 + "=" + tbl_name2 + "." +
+ col_name2;
+ queryProp.setPropertyValue ("Command", query);
+ } catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed (
+ "Couldn't set property value"));
+ }
+
+ XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface (
+ XNameContainer.class,
+ defContainer);
+
+ try
+ {
+ queryContainer.insertByName ("Query1", newQuery);
+ store.store ();
+ connection.close ();
+ } catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't insert query"));
+ } catch (com.sun.star.container.ElementExistException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't insert query"));
+ } catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't insert query"));
+ } catch (com.sun.star.io.IOException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't insert query"));
+ } catch (com.sun.star.sdbc.SQLException e)
+ {
+ e.printStackTrace (log);
+ throw new StatusException (Status.failed ("Couldn't insert query"));
+ }
+
+ PropertyValue[] loadProps = new PropertyValue[3];
+ loadProps[0] = new PropertyValue ();
+ loadProps[0].Name = "QueryDesignView";
+ loadProps[0].Value = Boolean.TRUE;
+
+ loadProps[1] = new PropertyValue ();
+ loadProps[1].Name = "CurrentQuery";
+ loadProps[1].Value = "Query1";
+
+ loadProps[2] = new PropertyValue ();
+ loadProps[2].Name = "DataSource";
+ loadProps[2].Value = oDBSource;
+
+ QueryComponent = DesktopTools.loadDoc ((XMultiServiceFactory) Param.getMSF (),".component:DB/QueryDesign",loadProps);
+
+ xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject (xWindow);
+
+ AccessibilityTools.printAccessibleTree (log,xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.VIEW_PORT);
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println("creating TestEnvironment");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ shortWait();
+
+ final XWindow queryWin = xWindow;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle rect = queryWin.getPosSize();
+ queryWin.setPosSize(rect.X, rect.Y, rect.Height-5, rect.Width-5, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes the DatasourceAdministration dialog and Query Dialog.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try
+ {
+
+ log.println ("closing QueryComponent ...");
+ DesktopTools.closeDoc (QueryComponent);
+ log.println ("... done");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF ();
+ Object sfa = xMSF.createInstance ("com.sun.star.comp.ucb.SimpleFileAccess");
+ XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa);
+ log.println ("deleting database file");
+ xSFA.kill (aFile);
+ log.println ("Could delete file "+aFile+": "+!xSFA.exists (aFile));
+ } catch (Exception e)
+ {
+ e.printStackTrace ();
+ }
+ }
+
+ /**
+ * Sleeps for 1.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java b/qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java
new file mode 100644
index 000000000000..82c9a2afd9c0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.QueryDefinition</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sdb::QueryDefinition</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* This object test <b> can </b> be run in several
+* threads concurently.
+* @see com.sun.star.sdb.QueryDefinition
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sdb._QueryDefinition
+* @see ifc.beans._XPropertySet
+*/
+public class OCommandDefinition extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.sdb.QueryDefinition</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.QueryDefinition" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java
new file mode 100644
index 000000000000..d7741e30d6d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.beans.PropertyValue;
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.XNamingService;
+import com.sun.star.frame.XStorable;
+import com.sun.star.sdb.XDocumentDataSource;
+import util.utils;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.DatabaseContext</code>. <p>
+*
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::uno::XNamingService</code></li>
+* </ul>
+*
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.uno.XNamingService
+* @see com.sun.star.sdb.DatabaseContext
+* @see ifc.container.XNameAccess
+* @see ifc.container.XEnumerationAccess
+* @see ifc.container.XElementAccess
+* @see ifc.uno.XNamingService
+*/
+public class ODatabaseContext extends TestCase {
+
+ /**
+ * Does nothing.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.sdb.DatabaseContext</code>.
+ * Needed object relations :
+ * <ul>
+ * <li> <code>'XNamingService.RegisterObject'</code> for
+ * {@link ifc.namingservice.XNamingService} as an
+ * instance of <code>com.sun.star.sdb.DataSource</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding obj relation for XNamingService
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DataSource" );
+
+ XPropertySet xDSProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oInterface) ;
+
+ xDSProps.setPropertyValue("URL", "sdbc:dbase:file:///.") ;
+
+ XDocumentDataSource xDDS = (XDocumentDataSource)
+ UnoRuntime.queryInterface(XDocumentDataSource.class, oInterface);
+ XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ xDDS.getDatabaseDocument ());
+ String aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"DatabaseContext.odb";
+ log.println("store to '" + aFile + "'");
+ store.storeAsURL(aFile,new PropertyValue[]{});
+
+ tEnv.addObjRelation("XNamingService.RegisterObject", oInterface) ;
+
+ tEnv.addObjRelation("INSTANCE", oInterface);
+
+ tEnv.addObjRelation("XContainer.Container",
+ (XNamingService) UnoRuntime.queryInterface(
+ XNamingService.class, oObj));
+
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create object relation", e) ;
+ } catch (NullPointerException e) {
+ throw new StatusException("Can't create object relation", e) ;
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java
new file mode 100644
index 000000000000..616fe4965cb3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XStorable;
+
+
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.XNamingService;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.utils;
+
+import com.sun.star.io.IOException;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.task.XInteractionHandler;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.DataSource</code>. <p>
+*
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sdb::XQueryDefinitionsSupplier</code></li>
+* <li> <code>com::sun::star::sdb::DataSource</code></li>
+* <li> <code>com::sun::star::sdb::XCompletedConnection</code></li>
+* <li> <code>com::sun::star::util::XFlushable</code></li>
+* <li> <code>com::sun::star::sdb::XBookmarksSupplier</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+*
+* @see com.sun.star.sdb.XQueryDefinitionSupplier
+* @see com.sun.star.sdb.XFormDocumentsSupplier
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.sdb.DataSource
+* @see com.sun.star.sdb.XCompletedConnection
+* @see com.sun.star.util.XFlushable
+* @see com.sun.star.sdb.XReportDocumentsSupplier
+* @see ifc.sdb._XQueryDefinitionSupplier
+* @see ifc.sdb._XFormDocumentsSupplier
+* @see ifc.beans._XPropertySet
+* @see ifc.sdb._DataSource
+* @see ifc.sdb._XCompletedConnection
+* @see ifc.util._XFlushable
+* @see ifc.sdb._XReportDocumentsSupplier
+*/
+public class ODatabaseSource extends TestCase {
+
+ private static int uniqueSuffixStat = 0 ;
+
+ private int uniqueSuffix = 0 ;
+ private XNamingService xDBContextNameServ = null ;
+ private String databaseName = null ;
+ private XOfficeDatabaseDocument xDBDoc = null;
+
+ /**
+ * Assigns database's name unique suffix for this object depending
+ * on static field. For names differs in different object threads.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ uniqueSuffix = uniqueSuffixStat++ ;
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing not longer needed docs... ");
+ DesktopTools.closeDoc(xDBDoc);
+ }
+
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ *
+ * Creates new <code>DataSource</code> which represents DBase database
+ * located in temporary directory, and then registers it in service
+ * <code>com.sun.star.sdb.DatabaseContext</code>.
+ *
+ * Created object relations :
+ * <ul>
+ * <li> <code>'XCompletedConnection.Handler'</code> for interface test
+ * <code>XCompletedConnection</code> </li>
+ * </ul>
+ * <li> <code>'UserAndPassword'</code> for interface test
+ * <code>XIsolatedConnection</code> </li>
+ * </ul>
+ * @see com.sun.star.sdb.DatabaseContext
+ * @see com.sun.star.sdb.DataSource
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ try{
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+
+ if (oInterface == null)
+ throw new StatusException("Could not get service 'com.sun.star.sdb.DatabaseContext'", new Exception());
+
+ }catch( Exception e ) {
+ log.println("Could not get service 'com.sun.star.sdb.DatabaseContext'" );
+ e.printStackTrace ();
+ throw new StatusException("Service not available", e) ;
+ }
+
+ xDBContextNameServ = (XNamingService)
+ UnoRuntime.queryInterface(XNamingService.class, oInterface) ;
+
+ // retrieving temp directory for database
+ String tmpDatabaseUrl = utils.getOfficeTempDir((XMultiServiceFactory)Param.getMSF());
+
+ tmpDatabaseUrl = "sdbc:dbase:file:///" + tmpDatabaseUrl ;
+
+ try{
+ XInterface oDatabaseDoc = (XInterface) xMSF.createInstance
+ ("com.sun.star.sdb.OfficeDatabaseDocument") ;
+
+ if (oDatabaseDoc == null)
+ throw new StatusException("Could not get service 'com.sun.star.sdb.OfficeDatabaseDocument'", new Exception());
+
+ xDBDoc = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class,
+ oDatabaseDoc);
+ }
+ catch( Exception e ) {
+ log.println("Could not get service 'com.sun.star.sdb.OfficeDatabaseDocument'" );
+ e.printStackTrace ();
+ throw new StatusException("Service not available", e) ;
+ }
+
+ oObj = (XInterface) xDBDoc.getDataSource();
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ // Creating new DBase data source in the TEMP directory
+
+ XPropertySet xSrcProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+
+ try{
+ xSrcProp.setPropertyValue("URL", tmpDatabaseUrl) ;
+ } catch ( UnknownPropertyException e){
+ throw new StatusException("Could not set property 'URL' ", e) ;
+ } catch ( PropertyVetoException e){
+ throw new StatusException("Could not set property 'URL' ", e) ;
+ } catch ( IllegalArgumentException e){
+ throw new StatusException("Could not set property 'URL' ", e) ;
+ } catch ( WrappedTargetException e){
+ throw new StatusException("Could not set property 'URL' ", e) ;
+ }
+
+ databaseName = "NewDatabaseSource" + uniqueSuffix ;
+
+ // make sure that the DatabaseContext isn't already registered
+ try {
+ xDBContextNameServ.revokeObject(databaseName) ;
+ } catch (Exception e) {
+ log.println("Nothing to be removed - OK");
+ }
+
+ // registering source in DatabaseContext
+ XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xDBDoc);
+ String aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"DataSource.odb";
+ try{
+ store.storeAsURL(aFile,new PropertyValue[]{});
+ } catch (IOException e){
+ log.println("Could not store datasource 'aFile'" );
+ e.printStackTrace ();
+ throw new StatusException("Could not save ", e) ;
+ } catch (Exception e){
+ log.println("Could not store datasource 'aFile'" );
+ e.printStackTrace ();
+ throw new StatusException("Could not save ", e) ;
+ }
+
+
+ try{
+ xDBContextNameServ.registerObject(databaseName, oObj) ;
+ } catch (Exception e){
+ log.println("Could not register data source" );
+ e.printStackTrace ();
+ throw new StatusException("Could not register ", e) ;
+ }
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding obj relation for interface XCompletedConnection
+ Object handler = null ;
+ try {
+ handler = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sdb.InteractionHandler") ;
+ } catch (Exception e) {
+ log.println("Relation for XCompletedConnection wasn't created") ;
+ e.printStackTrace(log) ;
+ }
+
+ // dbase does not need user and password
+ tEnv.addObjRelation("UserAndPassword", new String[]{"",""}) ;
+
+ tEnv.addObjRelation("XCompletedConnection.Handler",
+ UnoRuntime.queryInterface(XInteractionHandler.class, handler)) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java
new file mode 100644
index 000000000000..92a5004dcac5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>. <p>
+*
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* <li> <code>com::sun::star::ui::dialogs::XExecutableDialog</code></li>
+* <li> <code>com::sun::star::sdb::DatasourceAdministrationDialog</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul> <p>
+*
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+*
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.ui.dialogs.XExecutableDialog
+* @see com.sun.star.sdb.DatasourceAdministrationDialog
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.lang._XInitialization
+* @see ifc.ui.dialogs._XExecutableDialog
+* @see ifc.sdb._DatasourceAdministrationDialog
+* @see ifc.beans._XPropertySet
+*/
+public class ODatasourceAdministrationDialog extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sdb.DatasourceAdministrationDialog" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ODataSourceAdministrationDialog
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java
new file mode 100644
index 000000000000..c13fc05bacc3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java
@@ -0,0 +1,332 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.sdb.DataSourceBrowser</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * <li> <code>com::sun::star::util::XModifyBroadcaster</code></li>
+ * <li> <code>com::sun::star::awt::XTabController</code></li>
+ * <li> <code>com::sun::star::form::XFormController</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::frame::XDispatchProvider</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::frame::XController</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.util.XModifyBroadcaster
+ * @see com.sun.star.awt.XTabController
+ * @see com.sun.star.form.XFormController
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.frame.XDispatchProvider
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.frame.XController
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.container._XChild
+ * @see ifc.lang._XInitialization
+ * @see ifc.util._XModifyBroadcaster
+ * @see ifc.awt._XTabController
+ * @see ifc.form._XFormController
+ * @see ifc.container._XElementAccess
+ * @see ifc.frame._XDispatchProvider
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.frame._XController
+ * @see ifc.lang._XComponent
+ */
+public class ODatasourceBrowser extends TestCase {
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()));
+ System.setProperty("hideMe", "false");
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+ System.setProperty("hideMe", "true");
+
+ if (xTextDoc != null) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ *
+ * Creates a new text document disposing the old one if it was
+ * created. Using <code>Desktop</code> service get the frame
+ * of the document and with its help creates
+ * <code>DataSourceBrowser</code> dispatching the URL
+ * <code>'.component:DB/DataSourceBrowser'</code>. The
+ * component for testing is the controller of the
+ * <code>Browser</code> and it's got by searching its
+ * frame with the help of TextDocument frame, and obtaining
+ * the frame's controller. <p>
+ *
+ * <b>Note</b>: after creating the text document a short
+ * pause is needed to give a possibility to a frame to be
+ * created for the document. Else
+ * <code>Desktop.getCurrentFrame()</code> method can return
+ * <code>null</code> value. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDispatchProvider.URL'</code> for
+ * {@link ifc.frame._XDispatchProvider} </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController} : the model of
+ * the TextDocument. </li>
+ * <li> <code>'otherWindow'</code> for
+ * {@link ifc.frame._XController} : the window of
+ * the added shape. </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController} : the controller of
+ * the TextDocument. </li>
+ * <li> <code>'HasViewData'</code> for
+ * {@link ifc.frame._XController} : the
+ * <code>DataSourceBrowser</code> has no view data. </li>
+ * <li> <code>'XInitialization.args'</code> for
+ * {@link ifc.lang._XInitialization} : the arguments for
+ * tbe initialization</li>
+ * </ul>
+ *
+ * @see com.sun.star.frame.Desktop
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.frame.XFrame
+ * @see com.sun.star.frame.XController
+ * @see com.sun.star.frame.XDispatchProvider
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class, the_frame1);
+
+ XDispatch getting = null;
+
+ log.println("opening DatasourceBrowser");
+
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = the_frame2.getController();
+
+ Object[] params = new Object[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ try {
+ XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(
+ XInitialization.class, oObj);
+ xInit.initialize(params);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't initialize document", e);
+ }
+
+ shortWait();
+
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "CommandButton");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel shapeModel = aShape.getControl();
+
+ XControlAccess xCtrlAccess = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ secondController);
+ XControl xCtrl = null;
+
+ try {
+ xCtrl = xCtrlAccess.getControl(shapeModel);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ }
+
+ XWindow docWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ xCtrl);
+ log.println("creating a new environment for ODatasourceBrowser object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelations for XInitialization
+ tEnv.addObjRelation("XInitialization.args", params);
+
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("Frame", the_frame1);
+ tEnv.addObjRelation("SecondModel", aModel1);
+ tEnv.addObjRelation("otherWindow", docWindow);
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("HasViewData", new Boolean(false));
+
+
+ // Addig relation for XDispatchProvider
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ ".uno:DataSourceBrowser/FormLetter");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} // finish class oDatasourceBrowser
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java b/qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java
new file mode 100644
index 000000000000..93652025b748
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.task.XInteractionContinuation;
+import com.sun.star.task.XInteractionRequest;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdb.InteractionHandler</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::task::XInteractionHandler</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.task.XInteractionHandler
+* @see com.sun.star.sdb.InteractionHandler
+* @see ifc.task._XInteractionHandler
+*/
+public class OInteractionHandler extends TestCase {
+
+
+ private static class TestRequest implements XInteractionRequest {
+ public Object getRequest() {
+ return new SQLException("Test exception") ;
+ }
+
+ public XInteractionContinuation[] getContinuations() {
+ return new XInteractionContinuation[0] ;
+ }
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdb.InteractionHandler</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XInteractionHandler.Request'</code> for
+ * {@link ifc.task._XInteractionHandler} : this realtion
+ * is <code>com.sun.star.task.XInteractionRequest</code>
+ * interface implementation which depends on the component
+ * tested. In this case it emulates SQL error by returning
+ * <code>SQLException</code> object. </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.sdb.InteractionHandler" );
+
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XInteractionHandler.Request", new TestRequest()) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
new file mode 100644
index 000000000000..6f1e677d7d8b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+//import com.sun.star.awt.XControl;
+//import com.sun.star.awt.XControlModel;
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.uno.Exception;
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import lib.StatusException;
+import util.SOfficeFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdbc.XDataSource;
+
+public class OQueryDesign extends TestCase {
+
+ private static XDesktop xDesk;
+ private static XFrame xFrame;
+ private final String sDataSourceName = "Bibliography";
+ private static XConnection xConn;
+ private static XTextDocument xTextDoc;
+
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ xDesk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ XInterface oObj = null;
+
+ XDispatchProvider aProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class,xDesk);
+
+ XDispatch getting = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+
+ XNameAccess xNameAccess = null;
+
+ // we use the first datasource
+ XDataSource xDS = null;
+ try {
+ xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,
+ xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
+ } catch (Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Could not get Databasecontext", ex );
+ }
+ try {
+ xDS = (XDataSource) UnoRuntime.queryInterface(
+ XDataSource.class, xNameAccess.getByName( "Bibliography" ));
+ } catch (NoSuchElementException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Could not get XDataSource", ex );
+ } catch (WrappedTargetException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Could not get XDataSource", ex );
+ }
+ try {
+ xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,
+ xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
+ } catch (Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Could not get DatabaseConext", ex );
+ }
+
+ log.println("check XMultiServiceFactory");
+
+ try {
+ xConn = xDS.getConnection(new String(), new String());
+ } catch (SQLException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Could not get XConnection", ex );
+ }
+
+ log.println( "opening QueryDesign" );
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/QueryDesign";
+ getting = aProv.queryDispatch(the_url,"Query",12);
+ PropertyValue[] Args = new PropertyValue[2];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ Args[0] = param1;
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "QueryDesignView";
+ param2.Value = new Boolean(false);
+ Args[1] = param2;
+ param1.Name = "ActiveConnection";
+ param1.Value = xConn;
+ Args[1] = param2;
+ getting.dispatch(the_url,Args);
+
+ shortWait();
+
+ Object oDBC = null;
+
+ try {
+ oDBC = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ throw new StatusException("Could not instantiate DatabaseContext", e) ;
+ }
+
+ Object oDataSource = null;
+ try{
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC);
+ oDataSource = xNA.getByName(sDataSourceName);
+ } catch ( com.sun.star.container.NoSuchElementException e){
+ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
+ } catch ( com.sun.star.lang.WrappedTargetException e){
+ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
+ }
+ XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource);
+// XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ());
+
+// Frame = xMod.getCurrentController().getFrame();
+
+ xFrame = DesktopTools.getCurrentFrame(xMSF);
+
+ // get an instance of Frame
+ Object oFrame = null;
+ SOfficeFactory SOF = null;
+
+ SOF = SOfficeFactory.getFactory( xMSF );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Could not create document", e );
+ }
+
+ XModel xDocMod = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XFrame xTextFrame = xDocMod.getCurrentController().getFrame();
+
+ Object[] params = new Object[3];
+ param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+ param2 = new PropertyValue();
+ param2.Name = "Frame";
+ param2.Value = xTextFrame;
+ params[1] = param2;
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "QueryDesignView";
+ param3.Value = new Boolean(true);
+ params[2] = param3;
+
+
+ oObj = xFrame.getController();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //Adding ObjRelations for XInitialization
+ tEnv.addObjRelation("XInitialization.args", params);
+
+ //Object[] ExceptionParams = new Object[3];
+ //ExceptionParams = params;
+ //((PropertyValue) ExceptionParams[1]).Value = Frame;
+ Object[] ExceptionParams = new Object[3];
+ PropertyValue ExceptionParam1 = new PropertyValue();
+ ExceptionParam1.Name = "DataSourceName";
+ ExceptionParam1.Value = "Bibliography2";
+ ExceptionParams[0] = ExceptionParam1;
+ PropertyValue ExceptionParam2 = new PropertyValue();
+ ExceptionParam2.Name = "Frame";
+ ExceptionParam2.Value = null;
+ ExceptionParams[1] = ExceptionParam2;
+ PropertyValue ExceptionParam3 = new PropertyValue();
+ ExceptionParam3.Name = "QueryDesignView";
+ ExceptionParam3.Value = new Integer(17);//new Boolean(true);
+ ExceptionParams[2] = ExceptionParam3;
+
+ tEnv.addObjRelation("XInitialization.ExceptionArgs", ExceptionParams);
+
+ tEnv.addObjRelation("Frame", xFrame);
+
+ tEnv.addObjRelation("XInitialization.xIni", getUnititializedObj(Param));
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private XInitialization getUnititializedObj(TestParameters Param){
+ // creating an object wihch ist not initialized
+
+ // get a model of a DataSource
+ Object oDBC = null;
+ XMultiServiceFactory xMSF;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oDBC = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ throw new StatusException("Could not instantiate DatabaseContext", e) ;
+ }
+
+ Object oDataSource = null;
+ try{
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC);
+ oDataSource = xNA.getByName(sDataSourceName);
+ } catch ( com.sun.star.container.NoSuchElementException e){
+ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
+ } catch ( com.sun.star.lang.WrappedTargetException e){
+ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
+ }
+
+ XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource);
+ XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ());
+
+ // get an intaces of QueryDesign
+ Object oQueryDesign = null;
+ try{
+ oQueryDesign = xMSF.createInstance("com.sun.star.sdb.QueryDesign");
+ }catch( com.sun.star.uno.Exception e ) {
+ throw new StatusException("Could not instantiate QueryDesign", e) ;
+ }
+
+ XController xCont = (XController) UnoRuntime.queryInterface(XController.class, oQueryDesign);
+
+ // marry them all
+ xCont.attachModel(xMod);
+ xMod.connectController(xCont);
+ try{
+ xMod.setCurrentController(xCont);
+ } catch (com.sun.star.container.NoSuchElementException e){
+ throw new StatusException("Could not set controller", e) ;
+ }
+
+ //xCont.attachFrame(xFrame);
+
+ return (XInitialization) UnoRuntime.queryInterface(XInitialization.class, oQueryDesign);
+
+ }
+
+ @Override
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ try {
+ xConn.close() ;
+ DesktopTools.closeDoc(xFrame);
+ DesktopTools.closeDoc(xTextDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't close the connection") ;
+ e.printStackTrace(log) ;
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Connection was already closed. It's OK.") ;
+ }
+
+ }
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+} // finish class oDatasourceBrowser
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
new file mode 100644
index 000000000000..a7a9cac89c50
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
@@ -0,0 +1,644 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.utils;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdb.ParametersRequest;
+import com.sun.star.sdb.XInteractionSupplyParameters;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.task.XInteractionAbort;
+import com.sun.star.task.XInteractionContinuation;
+import com.sun.star.task.XInteractionRequest;
+import com.sun.star.ucb.AuthenticationRequest;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.frame.XModel;
+import com.sun.star.sdb.RowChangeEvent;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XParameters;
+import ifc.sdb._XCompletedExecution;
+import util.db.DataSource;
+import util.db.DataSourceDescriptor;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.sdb.RowSet</code>. <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TestDB/TestDB.dbf </b> : the database file with some
+ * predefined fields described in <code>util.DBTools</code>.
+ * The copy of this file is always made in temp directory for
+ * testing purposes.</li>
+ * </ul>
+ * The following parameters in ini-file used by this test:
+ * <ul>
+ * <li><code>test.db.url</code> - URL to MySQL database.
+ * For example: <code>mysql://mercury:3306/api_current</code></li>
+ * <li><code>test.db.user</code> - user for MySQL database</li>
+ * <li><code>test.db.password</code> - password for MySQL database</li>
+ * </ul>
+ *
+ * @see com.sun.star.sdbc.RowSet
+ * @see com.sun.star.sdbcx.XRowLocate
+ * @see com.sun.star.sdbc.XResultSetUpdate
+ * @see com.sun.star.util.XCancellable
+ * @see com.sun.star.sdbc.XParameters
+ * @see com.sun.star.sdbc.XResultSetMetaDataSupplier
+ * @see com.sun.star.sdbcx.XDeleteRows
+ * @see com.sun.star.sdbc.XCloseable
+ * @see com.sun.star.sdbcx.XColumnsSupplier
+ * @see com.sun.star.sdb.XResultSetAccess
+ * @see com.sun.star.sdbc.XResultSet
+ * @see com.sun.star.sdbc.XColumnLocate
+ * @see com.sun.star.sdbc.XRowSet
+ * @see com.sun.star.sdb.RowSet
+ * @see com.sun.star.sdbc.XRowUpdate
+ * @see com.sun.star.sdb.XRowSetApproveBroadcaster
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.sdbc.XRow
+ * @see com.sun.star.sdbc.XWarningsSupplier
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.sdbcx.ResultSet
+ * @see com.sun.star.sdbc.ResultSet
+ * @see ifc.sdbc._RowSet
+ * @see ifc.sdbcx._XRowLocate
+ * @see ifc.sdbc._XResultSetUpdate
+ * @see ifc.util._XCancellable
+ * @see ifc.sdbc._XParameters
+ * @see ifc.sdbc._XResultSetMetaDataSupplier
+ * @see ifc.sdbcx._XDeleteRows
+ * @see ifc.sdbc._XCloseable
+ * @see ifc.sdbcx._XColumnsSupplier
+ * @see ifc.sdb._XResultSetAccess
+ * @see ifc.sdbc._XResultSet
+ * @see ifc.sdbc._XColumnLocate
+ * @see ifc.sdbc._XRowSet
+ * @see ifc.sdb._RowSet
+ * @see ifc.sdbc._XRowUpdate
+ * @see ifc.sdb._XRowSetApproveBroadcaster
+ * @see ifc.beans._XPropertySet
+ * @see ifc.sdbc._XRow
+ * @see ifc.sdbc._XWarningsSupplier
+ * @see ifc.lang._XComponent
+ * @see ifc.sdbcx._ResultSet
+ * @see ifc.sdbc._ResultSet
+ */
+public class ORowSet extends TestCase {
+
+ private static int uniqueSuffix = 0 ;
+ private DBTools dbTools = null ;
+ private static String origDB = null ;
+ String tableName = null;
+ DataSourceDescriptor srcInf = null;
+ boolean isMySQLDB = false;
+ protected final static String dbSourceName = "ORowSetDataSource";
+ public XConnection m_connection = null;
+ private Object m_rowSet = null;
+ private DataSource m_dataSource;
+ private String m_tableFile;
+ private XMultiServiceFactory m_orb = null;
+
+ /**
+ * Initializes some class fields. Then creates DataSource, which serves
+ * as a single source for all tables created in the test.
+ * This DataSource then registered in the global
+ * <code>DatabaseContext</code> service. This data source's URL
+ * points to SOffice temp directory where tables are copied from
+ * <code>TestDocuments</code> directory on every environment
+ * creation.
+ * To create DataSource for MySQL database next parameters required
+ * in ini-file:
+ * <ul>
+ * <li><code>test.db.url</code> - URL to MySQL database.
+ * For example: <code>mysql://mercury:3306/api_current</code></li>
+ * <li><code>test.db.user</code> - user for MySQL database</li>
+ * <li><code>test.db.password</code> - password for MySQL database</li>
+ * </ul>
+ *
+ * @throws StatusException if DataSource can not be created or
+ * registered.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter _log)
+ throws StatusException
+ {
+ m_orb = (XMultiServiceFactory)Param.getMSF();
+
+ String tmpDir = utils.getOfficeTemp( m_orb );
+
+ origDB = util.utils.getFullTestDocName("TestDB/testDB.dbf");
+
+ dbTools = new DBTools( m_orb, _log );
+
+ // creating DataSource and registering it in DatabaseContext
+ String dbURL = (String) Param.get("test.db.url");
+ String dbUser = (String) Param.get("test.db.user");
+ String dbPassword = (String) Param.get("test.db.password");
+
+ log.println("Creating and registering DataSource ...");
+ srcInf = new DataSourceDescriptor( m_orb );
+ if (dbURL != null && dbUser != null && dbPassword != null)
+ {
+ isMySQLDB = true;
+ log.println("dbURL = " + dbURL);
+ log.println("dbUSER = " + dbUser);
+ log.println("dbPASSWORD = " + dbPassword);
+ //DataSource for mysql db
+ tableName = "soffice_test_table";
+ srcInf.URL = "jdbc:" + dbURL;
+ srcInf.IsPasswordRequired = new Boolean(true);
+ srcInf.Password = dbPassword;
+ srcInf.User = dbUser;
+ PropertyValue[] propInfo = new PropertyValue[1];
+ propInfo[0] = new PropertyValue();
+ propInfo[0].Name = "JavaDriverClass";
+ propInfo[0].Value = "org.gjt.mm.mysql.Driver";
+ srcInf.Info = propInfo;
+ }
+ else
+ {
+ srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
+ }
+ m_dataSource = srcInf.createDataSource();
+ m_dataSource.registerAs( dbSourceName, true );
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * The database (DBF) file is copied from test document directory
+ * into SOffice temp dir with unique name for each enviroment
+ * creation. If the file cann't be copied (is not released)
+ * then another unique name is used (file name suffix incremented
+ * by 1).<p>
+ *
+ * <code>com.sun.star.sdb.RowSet</code> service created and its
+ * source is all rows from the current copy of the table. Then
+ * row set command ("select all rows from a table") is executed
+ * and cursor is positioned to the first row. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ORowSet.Connection'</code> for
+ * internal component test usage. Is used for
+ * closing connection when cleaning up environment. </li>
+ * <li> <code>'XRowSetApproveBroadcaster.ApproveChecker'</code> for
+ * {@link ifc.sdb._XRowSetApproveBroadcaster} interface
+ * implementation which made actions required </li>
+ * <li> <code>'CurrentRowData'</code> for
+ * {@link ifc.sdbc._XRow}, {@link ifc.sdbc._XRowUpdate} :
+ * exports types and values of the current row data.</li>
+ * <li> <code>'XColumnLocate.ColumnName'</code> for
+ * {@link ifc.sdbc._XColumnLocate} :
+ * the name of the first column of the table.</li>
+ * <li> <code>'XParameters.ParamValues'</code> for
+ * {@link ifc.sdbc._XParameters} :
+ * Collection of parameter types presented in the query. </li>
+ * <li> <code>'XRowUpdate.XRow'</code> for
+ * {@link ifc.sdbc._XRowUpdate} :
+ * <code>XRow</code> interface of the current component.</li>
+ * <li> <code>'XResultSetUpdate.UpdateTester'</code> for
+ * {@link ifc.sdbc._XResultSetUpdate} </li>
+ * </ul>
+ *
+ * @see com.sun.star.sdb.DatabaseContext
+ * @see com.sun.star.sdb.DataSource
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ {
+ XMultiServiceFactory orb = (XMultiServiceFactory)Param.getMSF();
+ uniqueSuffix++;
+ boolean envCreatedOK = false ;
+
+ //initialize test table
+ if (isMySQLDB)
+ {
+ try
+ {
+ DBTools.DataSourceInfo legacyDescriptor = dbTools.newDataSourceInfo();
+ legacyDescriptor.Name = srcInf.Name;
+ legacyDescriptor.User = srcInf.User;
+ legacyDescriptor.Password = srcInf.Password;
+ legacyDescriptor.Info = srcInf.Info;
+ legacyDescriptor.URL = srcInf.URL;
+ legacyDescriptor.IsPasswordRequired = srcInf.IsPasswordRequired;
+ dbTools.initTestTableUsingJDBC(tableName, legacyDescriptor);
+ }
+ catch(java.sql.SQLException e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't " +
+ " init test table. SQLException..."));
+ }
+ catch(java.lang.ClassNotFoundException e)
+ {
+ throw new StatusException(Status.failed("Couldn't " +
+ "register mysql driver"));
+ }
+ }
+ else
+ {
+ String oldF = null ;
+ String newF = null ;
+ String tempFolder = utils.getOfficeTemp( orb );
+ do
+ {
+ tableName = "ORowSet_tmp" + uniqueSuffix ;
+ oldF = utils.getFullURL(origDB);
+ newF = tempFolder + tableName + ".dbf";
+ }
+ while ( !utils.tryOverwriteFile( orb, oldF, newF ) );
+ m_tableFile = newF;
+ }
+
+ try
+ {
+ m_rowSet = orb.createInstance("com.sun.star.sdb.RowSet");
+
+ XPropertySet rowSetProps = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet );
+
+ log.println("Trying to open: " + tableName);
+
+ rowSetProps.setPropertyValue("DataSourceName", dbSourceName);
+ rowSetProps.setPropertyValue("Command", tableName);
+ rowSetProps.setPropertyValue("CommandType",
+ new Integer(CommandType.TABLE));
+
+ final XRowSet rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSet);
+ rowSet.execute();
+ m_connection = UnoRuntime.queryInterface( XConnection.class, rowSetProps.getPropertyValue("ActiveConnection") );
+
+ XResultSet xRes = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
+ xRes.first();
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( (XInterface)m_rowSet );
+
+ // Adding obj relation for XRowSetApproveBroadcaster test
+ {
+ final XResultSet resultSet = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
+ final XResultSetUpdate resultSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, m_rowSet );
+ final XRowUpdate rowUpdate = UnoRuntime.queryInterface(XRowUpdate.class, m_rowSet );
+ final PrintWriter logF = log ;
+ tEnv.addObjRelation( "XRowSetApproveBroadcaster.ApproveChecker",
+ new ifc.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker()
+ {
+ public void moveCursor()
+ {
+ try
+ {
+ resultSet.beforeFirst();
+ resultSet.afterLast();
+ resultSet.first();
+ }
+ catch (com.sun.star.sdbc.SQLException e)
+ {
+ logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.moveCursor() :");
+ e.printStackTrace(logF);
+ throw new StatusException( "RowSetApproveChecker.moveCursor failed", e );
+ }
+ }
+ public RowChangeEvent changeRow()
+ {
+ try
+ {
+ resultSet.first();
+ rowUpdate.updateString(1, "ORowSetTest2");
+ resultSetUpdate.updateRow();
+ }
+ catch (com.sun.star.sdbc.SQLException e)
+ {
+ logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.changeRow() :");
+ e.printStackTrace(logF);
+ throw new StatusException( "RowSetApproveChecker.changeRow failed", e );
+ }
+ RowChangeEvent ev = new RowChangeEvent();
+ ev.Action = com.sun.star.sdb.RowChangeAction.UPDATE ;
+ ev.Rows = 1 ;
+
+ return ev ;
+ }
+ public void changeRowSet()
+ {
+ try
+ {
+ // since we gave the row set a parametrized statement, we need to ensure the
+ // parameter is actually filled, otherwise we would get an empty result set,
+ // which would imply some further tests failing
+ XParameters rowSetParams = UnoRuntime.queryInterface( XParameters.class, resultSet );
+ rowSetParams.setString( 1, "String2" );
+ rowSet.execute();
+ resultSet.first();
+ }
+ catch (com.sun.star.sdbc.SQLException e)
+ {
+ logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.changeRowSet() :");
+ e.printStackTrace(logF);
+ throw new StatusException( "RowSetApproveChecker.changeRowSet failed", e );
+ }
+ }
+ }
+ );
+ }
+ // Adding relations for XRow as a Vector with all data
+ // of current row of RowSet.
+
+ Vector rowData = new Vector();
+
+ for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) {
+ rowData.add(DBTools.TST_TABLE_VALUES[0][i]);
+ }
+
+ // here XRef must be added
+ // here XBlob must be added
+ // here XClob must be added
+ // here XArray must be added
+
+ tEnv.addObjRelation("CurrentRowData", rowData);
+
+ // Adding relation for XColumnLocate ifc test
+ tEnv.addObjRelation( "XColumnLocate.ColumnName", DBTools.TST_STRING_F );
+
+ // Adding relation for XCompletedExecution
+ tEnv.addObjRelation( "InteractionHandlerChecker", new InteractionHandlerImpl() );
+ try
+ {
+ String sqlCommand = isMySQLDB
+ ? "SELECT Column0 FROM soffice_test_table WHERE ( ( Column0 = :param1 ) )"
+ : "SELECT \"_TEXT\" FROM \"" + tableName + "\" WHERE ( ( \"_TEXT\" = :param1 ) )";
+ rowSetProps.setPropertyValue( "DataSourceName", dbSourceName );
+ rowSetProps.setPropertyValue( "Command", sqlCommand );
+ rowSetProps.setPropertyValue( "CommandType", new Integer(CommandType.COMMAND) );
+ }
+ catch(Exception e)
+ {
+ throw new StatusException( "setting up the RowSet with a parametrized command failed", e );
+ }
+
+ // Adding relation for XParameters ifc test
+ tEnv.addObjRelation( "XParameters.ParamValues", new Vector() );
+
+ // Adding relation for XRowUpdate
+ final XRow row = UnoRuntime.queryInterface( XRow.class, m_rowSet );
+ tEnv.addObjRelation("XRowUpdate.XRow", row);
+
+ // Adding relation for XResultSetUpdate
+ {
+ final XResultSet resultSet = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
+ final XRowUpdate rowUpdate = UnoRuntime.queryInterface( XRowUpdate.class, m_rowSet );
+
+ tEnv.addObjRelation("XResultSetUpdate.UpdateTester",
+ new ifc.sdbc._XResultSetUpdate.UpdateTester()
+ {
+ String lastUpdate = null ;
+
+ public int rowCount() throws SQLException
+ {
+ int prevPos = resultSet.getRow();
+ resultSet.last();
+ int count = resultSet.getRow();
+ resultSet.absolute(prevPos);
+
+ return count ;
+ }
+
+ public void update() throws SQLException
+ {
+ lastUpdate = row.getString(1);
+ lastUpdate += "_" ;
+ rowUpdate.updateString(1, lastUpdate);
+ }
+
+ public boolean wasUpdated() throws SQLException
+ {
+ String getStr = row.getString(1);
+ return lastUpdate.equals(getStr);
+ }
+
+ public int currentRow() throws SQLException
+ {
+ return resultSet.getRow();
+ }
+ }
+ );
+ }
+
+ envCreatedOK = true ;
+ return tEnv;
+
+ }
+ catch(com.sun.star.uno.Exception e)
+ {
+ log.println( "couldn't set up tes tenvironment:" );
+ e.printStackTrace(log);
+ try
+ {
+ if ( m_connection != null )
+ m_connection.close();
+ }
+ catch(Exception ex)
+ {
+ }
+ throw new StatusException( "couldn't set up tes tenvironment", e );
+ }
+ finally
+ {
+ if (!envCreatedOK)
+ {
+ try
+ {
+ m_connection.close();
+ }
+ catch(Exception ex)
+ {
+ }
+ }
+ }
+
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes connection of <code>RowSet</code> instance created.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log)
+ {
+ String doing = null;
+ try
+ {
+ doing = "revoking data source registration";
+ log.println( doing );
+ m_dataSource.revokeRegistration();
+
+ doing = "closing database document";
+ log.println( doing );
+ XModel databaseDocModel = UnoRuntime.queryInterface( XModel.class,
+ m_dataSource.getDatabaseDocument().getDatabaseDocument() );
+ String documentFile = databaseDocModel.getURL();
+
+ XCloseable closeModel = UnoRuntime.queryInterface( XCloseable.class,
+ m_dataSource.getDatabaseDocument().getDatabaseDocument() );
+ closeModel.close( true );
+
+ if ( m_rowSet != null )
+ {
+ doing = "disposing row set";
+ log.println( doing );
+ XComponent rowSetComponent = UnoRuntime.queryInterface( XComponent.class, m_rowSet );
+ rowSetComponent.dispose();
+ }
+
+ try
+ {
+ doing = "closing connection";
+ log.println( doing );
+ m_connection.close();
+ }
+ catch (com.sun.star.lang.DisposedException e)
+ {
+ log.println( "already closed - okay." );
+ }
+
+ doing = "deleting database file (" + documentFile + ")";
+ log.println( doing );
+ impl_deleteFile( documentFile );
+
+ if ( m_tableFile != null )
+ {
+ doing = "deleting dBase table file (" + m_tableFile + ")";
+ log.println( doing );
+ impl_deleteFile( m_tableFile );
+ }
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ log.println( "error: ");
+ e.printStackTrace(log);
+ }
+ }
+
+ private final void impl_deleteFile( final String _file )
+ {
+ java.io.File file = new java.io.File( _file );
+ file.delete();
+ if ( file.exists() )
+ file.deleteOnExit();
+ }
+
+ /**
+ * Implementation of interface _XCompletedExecution.CheckInteractionHandler
+ * for the XCompletedExecution test
+ * @see ifc.sdb._XCompletedExecution
+ */
+ public class InteractionHandlerImpl implements _XCompletedExecution.CheckInteractionHandler {
+ private boolean handlerWasUsed = false;
+ private PrintWriter log = new PrintWriter(System.out);
+
+ public boolean checkInteractionHandler() {
+ return handlerWasUsed;
+ }
+
+ public void handle(XInteractionRequest xInteractionRequest) {
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: handle called.");
+ ParametersRequest req = null;
+ boolean abort = false;
+
+ Object o = xInteractionRequest.getRequest();
+ if (o instanceof ParametersRequest) {
+ req = (ParametersRequest)o;
+ }
+ else if (o instanceof AuthenticationRequest) {
+ log.println("### The request in XCompletedExecution is of type 'AuthenticationRequest'");
+ log.println("### This is not implemented in ORowSet.InteractionHandlerImpl test -> abort.");
+ abort = true;
+ }
+ else {
+ log.println("### Unknown request:" + o.toString());
+ log.println("### This is not implemented in ORowSet.InteractionHandlerImpl test -> abort.");
+ abort = true;
+ }
+
+ XInteractionContinuation[]xCont = xInteractionRequest.getContinuations();
+ XInteractionSupplyParameters xParamCallback = null;
+ for(int i=0; i<xCont.length; i++) {
+ if (abort) {
+ XInteractionAbort xAbort = null;
+ xAbort = UnoRuntime.queryInterface(XInteractionAbort.class, xCont[i]);
+ if (xAbort != null)
+ xAbort.select();
+ return;
+ }
+ else {
+ xParamCallback = UnoRuntime.queryInterface(XInteractionSupplyParameters.class, xCont[i]);
+ if (xParamCallback != null)
+ break;
+ }
+ }
+ if (xParamCallback != null) {
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: supplying parameters.");
+ handlerWasUsed = true;
+ PropertyValue[] prop = new PropertyValue[1];
+ prop[0] = new PropertyValue();
+ prop[0].Name = "param1";
+ prop[0].Value = "Hi.";
+
+ xParamCallback.setParameters(prop);
+ xParamCallback.select();
+ }
+ else { // we should never reach this: abort has to be true first.
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: Got no " +
+ "'XInteractionSupplyParameters' and no 'XInteractionAbort'.");
+ }
+ }
+
+ public void setLog(PrintWriter log) {
+ this.log = log;
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java
new file mode 100644
index 000000000000..c4efa6a963b6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.sdb.ErrorMessageDialog</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * <li> <code>com::sun::star::sdb::ErrorMessageDialog</code></li>
+ * <li> <code>com::sun::star::ui::dialogs::XExecutableDialog</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.sdb.ErrorMessageDialog
+ * @see com.sun.star.ui.dialogs.XExecutableDialog
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.sdb._ErrorMessageDialog
+ * @see ifc.ui.dialogs._XExecutableDialog
+ * @see ifc.beans._XPropertySet
+ */
+public class OSQLMessageDialog extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ *
+ * Creates an instance of the service
+ * <code>com.sun.star.sdb.ErrorMessageDialog</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ERR1', 'ERR2'</code> for
+ * {@link ifc.sdb._ErrorMessageDialog} </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ Object err1 = null;
+ Object err2 = null;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.sdb.ErrorMessageDialog" );
+
+ err1 = new com.sun.star.sdbc.SQLException("err1");
+ err2 = new com.sun.star.sdbc.SQLException("err2");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ // create XWindow for Object relations...
+ com.sun.star.awt.XToolkit xToolkit = null;
+
+ try{
+ xToolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
+ com.sun.star.awt.XToolkit.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.awt.Toolkit") );
+ } catch (com.sun.star.uno.Exception e){
+ log.println("could not create instacne of 'com.sun.star.awt.Toolkit'" );
+ throw new StatusException("could not create instacne of 'com.sun.star.awt.Toolkit'", e) ;
+ }
+
+ // Describe the properties of the container window.
+ com.sun.star.awt.WindowDescriptor aDescriptor =
+ new com.sun.star.awt.WindowDescriptor();
+
+ aDescriptor.Type = com.sun.star.awt.WindowClass.TOP ;
+ aDescriptor.WindowServiceName = "window" ;
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = null;
+ aDescriptor.Bounds = new com.sun.star.awt.Rectangle(0,0,0,0);
+
+ aDescriptor.WindowAttributes =
+ com.sun.star.awt.WindowAttribute.BORDER |
+ com.sun.star.awt.WindowAttribute.MOVEABLE |
+ com.sun.star.awt.WindowAttribute.SIZEABLE |
+ com.sun.star.awt.WindowAttribute.CLOSEABLE ;
+
+ com.sun.star.awt.XWindowPeer xPeer = null;
+ try{
+
+ xPeer = xToolkit.createWindow(aDescriptor) ;
+
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ log.println("could not create window" );
+ throw new StatusException("could not create window", e) ;
+ }
+
+ com.sun.star.awt.XWindow xWindow = (com.sun.star.awt.XWindow)UnoRuntime.queryInterface (
+ com.sun.star.awt.XWindow .class, xPeer);
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println("add ObjectRelations err1 and err2 for 'ErrorMessageDialog'");
+ tEnv.addObjRelation("ERR1",err1);
+ tEnv.addObjRelation("ERR2",err2);
+ tEnv.addObjRelation("ERR_XWindow", xWindow);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OSQLMessageDialog
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java
new file mode 100644
index 000000000000..d2b05478873c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdb.XSingleSelectQueryAnalyzer;
+import com.sun.star.sdb.XSingleSelectQueryComposer;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XDataSource;
+import com.sun.star.sdbcx.XColumnsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.sdb.DataSource</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::sdbc::RowSet</code></li>
+ * <li> <code>com::sun::star::sdbcx::XRowLocate</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSetUpdate</code></li>
+ * <li> <code>com::sun::star::util::XCancellable</code></li>
+ * <li> <code>com::sun::star::sdbc::XParameters</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSetMetaDataSupplier</code></li>
+ * <li> <code>com::sun::star::sdbcx::XDeleteRows</code></li>
+ * <li> <code>com::sun::star::sdbc::XCloseable</code></li>
+ * <li> <code>com::sun::star::sdbcx::XColumnsSupplier</code></li>
+ * <li> <code>com::sun::star::sdb::XResultSetAccess</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSet</code></li>
+ * <li> <code>com::sun::star::sdbc::XColumnLocate</code></li>
+ * <li> <code>com::sun::star::sdbc::XRowSet</code></li>
+ * <li> <code>com::sun::star::sdb::RowSet</code></li>
+ * <li> <code>com::sun::star::sdbc::XRowUpdate</code></li>
+ * <li> <code>com::sun::star::sdb::XRowSetApproveBroadcaster</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::sdbc::XRow</code></li>
+ * <li> <code>com::sun::star::sdbc::XWarningsSupplier</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::sdbcx::ResultSet</code></li>
+ * <li> <code>com::sun::star::sdbc::ResultSet</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TestDB/TestDB.dbf </b> : the database file with some
+ * predefined fields described in <code>util.DBTools</code>.
+ * The copy of this file is always made in temp directory for
+ * testing purposes.</li>
+ * </ul> <p>
+ * The following parameters in ini-file used by this test:
+ * <ul>
+ * <li><code>test.db.url</code> - URL to MySQL database.
+ * For example: <code>mysql://mercury:3306/api_current</code></li>
+ * <li><code>test.db.user</code> - user for MySQL database</li>
+ * <li><code>test.db.password</code> - password for MySQL database</li>
+ * </ul><p>
+ *
+ * @see com.sun.star.sdbc.RowSet
+ * @see com.sun.star.sdbcx.XRowLocate
+ * @see com.sun.star.sdbc.XResultSetUpdate
+ * @see com.sun.star.util.XCancellable
+ * @see com.sun.star.sdbc.XParameters
+ * @see com.sun.star.sdbc.XResultSetMetaDataSupplier
+ * @see com.sun.star.sdbcx.XDeleteRows
+ * @see com.sun.star.sdbc.XCloseable
+ * @see com.sun.star.sdbcx.XColumnsSupplier
+ * @see com.sun.star.sdb.XResultSetAccess
+ * @see com.sun.star.sdbc.XResultSet
+ * @see com.sun.star.sdbc.XColumnLocate
+ * @see com.sun.star.sdbc.XRowSet
+ * @see com.sun.star.sdb.RowSet
+ * @see com.sun.star.sdbc.XRowUpdate
+ * @see com.sun.star.sdb.XRowSetApproveBroadcaster
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.sdbc.XRow
+ * @see com.sun.star.sdbc.XWarningsSupplier
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.sdbcx.ResultSet
+ * @see com.sun.star.sdbc.ResultSet
+ * @see ifc.sdbc._RowSet
+ * @see ifc.sdbcx._XRowLocate
+ * @see ifc.sdbc._XResultSetUpdate
+ * @see ifc.util._XCancellable
+ * @see ifc.sdbc._XParameters
+ * @see ifc.sdbc._XResultSetMetaDataSupplier
+ * @see ifc.sdbcx._XDeleteRows
+ * @see ifc.sdbc._XCloseable
+ * @see ifc.sdbcx._XColumnsSupplier
+ * @see ifc.sdb._XResultSetAccess
+ * @see ifc.sdbc._XResultSet
+ * @see ifc.sdbc._XColumnLocate
+ * @see ifc.sdbc._XRowSet
+ * @see ifc.sdb._RowSet
+ * @see ifc.sdbc._XRowUpdate
+ * @see ifc.sdb._XRowSetApproveBroadcaster
+ * @see ifc.beans._XPropertySet
+ * @see ifc.sdbc._XRow
+ * @see ifc.sdbc._XWarningsSupplier
+ * @see ifc.lang._XComponent
+ * @see ifc.sdbcx._ResultSet
+ * @see ifc.sdbc._ResultSet
+ */
+public class OSingleSelectQueryComposer extends TestCase {
+
+ private static int uniqueSuffix = 0 ;
+ private DBTools dbTools = null ;
+ private static String origDB = null ;
+ private PrintWriter log = null ;
+ private static String tmpDir = null ;
+ String tableName = null;
+ DBTools.DataSourceInfo srcInf = null;
+ boolean isMySQLDB = false;
+ protected final static String dbSourceName = "OSingleSelectQueryComposerDataSource";
+ public XConnection conn = null;
+
+
+ protected void initialize ( TestParameters Param, PrintWriter log)
+ throws StatusException {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ *
+ * Object relations created :
+ * <ul>SingleSelectQueryAnalyzer
+
+ * <li> <code>'xComposer'</code> for
+ * {@link ifc.sdb.XSingleSelectQueryAnalyzer} interface
+ * <li> <code>'xQueryAna'</code> for
+ * {@link ifc.sdb.XSingleSelectQueryComposer} interface
+ * <li> <code>'xProp'</code> for
+ * {@link ifc.sdb.XSingleSelectQueryComposer} interface
+ * <li> <code>'colName'</code> for
+ * {@link ifc.sdb.XSingleSelectQueryComposer} interface
+ * </ul>
+ *
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+ boolean envCreatedOK = false ;
+
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+
+ XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+ XNameAccess.class,
+ xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
+ // we use the first datasource
+ XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
+ XDataSource.class, xNameAccess.getByName( "Bibliography" ));
+
+ log.println("check XMultiServiceFactory");
+ XMultiServiceFactory xConn = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,
+ xDS.getConnection(new String(),new String()));
+
+ log.println("check getAvailableServiceNames");
+ String[] sServiceNames = xConn.getAvailableServiceNames();
+ if (! sServiceNames[0].equals("com.sun.star.sdb.SingleSelectQueryComposer"))
+ {
+ log.println("Service 'SingleSelectQueryComposer' not supported");
+ }
+
+ oInterface = (XInterface) xConn.createInstance( sServiceNames[0]);
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException("Service wasn't created",
+ new NullPointerException()) ;
+ }
+
+ Object oRowSet = xMSF.createInstance("com.sun.star.sdb.RowSet") ;
+
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oRowSet) ;
+
+ xSetProp.setPropertyValue("DataSourceName", "Bibliography") ;
+ xSetProp.setPropertyValue("Command", "biblio") ;
+ xSetProp.setPropertyValue("CommandType",
+ new Integer(CommandType.TABLE)) ;
+
+ com.sun.star.sdbc.XRowSet xORowSet = (com.sun.star.sdbc.XRowSet)
+ UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class,
+ oRowSet) ;
+
+ xORowSet.execute() ;
+
+ XColumnsSupplier xColSup = (XColumnsSupplier)
+ UnoRuntime.queryInterface(XColumnsSupplier.class, oRowSet);
+
+ XNameAccess xCols = xColSup.getColumns();
+
+ XPropertySet xCol = (XPropertySet) AnyConverter.toObject(
+ new Type(XPropertySet.class),
+ xCols.getByName(xCols.getElementNames()[0]));
+
+ XSingleSelectQueryAnalyzer xQueryAna = (XSingleSelectQueryAnalyzer)
+ UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class,
+ oInterface);
+
+ // XSingleSelectQueryComposer
+ XSingleSelectQueryComposer xComposer = (XSingleSelectQueryComposer)
+ UnoRuntime.queryInterface(XSingleSelectQueryComposer.class,
+ xQueryAna);
+ xQueryAna.setQuery("SELECT * FROM \"biblio\"");
+
+ oObj = (XInterface) oInterface;
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // for XSingleSelectQueryAnalyzer
+ tEnv.addObjRelation("xComposer", xComposer);
+
+ // for XSingleSelectQueryComposer
+ tEnv.addObjRelation("xQueryAna", xQueryAna);
+
+ tEnv.addObjRelation("xProp", xCol);
+ tEnv.addObjRelation("colName", xCols.getElementNames()[0]);
+
+ envCreatedOK = true ;
+ return tEnv;
+
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Can't create object" );
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create object", e) ;
+ }
+
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes connection of <code>RowSet</code> instance created.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java
new file mode 100644
index 000000000000..01c1713199f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java
@@ -0,0 +1,485 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XBoundComponent;
+import com.sun.star.form.XGridColumnFactory;
+import com.sun.star.form.XLoadable;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+* Test for object which represents the control of the Grid model. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::util::XModifyBroadcaster</code></li>
+* <li> <code>com::sun::star::form::XGridFieldDataSupplier</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::form::XGrid</code></li>
+* <li> <code>com::sun::star::awt::XControl</code></li>
+* <li> <code>com::sun::star::util::XModeSelector</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::awt::XWindow</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::frame::XDispatch</code></li>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::frame::XDispatchProviderInterception</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::awt::XView</code></li>
+* <li> <code>com::sun::star::container::XContainer</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.util.XModifyBroadcaster
+* @see com.sun.star.form.XGridFieldDataSupplier
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.form.XGrid
+* @see com.sun.star.awt.XControl
+* @see com.sun.star.util.XModeSelector
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.awt.XWindow
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.frame.XDispatch
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.frame.XDispatchProviderInterception
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.awt.XView
+* @see com.sun.star.container.XContainer
+* @see ifc.util._XModifyBroadcaster
+* @see ifc.form._XGridFieldDataSupplier
+* @see ifc.view._XSelectionSupplier
+* @see ifc.form._XGrid
+* @see ifc.awt._XControl
+* @see ifc.util._XModeSelector
+* @see ifc.container._XElementAccess
+* @see ifc.awt._XWindow
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.frame._XDispatch
+* @see ifc.container._XEnumerationAccess
+* @see ifc.form._XBoundComponent
+* @see ifc.frame._XDispatchProviderInterception
+* @see ifc.container._XIndexAccess
+* @see ifc.lang._XComponent
+* @see ifc.awt._XView
+* @see ifc.container._XContainer
+*/
+public class SbaXGridControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ //closing the appearing dialog before disposing the document
+ XInterface toolkit = null;
+
+ try {
+ toolkit = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
+ .createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ XInterface button = AccessibilityTools.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON);
+
+ XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, button);
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iob) {
+ log.println("couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close dialog");
+ }
+
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * For object creation first a
+ * <code>com.sun.star.form.component.GridControl<code> instance
+ * is added to the <code>ControlShape</code>. Then this model's
+ * control is retrieved.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt_XView} test : <code>XGraphics</code>
+ * object different that belong to the object tested.</li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XCOntrol} </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XCOntrol} </li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XCOntrol} </li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} for switching focus.</li>
+ * <li> <code>'XDispatch.URL'</code> for
+ * {@link ifc.frame._XDispatch} the url which moves
+ * DB cursor to the next row (".uno:FormSlots/moveToNext").</li>
+ * <li> <code>'XContainer.Container'</code> for
+ * {@link ifc.container._XContainer} as the component created
+ * doesn't support <code>XContainer</code> itself, but
+ * it is supported by its model. So this model is passed.</li>
+ * <li> <code>'INSTANCE'</code> for
+ * {@link ifc.container._XContainer} the instance to be
+ * inserted into collection. Is a column instance.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XPropertySet aControl = null;
+ XPropertySet aControl2 = null;
+ XPropertySet aControl3 = null;
+ XPropertySet aControl4 = null;
+ XGridColumnFactory columns = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = createGrid(xTextDoc, 3000, 4500, 15000, 10000);
+
+ XControlModel the_Model = aShape.getControl();
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XLoadable formLoader = FormTools.bindForm(xTextDoc);
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ try {
+ columns = (XGridColumnFactory) UnoRuntime.queryInterface(
+ XGridColumnFactory.class, the_Model);
+ aControl = columns.createColumn("TextField");
+ aControl.setPropertyValue("DataField", "Identifier");
+ aControl.setPropertyValue("Label", "Identifier");
+ aControl2 = columns.createColumn("TextField");
+ aControl2.setPropertyValue("DataField", "Publisher");
+ aControl2.setPropertyValue("Label", "Publisher");
+ aControl3 = columns.createColumn("TextField");
+ aControl3.setPropertyValue("DataField", "Author");
+ aControl3.setPropertyValue("Label", "Author");
+ aControl4 = columns.createColumn("TextField");
+ aControl4.setPropertyValue("DataField", "Title");
+ aControl4.setPropertyValue("Label", "Title");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ }
+
+ XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, the_Model);
+
+ try {
+ aContainer.insertByName("First", aControl);
+ aContainer.insertByName("Second", aControl2);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ }
+
+ //now get the OGridControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get GridControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e);
+ }
+
+
+ // creating another window
+ aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ the_Model = aShape.getControl();
+
+
+ //Try to query XControlAccess
+ the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the TextControl
+ XWindow win = null;
+ Object cntrl = null;
+
+ try {
+ cntrl = the_access.getControl(the_Model);
+ win = (XWindow) UnoRuntime.queryInterface(XWindow.class, cntrl);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get Control");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get Control", e);
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Relations for XSelectionSupplier
+ tEnv.addObjRelation("Selections",
+ new Object[] {
+ new Object[] { new Integer(0) }, new Object[] { new Integer(1) }
+ });
+ tEnv.addObjRelation("Comparer",
+ new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return ((Integer) o1).compareTo((Integer)o2);
+ }
+
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ }
+ });
+
+
+ //Realtion for XContainer
+ tEnv.addObjRelation("XContainer.Container", aContainer);
+ tEnv.addObjRelation("INSTANCE", aControl3);
+ tEnv.addObjRelation("INSTANCE2", aControl4);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+
+ // Adding relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", win);
+
+ // Adding relation for XDispatch
+ URL url = new URL();
+ url.Complete = ".uno:FormSlots/moveToNext";
+
+
+ //url.Complete = ".uno:GridSlots/RowHeight";
+ //url.Complete = ".uno:GridSlots/RowHeight" ;
+ tEnv.addObjRelation("XDispatch.URL", url);
+
+ log.println("ImplName: " + utils.getImplName(oObj));
+
+ FormTools.switchDesignOf((XMultiServiceFactory)Param.getMSF(), xTextDoc);
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj;
+ final XLoadable formLoaderF = formLoader;
+ final XPropertySet ps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, aControl2);
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private String lastText = "";
+
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded()) {
+ formLoaderF.load();
+ }
+
+ lastText = "_" + ps.getPropertyValue("Text");
+ ps.setPropertyValue("Text", lastText);
+ }
+
+ public void commit() throws com.sun.star.sdbc.SQLException {
+ XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface(
+ XBoundComponent.class, ctrl);
+ XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface(
+ XResultSetUpdate.class,
+ formLoaderF);
+
+ bound.commit();
+ update.updateRow();
+ }
+
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ String getS = (String) ps.getPropertyValue("Text");
+
+ return lastText.equals(getS);
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ public static XControlShape createGrid(XComponent oDoc, int height,
+ int width, int x, int y) {
+ Size size = new Size();
+ Point position = new Point();
+ XControlShape oCShape = null;
+ XControlModel aControl = null;
+
+ //get MSF
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ oDoc);
+
+ try {
+ Object oInt = oDocMSF.createInstance(
+ "com.sun.star.drawing.ControlShape");
+ Object aCon = oDocMSF.createInstance(
+ "com.sun.star.form.component.GridControl");
+ XPropertySet model_props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, aCon);
+ model_props.setPropertyValue("DefaultControl",
+ "com.sun.star.form.control.InteractionGridControl");
+ aControl = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class, aCon);
+ oCShape = (XControlShape) UnoRuntime.queryInterface(
+ XControlShape.class, oInt);
+ size.Height = height;
+ size.Width = width;
+ position.X = x;
+ position.Y = y;
+ oCShape.setSize(size);
+ oCShape.setPosition(position);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ System.out.println("Couldn't create Grid" + e);
+ throw new StatusException("Couldn't create Grid", e);
+ }
+
+ oCShape.setControl(aControl);
+
+ return oCShape;
+ } // finish createGrid
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
new file mode 100644
index 000000000000..7b5827a2475e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
@@ -0,0 +1,380 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import util.DesktopTools;
+import util.utils;
+
+
+/**
+* Object implements the following interfaces :
+* <ul>
+* <li><code>::com::sun::star::accessibility::XAccessible</code></li>
+* <li><code>::com::sun::star::accessibility::XAccessibleContext
+* </code></li>
+* <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+* </code></li>
+* </ul><p>
+* @see com.sun.star.accessibility.XAccessible
+* @see com.sun.star.accessibility.XAccessibleContext
+* @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+* @see ifc.accessibility._XAccessible
+* @see ifc.accessibility._XAccessibleContext
+* @see ifc.accessibility._XAccessibleEventBroadcaster
+*/
+public class TableWindowAccessibility extends TestCase {
+ XWindow xWindow = null;
+ Object oDBSource = null;
+ String aFile = "";
+ XConnection connection = null;
+ XIsolatedConnection isolConnection = null;
+ XComponent QueryComponent = null;
+ String user = "";
+ String password="";
+
+ /**
+ * Creates a new DataSource and stores it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens the QueryComponent.with loadComponentFromURL
+ * and gets the object with the role PANEL and the implementation
+ * name that contains TabelViewAccessibility
+ * @param Param test parameters
+ * @param log writer to log information while testing
+ * @return
+ * @throws StatusException
+ * @see TestEnvironment
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ Object oDBContext = null;
+ Object oDBSource = null;
+ Object newQuery = null;
+ Object toolkit = null;
+ XStorable store = null;
+
+ try {
+ oDBContext = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.DatabaseContext");
+ oDBSource = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.DataSource");
+ newQuery = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.sdb.QueryDefinition");
+ toolkit = ((XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ String mysqlURL = (String) Param.get("mysql.url");
+
+ if (mysqlURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'mysql.url' from ini-file"));
+ }
+
+ user = (String) Param.get("jdbc.user");
+ password = (String) Param.get("jdbc.password");
+
+ if ((user == null) || (password == null)) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
+ }
+
+ PropertyValue[] info = new PropertyValue[2];
+ info[0] = new PropertyValue();
+ info[0].Name = "user";
+ info[0].Value = user;
+ info[1] = new PropertyValue();
+ info[1].Name = "password";
+ info[1].Value = password;
+
+ XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDBSource);
+
+ try {
+ propSetDBSource.setPropertyValue("URL", mysqlURL);
+ propSetDBSource.setPropertyValue("Info", info);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+
+ try {
+ log.println ("writing database file ...");
+ XDocumentDataSource xDDS = (XDocumentDataSource)
+ UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
+ store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
+ xDDS.getDatabaseDocument());
+ aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"TableWindow.odb";
+ log.println("... filename will be "+aFile);
+ store.storeAsURL(aFile,new PropertyValue[]{});
+ log.println("... done");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't register object"));
+ }
+
+ isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface(
+ XIsolatedConnection.class,
+ oDBSource);
+
+ XConnection connection = null;
+ XStatement statement = null;
+
+ final String tbl_name1 = "tst_table1";
+ final String tbl_name2 = "tst_table2";
+ final String col_name1 = "id1";
+ final String col_name2 = "id2";
+
+ try {
+ connection = isolConnection.getIsolatedConnection(user, password);
+ statement = connection.createStatement();
+ statement.executeUpdate("drop table if exists " + tbl_name1);
+ statement.executeUpdate("drop table if exists " + tbl_name2);
+ statement.executeUpdate("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ } catch (com.sun.star.sdbc.SQLException e) {
+ try {
+ shortWait();
+ connection = isolConnection.getIsolatedConnection(user,
+ password);
+ statement = connection.createStatement();
+ statement.executeUpdate("drop table if exists " + tbl_name1);
+ statement.executeUpdate("drop table if exists " + tbl_name2);
+ statement.executeUpdate("create table " + tbl_name1 + " (" +
+ col_name1 + " int)");
+ statement.executeUpdate("create table " + tbl_name2 + " (" +
+ col_name2 + " int)");
+ } catch (com.sun.star.sdbc.SQLException e2) {
+ e2.printStackTrace(log);
+ throw new StatusException(Status.failed("SQLException"));
+ }
+ }
+
+ XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface(
+ XQueryDefinitionsSupplier.class,
+ oDBSource);
+
+ XNameAccess defContainer = querySuppl.getQueryDefinitions();
+
+ XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, newQuery);
+
+ try {
+ final String query = "select * from " + tbl_name1 + ", " +
+ tbl_name2 + " where " + tbl_name1 + "." +
+ col_name1 + "=" + tbl_name2 + "." +
+ col_name2;
+ queryProp.setPropertyValue("Command", query);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property value"));
+ }
+
+ XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class,
+ defContainer);
+
+ try {
+ queryContainer.insertByName("Query1", newQuery);
+ store.store();
+ connection.close ();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ } catch (com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ } catch (com.sun.star.sdbc.SQLException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't insert query"));
+ }
+
+ PropertyValue[] loadProps = new PropertyValue[3];
+ loadProps[0] = new PropertyValue();
+ loadProps[0].Name = "QueryDesignView";
+ loadProps[0].Value = Boolean.TRUE;
+
+ loadProps[1] = new PropertyValue();
+ loadProps[1].Name = "CurrentQuery";
+ loadProps[1].Value = "Query1";
+
+ loadProps[2] = new PropertyValue();
+ loadProps[2].Name = "DataSource";
+ loadProps[2].Value = oDBSource;
+
+ QueryComponent = DesktopTools.loadDoc((XMultiServiceFactory) Param.getMSF (),".component:DB/QueryDesign",loadProps);
+
+ xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ AccessibilityTools.printAccessibleTree (log,xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
+ "TableWindowAccessibility");
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println("creating TestEnvironment ... done");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ shortWait();
+
+ XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+
+ final Point point = accComp.getLocationOnScreen();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Robot rob = new Robot();
+ rob.mouseMove(point.X + 2, point.Y + 7);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseMove(point.X + 400, point.Y);
+ rob.mouseRelease (InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ System.out.println("desired child doesn't exist");
+ }
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes all open documents.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try
+ {
+
+ log.println ("closing QueryComponent ...");
+ DesktopTools.closeDoc (QueryComponent);
+ log.println ("... done");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF ();
+ Object sfa = xMSF.createInstance ("com.sun.star.comp.ucb.SimpleFileAccess");
+ XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa);
+ log.println ("deleting database file");
+ xSFA.kill (aFile);
+ log.println ("Could delete file "+aFile+": "+!xSFA.exists (aFile));
+ } catch (Exception e)
+ {
+ e.printStackTrace ();
+ }
+ }
+
+
+ /**
+ * Sleeps for 1.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_dbaccess/package.html b/qadevOOo/tests/java/mod/_dbaccess/package.html
new file mode 100644
index 000000000000..46bef890cbf5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'dbaccess'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java b/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java
new file mode 100644
index 000000000000..eb00a417afd0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dbpool;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sdbc.ConnectionPool</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sdbc::XDriverManager</code></li>
+* </ul>
+* @see com.sun.star.sdbc.XDriverManager
+* @see ifc.sdbc.XDriverManager
+*/
+public class OConnectionPool extends TestCase {
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)
+ xMSF.createInstance("com.sun.star.sdbc.ConnectionPool");
+ } catch(com.sun.star.uno.Exception e) {
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //adding relations for XDriverManager
+ String dbaseURL = (String) Param.get("dbase.url");
+ if (dbaseURL == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get parameter 'dbase.url'"));
+ }
+
+ tEnv.addObjRelation("SDBC.URL", "sdbc:dbase:" + dbaseURL);
+
+ String jdbcURL = (String) Param.get("jdbc.url");
+ if (jdbcURL == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get parameter 'jdbc.url'"));
+ }
+
+ tEnv.addObjRelation("JDBC.URL", "jdbc:" + jdbcURL);
+
+ String jdbcUser = (String) Param.get("jdbc.user");
+ if (jdbcUser == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get parameter 'jdbc.user'"));
+ }
+
+ String jdbcPassword = (String) Param.get("jdbc.password");
+ if (jdbcPassword == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get parameter 'jdbc.password'"));
+ }
+
+ PropertyValue[] jdbcInfo = new PropertyValue[3];
+ jdbcInfo[0] = new PropertyValue();
+ jdbcInfo[0].Name = "user";
+ jdbcInfo[0].Value = jdbcUser;
+ jdbcInfo[1] = new PropertyValue();
+ jdbcInfo[1].Name = "password";
+ jdbcInfo[1].Value = jdbcPassword;
+ jdbcInfo[2] = new PropertyValue();
+ jdbcInfo[2].Name = "JavaDriverClass";
+ jdbcInfo[2].Value = DBTools.TST_JDBC_DRIVER;
+
+ tEnv.addObjRelation("JDBC.INFO", jdbcInfo);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java b/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java
new file mode 100644
index 000000000000..6f2e850c5ffe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._defreg;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.RegistryTools;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.registry.NestedRegistry</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::registry::XSimpleRegistry</code></li>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> XSimpleRegistry.rdb </b> : Registry file created before. </li>
+* <li><b> XSimpleRegistry_open#.rdb </b> : Temporary registry file as copy of
+* <b> XSimpleRegistry.rdb </b> in the SOffice temp directory.
+* ('#' - is an ordinary number) </li>
+* <li><b> XSimpleRegistry_merge#.rdb </b> : Temporary registry file as copy of
+* <b> XSimpleRegistry.rdb </b> in the SOffice temp directory.
+* ('#' - is an ordinary number) </li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.registry.XSimpleRegistry
+* @see com.sun.star.lang.XInitialization
+* @see ifc.registry._XSimpleRegistry
+* @see ifc.lang._XInitialization
+*/
+public class NestedRegistry extends TestCase {
+
+ protected static int uniq = 0 ;
+ XSimpleRegistry reg1;
+ XSimpleRegistry reg2;
+
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam ) {
+ try {
+ reg1.destroy();
+ reg2.destroy();
+ }
+ catch (com.sun.star.registry.InvalidRegistryException e) {}
+ }
+
+ /**
+ * Creates a temporary copy of file, which is deleted when VM exits.
+ * @param src Source file path.
+ * @param dst Destination file path.
+ * @throws java.io.IOException If any problems occur during copiing.
+ */
+ protected void copyFile(String src, String dst, PrintWriter log)
+ throws java.io.IOException {
+ log.println("Copy File "+src+" to "+dst);
+ File srcF = new File(src) ;
+ File dstF = new File(dst) ;
+
+ if (dstF.exists()) dstF.delete() ;
+ dstF.createNewFile() ;
+
+ dstF.deleteOnExit() ;
+
+ FileInputStream fIn = new FileInputStream(srcF) ;
+ FileOutputStream fOut = new FileOutputStream(dstF) ;
+
+ byte[] buf = new byte[1024] ;
+ int bytesRead = 0 ;
+ while ((bytesRead = fIn.read(buf)) > 0)
+ fOut.write(buf, 0, bytesRead) ;
+
+ fIn.close() ;
+ fOut.close() ;
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two temporary copies of registry file created before, opens
+ * them, and creates service <code>com.sun.star.comp.stoc.NestedRegistry</code>
+ * with these two registries. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'NR'</code> for {@link ifc.registry._XSimpleRegistry} :
+ * Just informs interface test that <code>NestedRegistry</code>
+ * service is tested. If this relation exists, than some methods
+ * are not supported. The relation is a <code>String</code> with
+ * object name.</li>
+ * <li> <code>'XSimpleRegistry.open'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * <li> <code>'XSimpleRegistry.destroy'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * <li> <code>'XSimpleRegistry.merge'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ final String tmpDir = utils.getOfficeTempDirSys((XMultiServiceFactory)Param.getMSF()) ;
+ final String openF = tmpDir + "XSimpleRegistry_open" + uniq + ".rdb" ;
+ final String destroyF = tmpDir
+ + "XSimpleRegistry_destroy" + uniq + ".rdb" ;
+ final String mergeF = tmpDir + "XSimpleRegistry_merge" + uniq + ".rdb" ;
+ uniq++ ;
+
+ log.println("creating copies of the registry for XSimpleRegistry");
+ try {
+ String source = utils.getFullTestDocName("XSimpleRegistry.rdb");
+ copyFile(source, openF, log) ;
+ copyFile(source, mergeF, log) ;
+ } catch (java.io.IOException e) {
+ log.println("Exception occured while copying files");
+ e.printStackTrace(log);
+ throw new StatusException("Exception occured while copying files", e);
+ }
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ reg1 = RegistryTools.
+ createRegistryService(xMSF) ;
+ reg1.open(mergeF, false, true) ;
+ reg2 = RegistryTools.
+ createRegistryService(xMSF) ;
+ reg2.open(openF, false, true) ;
+ XSimpleRegistry[] arg = new XSimpleRegistry[2];
+ arg[0]=reg1;
+ arg[1]=reg2;
+ oInterface = xMSF.createInstanceWithArguments
+ ( "com.sun.star.comp.stoc.NestedRegistry", arg );
+ }
+ catch( Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("NR","NestedRegistry");
+
+ tEnv.addObjRelation("XSimpleRegistry.open", openF) ;
+ tEnv.addObjRelation("XSimpleRegistry.merge", mergeF) ;
+ tEnv.addObjRelation("XSimpleRegistry.destroy", destroyF) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+
+ }
+
+} // finish class NestedRegistry
+
diff --git a/qadevOOo/tests/java/mod/_defreg/package.html b/qadevOOo/tests/java/mod/_defreg/package.html
new file mode 100644
index 000000000000..16090213476e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_defreg/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'defreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_dtrans/generic.java b/qadevOOo/tests/java/mod/_dtrans/generic.java
new file mode 100644
index 000000000000..cbcba7a9b4b2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dtrans/generic.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dtrans;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.datatransfer.generic</code>. <p>
+ */
+public class generic extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.datatransfer.generic</code>.
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) xMSF.createInstance
+ ("com.sun.star.datatransfer.clipboard.GenericClipboard");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ if (oObj == null) {
+ log.println("[ERROR!] System type is *nix, unable to create object...");
+ }
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java b/qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java
new file mode 100644
index 000000000000..b947b237298c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._dynamicloader;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.loader.Dynamic</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::loader::XImplementationLoader</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.loader.XImplementationLoader
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.loader.Dynamic
+* @see ifc.loader._XImplementationLoader
+* @see ifc.lang._XServiceInfo
+*/
+public class Dynamic extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service
+ * <code>com.sun.star.loader.Dynamic</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.loader.Dynamic" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Can't create service", e) ;
+ }
+
+ if (oInterface == null)
+ log.println("Service wasn't created") ;
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relations for XImplementationLoader
+
+ String loader = "com.sun.star.loader.SharedLibrary";
+ tEnv.addObjRelation("ImplementationLoader", loader) ;
+
+ String url = "servicename=com.sun.star.loader.SharedLibrary,link=mylink";
+ //util.utils.getFullTestURL("solibrary.jar");
+ tEnv.addObjRelation("ImplementationUrl", url) ;
+
+ tEnv.addObjRelation("ImplementationName", "com.sun.star.io.Pipe") ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_file/calc/ODriver.java b/qadevOOo/tests/java/mod/_file/calc/ODriver.java
new file mode 100644
index 000000000000..8ffd03254d4c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/calc/ODriver.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._file.calc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class ODriver extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the Spreadsheet document to which to connect.
+ * The URL is obtained from the parameter <code>calc.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for
+ * {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments
+ * </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)(
+ (XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.sdbc.calc.ODriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for calc.ODriver object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String calcURL = (String) Param.get("calc.url");
+ if (calcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'calc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:calc:" + calcURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ tEnv.addObjRelation("NoBadURL", "TRUE");
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_file/dbase/ODriver.java b/qadevOOo/tests/java/mod/_file/dbase/ODriver.java
new file mode 100644
index 000000000000..572b2b637855
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/dbase/ODriver.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._file.dbase;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class ODriver extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>dbase.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for
+ * {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments
+ * </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)(
+ (XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.sdbc.dbase.ODriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for dbase.ODriver object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String dBaseURL = (String) Param.get("dbase.url");
+ if (dBaseURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'dbase.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:dbase:" + dBaseURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_file/flat/ODriver.java b/qadevOOo/tests/java/mod/_file/flat/ODriver.java
new file mode 100644
index 000000000000..fb28efebd2f5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/flat/ODriver.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._file.flat;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class ODriver extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>flat.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for
+ * {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments
+ * </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)(
+ (XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.sdbc.flat.ODriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for flat.ODriver object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String flatURL = (String) Param.get("flat.url");
+ if (flatURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'flat.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:flat:" + flatURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java b/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java
new file mode 100644
index 000000000000..d2a19f1418f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fileacc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.SimpleFileAccess</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::ucb.XSimpleFileAccess</code></li>
+* </ul>
+* This object test <b> can </b> be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XSimpleFileAccess
+* @see com.sun.star.ucb.SimpleFileAccess
+* @see ifc.ucb._XSimpleFileAccess
+*/
+public class SimpleFileAccess extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.ucb.SimpleFileAccess</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object oIH = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.comp.ucb.SimpleFileAccess");
+ oIH = xMSF.createInstance("com.sun.star.sdb.InteractionHandler");
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("SimpleFileAccess Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for CoreReflection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("InteractionHandler", oIH);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SimpleFileAccess
+
diff --git a/qadevOOo/tests/java/mod/_fileacc/package.html b/qadevOOo/tests/java/mod/_fileacc/package.html
new file mode 100644
index 000000000000..87af9c1842af
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fileacc/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'fileacc'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fop/FolderPicker.java b/qadevOOo/tests/java/mod/_fop/FolderPicker.java
new file mode 100644
index 000000000000..8f3ed5536ea8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fop/FolderPicker.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fop;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.fop.FolderPicker</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ui::XExecutableDialog</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::ui::XFolderPickerNotifier</code></li>
+* <li> <code>com::sun::star::ui::XFolderPicker</code></li>
+* <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ui.XExecutableDialog
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.ui.XFolderPickerNotifier
+* @see com.sun.star.ui.XFolderPicker
+* @see com.sun.star.lang.XTypeProvider
+* @see com.sun.star.ui.FolderPicker
+* @see ifc.ui._XExecutableDialog
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.ui._XFolderPickerNotifier
+* @see ifc.ui._XFolderPicker
+* @see ifc.lang._XTypeProvider
+*/
+public class FolderPicker extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.fop.FolderPicker</code>. <p>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ui.dialogs.FolderPicker" );
+
+ // adding one child container
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class BreakIterator
+
diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
new file mode 100644
index 000000000000..8ddbbc293a06
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java
@@ -0,0 +1,565 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyValue;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.WriterTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XBoundComponent;
+import com.sun.star.form.XForm;
+import com.sun.star.form.XLoadable;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import java.util.ArrayList;
+import lib.Status;
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.DateField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::awt::UnoControlDateFieldModel</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::form::component::DateField</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TestDB </b> (directory) : directory with test database </li>
+* <li><b> TestDB/TestDB.dbf </b> : table file. See
+* {@link util.DBTools DBTools} class for more information.</li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.awt.UnoControlDateFieldModel
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.form.component.DateField
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.awt._UnoControlDateFieldModel
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.form.component._DateField
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class GenericModelTest extends TestCase {
+ private static XTextDocument m_xTextDoc;
+ private static Object m_dbSrc = null;
+ private static DBTools.DataSourceInfo m_srcInf = null;
+ /**
+ * This is the name of the Data Base which the test uses: "APITestDatabase"
+ */
+ protected final static String m_dbSourceName = "APITestDatabase";
+ protected final static String m_TestDB = "TestDB";
+ private DBTools m_dbTools = null;
+
+ private static boolean m_ConnectionColsed = false;
+
+ /**
+ * descibes the kind of the shape which should be created.
+ * Example: m_kindOfshape=DateFiled
+ */
+ public static String m_kindOfControl = null;
+
+ /**
+ * If your object needs some special propery values you can specify them with this
+ * <CODE>ArrayList</CODE>. You have to add a <CODE>NamedValue</CODE> to this list.
+ * Example:
+ * NamedValue myProp = new NamedValue();
+ * myProp.Name = "Test";
+ * myProp.Value = "My special Value";
+ * m_propertiesToSet.add(myProp);
+ */
+ public static ArrayList m_propertiesToSet = new ArrayList();
+
+ /**
+ * This variable contains the name of the property which should be changed while
+ * interface <CODE>com::sun::star::form::XUpdateBroadcaster</CODE> is tested. The
+ * interface test needs the <CODE>ObjectRelation</CODE>
+ * "XUpdateBroadcaster.Checker" which is a <CODE>ifc.form._XUpdateBroadcaster.UpdateChecker</CODE>.
+ * @see ifc.form._XUpdateBroadcaster.UpdateChecker
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ public static String m_ChangePropertyName = null;
+ /**
+ * This variable contains the value the property should be set while
+ * interface <CODE>com::sun::star::form::XUpdateBroadcaster</CODE> is tested.
+ * The interface test needs the <CODE>ObjectRelation</CODE>
+ * "XUpdateBroadcaster.Checker" which is a <CODE>ifc.form._XUpdateBroadcaster.UpdateChecker</CODE>.
+ * Normaly the <CODE>Checker</CODE> uses <CODE>util.ValueChanger</CODE> to change
+ * the value of the property. If the current of this property is NULL the
+ * <CODE>ValueChanger</CODE> is unable to change the value. In this case the value
+ * of this variable was used.
+ */
+ public static Object m_ChangePropertyValue = null;
+
+ /**
+ * This variable contains the implelemtation name of the object.
+ */
+ public static String m_ObjectName = null;
+
+ /**
+ * For local implementaions of <CODE>Checker</CODE> this variable contains the
+ * <CODE>FormLoader</CODE>
+ */
+ protected static XLoadable m_XFormLoader = null;
+ /**
+ * For local implementaions of <CODE>Checker</CODE> this variable contains the
+ * <CODE>XPropertySet</CODE>
+ */
+ protected static XPropertySet m_XPS = null;
+ /**
+ * For local implementaions of <CODE>Checker</CODE> this variable contains the
+ * <CODE>Control</CODE>
+ */
+ protected static XInterface m_XCtrl = null;
+ /**
+ * The insterface test of <CODE>ifc.form._DataWareControlModel</CODE> expects an
+ * object relation <CODE>'LC'</CODE>. This is a <CODE>XControlModel</CODE> of a shape.
+ * This variable contains the kind of shape to create for the interface test,
+ * f.e. "FixedText"
+ * @see ifc.form._DataAwareControlModel
+ */
+ protected static String m_LCShape_Type = null;
+
+ protected static String m_XPropertyAccess_propertyToChange = "HelpText";
+
+ protected static String m_XPropertyContainer_propertyNotRemovable = "HelpText";
+ /**
+ * If this variable is true some more debug info was logged. It was setted by the parameter variable
+ * <code>debug_is_active</code>
+ */
+ protected static boolean debug = false;
+
+ /**
+ * Creates Writer document where controls are placed.
+ * @param tParam the test paremter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ m_xTextDoc = WriterTools.createTextDoc(((XMultiServiceFactory) tParam.getMSF()));
+ m_ConnectionColsed = false;
+ debug = tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE);
+ m_propertiesToSet.clear();
+ }
+
+ /**
+ * close the connection
+ * close the data source
+ * close the document
+ * revoke the data source
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println("closing connection...");
+
+ // some interface tests call cleanup to reset the environment. If such
+ // a test is the last one cleanup was called twice. The second call
+ // causes then nasty exceptions...
+ if (m_ConnectionColsed) return;
+
+ try {
+ XForm myForm = (XForm) AnyConverter.toObject(new Type(XForm.class),
+ (FormTools.getForms(
+ WriterTools.getDrawPage(
+ m_xTextDoc)))
+ .getByName("Standard"));
+
+ if (debug){
+ if (myForm == null){
+ log.println("ERROR: could not get 'Standard' from drawpage!");
+ }
+ log.println("the draw page contains folowing elemtens:");
+ String[] elements = FormTools.getForms(WriterTools.getDrawPage(m_xTextDoc)).getElementNames();
+ for (int i = 0; i< elements.length; i++){
+ log.println("Element[" + i + "] :" + elements[i]);
+ }
+
+ }
+
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, myForm);
+ XConnection connection = (XConnection) AnyConverter.toObject(
+ new Type(XConnection.class),
+ xSetProp.getPropertyValue("ActiveConnection"));
+ if (debug && connection == null){
+ log.println("ERROR: could not get property 'ActiveConnection' from the XForm");
+ }
+
+ connection.close();
+ } catch (Exception e) {
+ log.println("ERROR: Can't close the connection: " + e.toString());
+ }
+
+ log.println("closing data source...");
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, m_dbSrc);
+ if ( closer == null )
+ {
+ XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface(
+ XDocumentDataSource.class, m_dbSrc);
+ if ( dataSource != null )
+ closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, dataSource.getDatabaseDocument() );
+ }
+ if (debug && closer==null){
+ log.println("ERROR: couldn't get 'XCloseable' from DataSource");
+ }
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("ERROR: couldn't close data source: " + e.toString());
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("ERROR: couldn't close data source: " + e.toString());
+ } catch (Exception e) {
+ log.println("ERROR: couldn't close data source: " + e.toString());
+ }
+
+ log.println("disposing data source...");
+ try {
+ XComponent dataSourceComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, m_dbSrc);
+ dataSourceComp.dispose();
+ }
+ catch (Exception e) {
+ log.println("couldn't dispose the data source");
+ }
+
+ log.println("closing document...");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, m_xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("ERROR: couldn't close document: " + e.toString());
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("ERROR: couldn't close document: " + e.toString());
+ } catch (Exception e) {
+ log.println("ERROR: couldn't close document: " + e.toString());
+ }
+
+ log.println("revoking data source...");
+ try {
+ m_dbTools.revokeDB(m_dbSourceName);
+ } catch (com.sun.star.container.NoSuchElementException e){
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("ERROR: Error while object test cleaning up: " + e.toString());
+ }
+
+ m_ConnectionColsed = true;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates DateField in the Form, then binds it to TestDB
+ * database and returns Field's control. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} : name of service which is
+ * represented by this object. </li>
+ * <li> <code>'LC'</code> for {@link ifc.form._DataAwareControlModel}.
+ * Specifies the value for LabelControl property. It is
+ * <code>FixedText</code> component added to the document.</li>
+ * <li> <code>'FL'</code> for
+ * {@link ifc.form._DataAwareControlModel} interface.
+ * Specifies XLoadable implementation which connects form to
+ * the data source.</li>
+ * <li> <code>'XUpdateBroadcaster.Checker'</code> : <code>
+ * _XUpdateBroadcaster.UpdateChecker</code> interface implementation
+ * which can update, commit data and check if the data was successfully
+ * commited.</li>
+ * <li> <code>'DataAwareControlModel.NewFieldName'</code> : for
+ * <code>com.sun.star.form.DataAwareControlModel</code> service
+ * which contains new name of the field ('_DATE') to bind control to.
+ * </li>
+ * <li> <code>'XFastPropertySet.ExcludeProps'</code> : for
+ * <code>com.sun.star.beans.XFastPropertySet</code> interface
+ * the property FormatKey can have only restricted set of values.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return a test environment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XControlShape aShape = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+
+ try{
+ log.println("adding contol shape '" + m_kindOfControl + "'");
+ aShape = FormTools.createControlShape(m_xTextDoc, 3000,
+ 4500, 15000, 10000,
+ m_kindOfControl);
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create following control shape (m_kindOfControl): '" +
+ m_kindOfControl + "': ", e);
+
+ }
+
+ WriterTools.getDrawPage(m_xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ log.println("Implementation name: " + util.utils.getImplName(oObj));
+
+ try {
+ String sourceTestDB = utils.getFullURL(utils.getFullTestDocName("TestDB/testDB.dbf"));
+ String destTestDB = utils.getOfficeTemp(xMSF);
+ destTestDB = utils.getFullURL(destTestDB + "testDB.dbf");
+
+ log.println("copy '"+sourceTestDB + "' -> '" + destTestDB + "'");
+ utils.copyFile(xMSF, sourceTestDB, destTestDB);
+
+ m_dbTools = new DBTools( xMSF, log );
+ String tmpDir = utils.getOfficeTemp((xMSF));
+
+ m_srcInf = m_dbTools.newDataSourceInfo();
+ m_srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
+ log.println("data source: " + m_srcInf.URL);
+
+ m_dbSrc = m_srcInf.getDataSourceService();
+ m_dbTools.reRegisterDB(m_dbSourceName, m_dbSrc);
+
+ m_XFormLoader = FormTools.bindForm(m_xTextDoc, m_dbSourceName,
+ m_TestDB);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("!!! Can't access TestDB !!!");
+ e.printStackTrace(log);
+ throw new StatusException("Can't access TestDB", e);
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", m_ObjectName);
+
+ log.println("adding shape '" + m_LCShape_Type +"' for DataAwareControlModel test");
+ aShape = FormTools.createControlShape(m_xTextDoc, 6000, 4500, 15000,
+ 10000, m_LCShape_Type);
+ WriterTools.getDrawPage(m_xTextDoc).add((XShape) aShape);
+
+ m_XPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+
+ int i = 0;
+ NamedValue prop = null;
+ try {
+ for (i = 0; i < m_propertiesToSet.size(); i++){
+ prop = (NamedValue) m_propertiesToSet.get(i);
+
+ log.println("setting property: '"+prop.Name+"' to value '"+prop.Value.toString()+"'");
+
+ m_XPS.setPropertyValue(prop.Name, prop.Value);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property '" + prop.Name + "': ", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property '" + prop.Name + "': ", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property '" + prop.Name + "': ", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property '" + prop.Name + "': ", e);
+ } catch (java.lang.ClassCastException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property on index '" + i + "': ", e);
+ }
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC", aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL", m_XFormLoader);
+
+ // adding relation for XUpdateBroadcaster
+ m_XCtrl = oObj;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new Checker(m_XFormLoader, m_XPS, m_XCtrl, m_ChangePropertyName, m_ChangePropertyValue));
+
+ // adding relation for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_DATE_F);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XFastPropertySet
+ java.util.HashSet exclude = new java.util.HashSet();
+ exclude.add("FormatKey");
+ tEnv.addObjRelation("XFastPropertySet.ExcludeProps", exclude);
+
+ PropertyValue propVal = new PropertyValue();
+ propVal.Name = m_XPropertyAccess_propertyToChange;
+ propVal.Value = "Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", propVal);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", m_XPropertyContainer_propertyNotRemovable);
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+ static class Checker implements ifc.form._XUpdateBroadcaster.UpdateChecker {
+ private Object lastValue = null;
+ XLoadable formLoaderF = null;
+ XPropertySet ps = null;
+ XInterface ctrl = null;
+ String ChangePropertyName = null;
+ Object ChangePropertyValue = null;
+
+ public Checker(XLoadable xl, XPropertySet ps, XInterface ctrl, String ChangePropertyName, Object ChangePropertyValue) {
+ formLoaderF = xl;
+ this.ps = ps;
+ this.ctrl = ctrl;
+ this.ChangePropertyName=ChangePropertyName;
+ this.ChangePropertyValue=ChangePropertyValue;
+ }
+
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded()) {
+ formLoaderF.load();
+ }
+
+ lastValue = util.ValueChanger.changePValue(ps.getPropertyValue(ChangePropertyName));
+
+ if (lastValue == null){
+
+ if (ChangePropertyValue != null){
+
+ lastValue = ChangePropertyValue;
+
+ } else {
+
+ String msg = "The initial value of the property '" + ChangePropertyName + "' is NULL\n";
+ msg += "The member variable 'm_ChangePropertyValue' is NULL\n";
+ msg += "Could not change Property.";
+
+ throw new StatusException(Status.failed(msg));
+ }
+ }
+ ps.setPropertyValue(ChangePropertyName, lastValue);
+ }
+
+ public void commit() throws com.sun.star.sdbc.SQLException {
+ XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface(
+ XBoundComponent.class, ctrl);
+ XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface(
+ XResultSetUpdate.class,
+ formLoaderF);
+
+ bound.commit();
+ update.updateRow();
+ }
+
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ formLoaderF.reload();
+
+ Object newValue = ps.getPropertyValue(ChangePropertyName);
+
+ return (newValue != null) && (util.ValueComparer.equalValue(lastValue, newValue));
+ }
+ }
+} // finish class GenericModelTest
diff --git a/qadevOOo/tests/java/mod/_forms/OButtonControl.java b/qadevOOo/tests/java/mod/_forms/OButtonControl.java
new file mode 100644
index 000000000000..7d21c2deead6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OButtonControl.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.CommandButton</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::form::XApproveActionBroadcaster</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XButton</code></li>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.form.XApproveActionBroadcaster
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XButton
+ * @see com.sun.star.awt.XView
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XWindow
+ * @see ifc.form._XApproveActionBroadcaster
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XButton
+ * @see ifc.awt._XView
+ */
+public class OButtonControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.CommandButton</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "CommandButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OButtonControl", e);
+ }
+
+ log.println("creating a new environment for OButtonControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OButtonControl
diff --git a/qadevOOo/tests/java/mod/_forms/OButtonModel.java b/qadevOOo/tests/java/mod/_forms/OButtonModel.java
new file mode 100644
index 000000000000..b648236a9533
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OButtonModel.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.com.sun.star.form.component.CommandButton</code>.
+ * <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::form::XImageProducerSupplier</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::awt::UnoControlButtonModel</code></li>
+ * <li> <code>com::sun::star::form::component::CommandButton</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.form.XImageProducerSupplier
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.awt.UnoControlButtonModel
+ * @see com.sun.star.form.component.CommandButton
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.io._XPersistObject
+ * @see ifc.container._XChild
+ * @see ifc.form._FormControlModel
+ * @see ifc.form._XImageProducerSupplier
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XPropertySet
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertyState
+ * @see ifc.awt._UnoControlButtonModel
+ * @see ifc.form.component._CommandButton
+ * @see ifc.container._XNamed
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.lang._XComponent
+ */
+public class OButtonModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="CommandButton";
+ * super.m_ObjectName = "com.sun.star.form.component.CommandButton";
+ * super.m_LCShape_Type = "CommandButton";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="CommandButton";
+
+ super.m_ObjectName = "stardiv.one.form.component.CommandButton";
+
+ super.m_LCShape_Type = "CommandButton";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OButtonModelold
diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java
new file mode 100644
index 000000000000..70ee585e3083
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XCheckBox;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.CheckBox</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XItemListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::awt::XCheckBox</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XItemListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.awt.XCheckBox
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XItemListener
+ * @see ifc.awt._XWindow
+ * @see ifc.awt._XCheckBox
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XEventListener
+ */
+public class OCheckBoxControl extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( ((XMultiServiceFactory)Param.getMSF()) );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.CheckBox</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * <li> <code>'TestItemListener'</code> for
+ * {@link ifc.awt._XItemListener} : listener implementation is
+ * registered here and passed as relation. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"CheckBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(
+ xTextDoc,3000,4500,5000,10000,"TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,xTextDoc.getCurrentController());
+
+ //now get the OButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200,200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OCheckBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OCheckBoxControl", e );
+ }
+
+ log.println( "creating a new environment for OCheckBoxControl object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS",aGraphic);
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT",xTextDoc);
+ tEnv.addObjRelation("WINPEER",the_win);
+ tEnv.addObjRelation("TOOLKIT",the_kit);
+ tEnv.addObjRelation("MODEL",the_Model);
+
+ // Adding relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener() ;
+ XCheckBox box = (XCheckBox) UnoRuntime.queryInterface
+ (XCheckBox.class, oObj) ;
+ box.addItemListener(listener) ;
+ tEnv.addObjRelation("TestItemListener", listener) ;
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OButtonControl
+
+
diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java
new file mode 100644
index 000000000000..342e6d6aff48
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.CheckBox</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::form::component::CheckBox</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::awt::UnoControlCheckBoxModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+*
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.form.component.CheckBox
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.awt.UnoControlCheckBoxModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.beans._XFastPropertySet
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._FormComponent
+* @see ifc.form.component._CheckBox
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._DataAwareControlModel
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.awt._UnoControlCheckBoxModel
+* @see ifc.container._XNamed
+* @see ifc.form._XBoundComponent
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class OCheckBoxModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="CheckBox";
+ * super.m_ObjectName = "stardiv.one.form.component.CheckBox";
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl= "CheckBox";
+
+ super.m_ObjectName = "stardiv.one.form.component.CheckBox";
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class OCheckBoxModel
+
diff --git a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java
new file mode 100644
index 000000000000..5e21356f623b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java
@@ -0,0 +1,244 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.ComboBox</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XComboBox</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XComboBox
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XComboBox
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OComboBoxControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.ComboBox</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "ComboBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OCheckBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OComboBoxControl", e);
+ }
+
+ log.println("creating a new environment for OComboBoxControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OButtonControl
diff --git a/qadevOOo/tests/java/mod/_forms/OComboBoxModel.java b/qadevOOo/tests/java/mod/_forms/OComboBoxModel.java
new file mode 100644
index 000000000000..326ccda4554d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OComboBoxModel.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DBTools;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.ComboBox</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::awt::UnoControlComboBoxModel</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::form::component::DatabaseComboBox</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::component::ComboBox</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.awt.UnoControlComboBoxModel
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.form.component.DatabaseComboBox
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.component.ComboBox
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.beans._XFastPropertySet
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._FormComponent
+* @see ifc.awt._UnoControlComboBoxModel
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.form.component._DatabaseComboBox
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.form._XBoundComponent
+* @see ifc.form.component._ComboBox
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class OComboBoxModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Text";
+ * super.m_kindOfControl="ComboBox";
+ * super.m_ObjectName = "stardiv.one.form.component.ComboBox";
+ *
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_STRING_F;
+ * super.m_propertiesToSet.add(DataField);
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Text";
+
+ super.m_kindOfControl="ComboBox";
+
+ super.m_ObjectName = "stardiv.one.form.component.ComboBox";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OComboBoxModel
diff --git a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java
new file mode 100644
index 000000000000..c3977ec7eb63
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.CurrencyField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::awt::XCurrencyField</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.awt.XCurrencyField
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.awt._XCurrencyField
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OCurrencyControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.CurrencyField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * <li> <code>'XTextComponent.onlyNumbers'</code> for
+ * {@link ifc.awt._XTextComponent} : as the currency field
+ * can have only numeric values the relation must be specified. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "CurrencyField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OCurrencyControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OCurrencyControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OCurrencyControl", e);
+ }
+
+ log.println("creating a new environment for OCurrencyControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+
+ // Adding relation for XTextComponent
+ tEnv.addObjRelation("XTextComponent.onlyNumbers", new Object());
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OCurrencyControl
diff --git a/qadevOOo/tests/java/mod/_forms/OCurrencyModel.java b/qadevOOo/tests/java/mod/_forms/OCurrencyModel.java
new file mode 100644
index 000000000000..c1c98761239b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCurrencyModel.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.CurrencyField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::awt::UnoControlCurrencyFieldModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* <li> <code>com::sun::star::form::component::CurrencyField</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.awt.UnoControlCurrencyFieldModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see com.sun.star.form.component.CurrencyField
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.awt._UnoControlCurrencyFieldModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+* @see ifc.form.component._CurrencyField
+*/
+public class OCurrencyModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Value";
+ * super.m_kindOfControl="CurrencyField";
+ * super.m_ObjectName = "stardiv.one.form.component.CurrencyField";
+ * NamedValue myProp = new NamedValue();
+ * myProp.Name = "DataField";
+ * myProp.Value = "Identifier";
+ * super.m_propertiesToSet.add(myProp);
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ObjectName = "stardiv.one.form.component.CurrencyField";
+
+ super.m_kindOfControl="CurrencyField";
+
+ NamedValue myProp = new NamedValue();
+ myProp.Name = "DataField";
+ myProp.Value = "Identifier";
+ super.m_propertiesToSet.add(myProp);
+
+ super.m_ChangePropertyName = "Value";
+ super.m_ChangePropertyValue = new Double(0);
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class OCurrencyModel
diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java
new file mode 100644
index 000000000000..a060245ddfde
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java
@@ -0,0 +1,901 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.DrawTools;
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.form.DatabaseParameterEvent;
+import com.sun.star.form.XForm;
+import com.sun.star.form.XLoadable;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdb.ParametersRequest;
+import com.sun.star.sdb.RowChangeEvent;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.task.XInteractionRequest;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+import ifc.form._XDatabaseParameterBroadcaster;
+import ifc.sdb._XCompletedExecution;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.DatabaseForm</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::script::XEventAttacherManager</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::sdbcx::ResultSet</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSetUpdate</code></li>
+ * <li> <code>com::sun::star::sdb::XResultSetAccess</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::form::component::DataForm</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSetMetaDataSupplier</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::sdbcx::XDeleteRows</code></li>
+ * <li> <code>com::sun::star::sdb::RowSet</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::sdbc::XRowSet</code></li>
+ * <li> <code>com::sun::star::sdbc::XRowUpdate</code></li>
+ * <li> <code>com::sun::star::form::XLoadable</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::container::XIndexReplace</code></li>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::container::XNameReplace</code></li>
+ * <li> <code>com::sun::star::container::XIndexContainer</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::sdbc::XParameters</code></li>
+ * <li> <code>com::sun::star::util::XCancellable</code></li>
+ * <li> <code>com::sun::star::form::XReset</code></li>
+ * <li> <code>com::sun::star::sdbc::XCloseable</code></li>
+ * <li> <code>com::sun::star::sdbcx::XColumnsSupplier</code></li>
+ * <li> <code>com::sun::star::sdb::XRowSetApproveBroadcaster</code></li>
+ * <li> <code>com::sun::star::sdbc::ResultSet</code></li>
+ * <li> <code>com::sun::star::sdbc::XResultSet</code></li>
+ * <li> <code>com::sun::star::sdbc::XRow</code></li>
+ * <li> <code>com::sun::star::sdbc::XColumnLocate</code></li>
+ * <li> <code>com::sun::star::awt::XTabControllerModel</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::form::XSubmit</code></li>
+ * <li> <code>com::sun::star::form::component::HTMLForm</code></li>
+ * <li> <code>com::sun::star::sdbcx::XRowLocate</code></li>
+ * <li> <code>com::sun::star::sdbc::XWarningsSupplier</code></li>
+ * <li> <code>com::sun::star::container::XNameContainer</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::sdbc::RowSet</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * The following parameters in ini-file used by this test:
+ * <ul>
+ * <li><code>test.db.url</code> - URL to MySQL database.
+ * For example: <code>mysql://mercury:3306/api_current</code></li>
+ * <li><code>test.db.user</code> - user for MySQL database</li>
+ * <li><code>test.db.password</code> - password for MySQL database</li>
+ * </ul><p>
+ *
+ * @see com.sun.star.script.XEventAttacherManager
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.sdbcx.ResultSet
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.sdbc.XResultSetUpdate
+ * @see com.sun.star.sdb.XResultSetAccess
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.form.component.DataForm
+ * @see com.sun.star.sdbc.XResultSetMetaDataSupplier
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.sdbcx.XDeleteRows
+ * @see com.sun.star.sdb.RowSet
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.sdbc.XRowSet
+ * @see com.sun.star.sdbc.XRowUpdate
+ * @see com.sun.star.form.XLoadable
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.container.XIndexReplace
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.container.XNameReplace
+ * @see com.sun.star.container.XIndexContainer
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.sdbc.XParameters
+ * @see com.sun.star.util.XCancellable
+ * @see com.sun.star.form.XReset
+ * @see com.sun.star.sdbc.XCloseable
+ * @see com.sun.star.sdbcx.XColumnsSupplier
+ * @see com.sun.star.sdb.XRowSetApproveBroadcaster
+ * @see com.sun.star.sdbc.ResultSet
+ * @see com.sun.star.sdbc.XResultSet
+ * @see com.sun.star.sdbc.XRow
+ * @see com.sun.star.sdbc.XColumnLocate
+ * @see com.sun.star.awt.XTabControllerModel
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.form.XSubmit
+ * @see com.sun.star.form.component.HTMLForm
+ * @see com.sun.star.sdbcx.XRowLocate
+ * @see com.sun.star.sdbc.XWarningsSupplier
+ * @see com.sun.star.container.XNameContainer
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.sdbc.RowSet
+ * @see ifc.script._XEventAttacherManager
+ * @see ifc.container._XElementAccess
+ * @see ifc.sdbcx._ResultSet
+ * @see ifc.container._XChild
+ * @see ifc.sdbc._XResultSetUpdate
+ * @see ifc.sdb._XResultSetAccess
+ * @see ifc.form._FormComponent
+ * @see ifc.form.component._DataForm
+ * @see ifc.sdbc._XResultSetMetaDataSupplier
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.sdbcx._XDeleteRows
+ * @see ifc.sdb._RowSet
+ * @see ifc.lang._XComponent
+ * @see ifc.sdbc._XRowSet
+ * @see ifc.sdbc._XRowUpdate
+ * @see ifc.form._XLoadable
+ * @see ifc.container._XNamed
+ * @see ifc.container._XIndexReplace
+ * @see ifc.io._XPersistObject
+ * @see ifc.container._XNameReplace
+ * @see ifc.container._XIndexContainer
+ * @see ifc.container._XNameAccess
+ * @see ifc.sdbc._XParameters
+ * @see ifc.util._XCancellable
+ * @see ifc.form._XReset
+ * @see ifc.sdbc._XCloseable
+ * @see ifc.sdbcx._XColumnsSupplier
+ * @see ifc.sdb._XRowSetApproveBroadcaster
+ * @see ifc.sdbc._ResultSet
+ * @see ifc.sdbc._XResultSet
+ * @see ifc.sdbc._XRow
+ * @see ifc.sdbc._XColumnLocate
+ * @see ifc.awt._XTabControllerModel
+ * @see ifc.container._XIndexAccess
+ * @see ifc.form._XSubmit
+ * @see ifc.form.component._HTMLForm
+ * @see ifc.sdbcx._XRowLocate
+ * @see ifc.sdbc._XWarningsSupplier
+ * @see ifc.container._XNameContainer
+ * @see ifc.beans._XPropertyAccess
+ * @see ifc.beans._XPropertyContainer
+ * @see ifc.beans._XPropertySet
+ * @see ifc.sdbc._RowSet
+ */
+public class ODatabaseForm extends TestCase {
+ protected final static String dbSourceName = "ODatabaseFormDataSource";
+ private static int uniqueSuffix = 0;
+ private static String origDB = null;
+ private static String tmpDir = null;
+ protected XTextDocument xTextDoc = null;
+ private DBTools dbTools = null;
+ String tableName = null;
+ DBTools.DataSourceInfo srcInf = null;
+ boolean isMySQLDB = false;
+ protected XConnection conn = null;
+ private Object dbSrc = null;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ //log.println( "creating a draw document" );
+ //xTextDoc = WriterTools.createTextDoc(t((XMultiServiceFactory) Param.getMSF));
+ tmpDir = utils.getOfficeTemp(((XMultiServiceFactory) tParam.getMSF()));
+
+ origDB = util.utils.getFullTestDocName("TestDB/testDB.dbf");
+
+ dbTools = new DBTools( (XMultiServiceFactory)tParam.getMSF(), log );
+
+ // creating DataSource and registering it in DatabaseContext
+ String dbURL = (String) tParam.get("test.db.url");
+ String dbUser = (String) tParam.get("test.db.user");
+ String dbPassword = (String) tParam.get("test.db.password");
+
+ log.println("Creating and registering DataSource ...");
+ srcInf = dbTools.newDataSourceInfo();
+
+ if ((dbURL != null) && (dbUser != null) && (dbPassword != null)) {
+ isMySQLDB = true;
+ log.println("dbURL = " + dbURL);
+ log.println("dbUSER = " + dbUser);
+ log.println("dbPASSWORD = " + dbPassword);
+
+ //DataSource for mysql db
+ try {
+ tableName = "soffice_test_table";
+ srcInf.URL = "jdbc:" + dbURL;
+ srcInf.IsPasswordRequired = new Boolean(true);
+ srcInf.Password = dbPassword;
+ srcInf.User = dbUser;
+
+ PropertyValue[] propInfo = new PropertyValue[1];
+ propInfo[0] = new PropertyValue();
+ propInfo[0].Name = "JavaDriverClass";
+// propInfo[0].Value = "org.gjt.mm.mysql.Driver";
+ propInfo[0].Value = "util.dddriver.Driver";
+ srcInf.Info = propInfo;
+
+ dbSrc = srcInf.getDataSourceService();
+ dbTools.reRegisterDB(dbSourceName, dbSrc);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error while object test initialization :");
+ e.printStackTrace(log);
+ throw new StatusException("Error while object test" +
+ " initialization", e);
+ }
+ } else {
+ //DataSource for sdbc db
+ try {
+ String myDbUrl = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
+ srcInf.URL = myDbUrl;
+
+ log.println("try to register '"+myDbUrl+"' as '"+dbSourceName+"'");
+
+ dbSrc = srcInf.getDataSourceService();
+ dbTools.reRegisterDB(dbSourceName, dbSrc);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error while object test initialization :");
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error while object test initialization", e);
+ }
+
+ String oldF = null;
+ String newF = null;
+
+ do {
+ tableName = "ODatabaseForm_tmp" + uniqueSuffix;
+ oldF = utils.getFullURL(origDB);
+ newF = utils.getOfficeTemp((XMultiServiceFactory) tParam.getMSF()) + tableName +
+ ".dbf";
+ } while (!utils.tryOverwriteFile(((XMultiServiceFactory) tParam.getMSF()), oldF, newF) &&
+ (uniqueSuffix++ < 50));
+ }
+ }
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ if (xTextDoc != null) {
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+
+ log.println("Existing document disposed");
+ }
+
+ log.println("creating a text document");
+ xTextDoc = WriterTools.createTextDoc(((XMultiServiceFactory) Param.getMSF()));
+
+ //initialize test table
+ if (isMySQLDB) {
+ try {
+ dbTools.initTestTableUsingJDBC(tableName, srcInf);
+ } catch (java.sql.SQLException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't " + " init test table. SQLException..."));
+ } catch (java.lang.ClassNotFoundException e) {
+ throw new StatusException(Status.failed("Couldn't " + "register mysql driver"));
+ }
+ }
+
+ XInterface oObj = null;
+ XShapes oShapes = null;
+ XInterface oInstance = null;
+ XConnection connection = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ XNameContainer forms = FormTools.getForms(WriterTools.getDrawPage(
+ xTextDoc));
+
+ try {
+ String[] formNames = forms.getElementNames();
+
+ for (int i = 0; i < formNames.length; i++) {
+ log.println("Removing form '" + formNames[i] + "' ...");
+ forms.removeByName(formNames[i]);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ }
+
+ String[] formNames = forms.getElementNames();
+ FormTools.insertForm(xTextDoc, forms, "MyForm");
+ formNames = forms.getElementNames();
+
+ XLoadable formLoader = null;
+
+ try {
+ formLoader = FormTools.bindForm(xTextDoc, "MyForm", dbSourceName,
+ tableName);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Cann't bind the form to source '" + dbSourceName +
+ "', table '" + tableName + "' :");
+ e.printStackTrace(log);
+ throw new StatusException("Cann't bind a form", e);
+ }
+
+
+ // DEBUG
+ log.println("Forms before adding controls : ");
+ formNames = forms.getElementNames();
+
+ for (int i = 0; i < formNames.length; i++) {
+ log.println(" '" + formNames[i] + "'");
+ }
+
+ XControlShape shape1 = null;
+ XControlShape shape2 = null;
+
+ try {
+
+ log.println("Elements in the 'MyForm' :");
+
+ XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class,
+ forms.getByName("MyForm"));
+
+ for (int i = 0; i < formElements1.getCount(); i++) {
+ XNamed elemName = (XNamed) UnoRuntime.queryInterface(
+ XNamed.class,
+ formElements1.getByIndex(i));
+ log.println(" '" + elemName.getName() + "'");
+ }
+
+
+ // END DEBUG
+ //put something on the drawpage
+ log.println("inserting some ControlShapes");
+ oShapes = DrawTools.getShapes(WriterTools.getDrawPage(xTextDoc));
+ shape1 = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 1000, "CommandButton");
+ shape2 = FormTools.createControlShape(xTextDoc, 5000, 3500, 7500,
+ 5000, "TextField");
+
+ XControlShape shape3 = FormTools.createControlShape(xTextDoc, 2000,
+ 1500, 1000,
+ 1000,
+ "CheckBox");
+ oShapes.add((XShape) shape1);
+ oShapes.add((XShape) shape2);
+ oShapes.add(shape3);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("Forms after adding controls : ");
+ formNames = forms.getElementNames();
+
+ for (int i = 0; i < formNames.length; i++) {
+ log.println(" '" + formNames[i] + "'");
+ }
+
+ try {
+ log.println("Elements in the 'MyForm' :");
+
+ XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class,
+ forms.getByName("MyForm"));
+
+ for (int i = 0; i < formElements1.getCount(); i++) {
+ XNamed elemName = (XNamed) UnoRuntime.queryInterface(
+ XNamed.class,
+ formElements1.getByIndex(i));
+ log.println(" '" + elemName.getName() + "'");
+ }
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ }
+
+ formLoader.load();
+
+ try {
+ oObj = (XForm) AnyConverter.toObject(new Type(XForm.class),
+ (FormTools.getForms(
+ WriterTools.getDrawPage(
+ xTextDoc)))
+ .getByName("MyForm"));
+
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ connection = (XConnection) AnyConverter.toObject(
+ new Type(XConnection.class),
+ xSetProp.getPropertyValue("ActiveConnection"));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get Form");
+ e.printStackTrace(log);
+ }
+
+
+ // get a control
+ oInstance = FormTools.createControl(xTextDoc, "TextField");
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ // adding relation for closing connection while environment disposing.
+ this.conn = connection;
+
+ // adding relation for XSubmit
+ XControlModel the_Model = shape2.getControl();
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+ XControl cntrl = null;
+
+ //now get the OEditControl
+ try {
+ cntrl = the_access.getControl(the_Model);
+ log.println(cntrl.getClass().getName());
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OEditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OEditControl", e);
+ }
+
+ XResultSet the_set = (XResultSet) UnoRuntime.queryInterface(
+ XResultSet.class, oObj);
+
+ try {
+ the_set.first();
+ } catch (SQLException e) {
+ log.println("Cann't move cursor to the first row.");
+ e.printStackTrace();
+ throw new StatusException("Can't move cursor to the first row.", e);
+ }
+
+ tEnv.addObjRelation("Model1", shape1.getControl());
+ tEnv.addObjRelation("Model2", shape2.getControl());
+
+
+ // adding an object for XNameReplace testing
+ log.println("adding oInstace as obj relation to environment");
+ tEnv.addObjRelation("INSTANCE", oInstance);
+
+
+ // INDEX : _XNameContainer
+ log.println("adding INDEX as obj relation to environment");
+ tEnv.addObjRelation("INDEX", "0");
+
+
+ // INDEX : _XNameReplace
+ log.println("adding NameReplaceIndex as obj relation to environment");
+ tEnv.addObjRelation("XNameReplaceINDEX", "2");
+
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println("adding INSTANCEn as obj relation to environment");
+
+ //XComponent xComp = (XComponent)
+ // UnoRuntime.queryInterface(XComponent.class, xDrawDoc);
+ String tc = (String) Param.get("THRCNT");
+ int THRCNT = 1;
+
+ if (tc != null) {
+ THRCNT = Integer.parseInt(tc);
+ }
+
+ for (int n = 1; n < (2 * (THRCNT + 1)); n++) {
+ log.println("adding INSTANCE" + n +
+ " as obj relation to environment");
+ tEnv.addObjRelation("INSTANCE" + n,
+ FormTools.createControl(xTextDoc, "CheckBox"));
+ }
+
+
+ // adding relation for XNameContainer
+ tEnv.addObjRelation("XNameContainer.AllowDuplicateNames", new Object());
+
+
+ // adding relation for XPersistObject
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component.Form");
+
+ if (the_set != null) {
+ log.println("The Form has a not empty ResultSet");
+ }
+
+ // Adding obj relation for XRowSetApproveBroadcaster test
+ final XResultSet xResSet = (XResultSet) UnoRuntime.queryInterface(
+ XResultSet.class, oObj);
+ final XResultSetUpdate xResSetUpdate = (XResultSetUpdate) UnoRuntime.queryInterface(
+ XResultSetUpdate.class,
+ oObj);
+ final XRowSet xRowSet = (XRowSet) UnoRuntime.queryInterface(
+ XRowSet.class, oObj);
+ final PrintWriter logF = log;
+ tEnv.addObjRelation("XRowSetApproveBroadcaster.ApproveChecker",
+ new ifc.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker() {
+ public void moveCursor() {
+ try {
+ xResSet.beforeFirst();
+ xResSet.afterLast();
+ } catch (com.sun.star.sdbc.SQLException e) {
+ logF.println("### _XRowSetApproveBroadcaster." + "RowSetApproveChecker.moveCursor() :");
+ e.printStackTrace(logF);
+ }
+ }
+
+ public RowChangeEvent changeRow() {
+ try {
+ xResSet.first();
+
+ XRowUpdate row = (XRowUpdate) UnoRuntime.queryInterface(
+ XRowUpdate.class, xResSet);
+ row.updateString(1, "1");
+ xResSetUpdate.updateRow();
+ } catch (com.sun.star.sdbc.SQLException e) {
+ logF.println("### _XRowSetApproveBroadcaster." + "RowSetApproveChecker.changeRow() :");
+ e.printStackTrace(logF);
+ }
+
+ RowChangeEvent ev = new RowChangeEvent();
+ ev.Action = com.sun.star.sdb.RowChangeAction.UPDATE;
+ ev.Rows = 1;
+
+ return ev;
+ }
+
+ public void changeRowSet() {
+ try {
+ xRowSet.execute();
+ } catch (com.sun.star.sdbc.SQLException e) {
+ logF.println("### _XRowSetApproveBroadcaster." + "RowSetApproveChecker.changeRowSet() :");
+ e.printStackTrace(logF);
+ }
+ }
+ });
+
+
+ // Adding relation for XColumnLocate test
+ tEnv.addObjRelation("XColumnLocate.ColumnName", DBTools.TST_STRING_F);
+
+ // Adding relation for XParameters ifc test
+ Vector params = new Vector();
+
+
+ /***** statement parameter types and their initial
+ values must be added here as relation. */
+ params.add(new String("SAU99")) ;
+ params.add(new Boolean(false)) ;
+ params.add(new Byte((byte) 123)) ;
+ params.add(new Short((short) 234)) ;
+ params.add(new Integer(12345)) ;
+ params.add(new Long(23456)) ;
+ params.add(new Float(1.234)) ;
+ params.add(new Double(2.345)) ;
+ params.add(new byte[] {1, 2, 3}) ;
+ Date d = new Date();
+ d.Day = 26; d.Month = 1; d.Year = 2001;
+ params.add(d) ;
+ Time t = new Time();
+ t.Hours = 1; t.HundredthSeconds = 12; t.Minutes = 25; t.Seconds = 14;
+ params.add(t) ;
+ DateTime dt = new DateTime();
+ dt.Day = 26; dt.Month = 1; dt.Year = 2001; dt.Hours = 1;
+ dt.HundredthSeconds = 12; dt.Minutes = 25; dt.Seconds = 14;
+ params.add(dt) ;
+ tEnv.addObjRelation("XParameters.ParamValues", params);
+
+ // Adding relation for XCompletedExecution
+ tEnv.addObjRelation("InteractionHandlerChecker", new InteractionHandlerImpl());
+
+ // Adding for XWarningSupplier
+ tEnv.addObjRelation("CheckWarningsSupplier", new Boolean(isMySQLDB));
+
+ // Adding relation for XDatabaseParameterBroadcaster
+ tEnv.addObjRelation("ParameterListenerChecker", new ODatabaseForm.ParameterListenerImpl());
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+ try {
+ xSetProp.setPropertyValue("DataSourceName", dbSourceName) ;
+ if(isMySQLDB) {
+ xSetProp.setPropertyValue("Command", "SELECT Column0 FROM soffice_test_table WHERE ( ( Column0 = :param1 ) )");
+ }
+ else {
+ xSetProp.setPropertyValue("Command", "SELECT \"_TEXT\" FROM \"ODatabaseForm_tmp0\" WHERE ( ( \"_TEXT\" = :param1 ) )");
+ }
+
+ xSetProp.setPropertyValue("CommandType",
+ new Integer(CommandType.COMMAND)) ;
+ }
+ catch(Exception e) {
+ }
+
+ // Adding relation for XResultSetUpdate
+ final XRowUpdate xRowUpdate = (XRowUpdate) UnoRuntime.queryInterface(
+ XRowUpdate.class, oObj);
+ final XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);
+
+ tEnv.addObjRelation("XResultSetUpdate.UpdateTester",
+ new ifc.sdbc._XResultSetUpdate.UpdateTester() {
+ String lastUpdate = null;
+
+ public int rowCount() throws SQLException {
+ int prevPos = xResSet.getRow();
+ xResSet.last();
+
+ int count = xResSet.getRow();
+ xResSet.absolute(prevPos);
+
+ return count;
+ }
+
+ public void update() throws SQLException {
+ lastUpdate = xRow.getString(1);
+ lastUpdate += "_";
+ xRowUpdate.updateString(1, lastUpdate);
+ }
+
+ public boolean wasUpdated() throws SQLException {
+ String getStr = xRow.getString(1);
+
+ return lastUpdate.equals(getStr);
+ }
+
+ public int currentRow() throws SQLException {
+ return xResSet.getRow();
+ }
+ });
+
+ // Adding relations for XRow as a Vector with all data
+ // of current row of RowSet.
+
+ Vector rowData = new Vector();
+
+ for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) {
+ rowData.add(DBTools.TST_TABLE_VALUES[0][i]);
+ }
+
+ tEnv.addObjRelation("CurrentRowData", rowData);
+
+ // Adding relation for XRowUpdate
+ XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);
+ tEnv.addObjRelation("XRowUpdate.XRow", row);
+
+
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "Cycle");
+
+ PropertyValue propVal = new PropertyValue();
+ propVal.Name = "Name";
+ propVal.Value = "Text since XPropertyAccess";
+
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", propVal);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes connection of <code>RowSet</code> instance created.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("closing connection...");
+ try {
+ conn.close();
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't close the connection");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Connection was already closed. It's OK.");
+ }
+
+
+ log.println("closing data source...");
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, dbSrc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close data source");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close data source");
+ }
+
+
+ log.println("closing document...");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+
+ log.println("revoking data source...");
+ try {
+ dbTools.revokeDB(dbSourceName);
+ } catch (com.sun.star.container.NoSuchElementException e){
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error while object test cleaning up :");
+ e.printStackTrace(log);
+ throw new StatusException("Error while object test cleaning up", e);
+ }
+ }
+
+ /**
+ * Implementation of interface _XDatabaseParameterBroadcaster.CheckParameterListener
+ * for the XDatabaseParameterBroadcaster test
+ * @see ifc.form._XDatabaseParameterBroadcaster
+ */
+ public class ParameterListenerImpl implements _XDatabaseParameterBroadcaster.CheckParameterListener {
+ boolean listenerWasCalled = false;
+ PrintWriter log = new PrintWriter(System.out);
+
+ /**
+ * Return true, if the listener was called, false otherwise.
+ * @return True, if any other method of the listener was called.
+ */
+ public boolean checkListener() {
+ return listenerWasCalled;
+ }
+
+ /**
+ * Take the DataBaseParameterEvent and fill it with a meaningful value.
+ * @param e The database parameter that will be filled with a value.
+ * @return True, if the value could be filled.
+ */
+ public boolean approveParameter(DatabaseParameterEvent e) {
+ log.println("### ParameterListenerImpl: approve called.");
+ XIndexAccess params = e.Parameters;
+ int count = params.getCount();
+ try {
+ for(int i=0; i<count; i++) {
+ log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: Parameter "+i+": "+params.getByIndex(i));
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i));
+ log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: Parameter Name: '"+xProp.getPropertyValue("Name") + "' is set to Value '1'");
+ xProp.setPropertyValue("Value", new Integer(1));
+ listenerWasCalled = true;
+ }
+ }
+ catch(Exception eI) {
+ log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: Exception!");
+ eI.printStackTrace(log);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Dummy implemetnation. Do nothing, just log
+ * @param o Ignore.
+ */
+ public void disposing(EventObject o) {
+ log.println("### _XDatabaseParameterBroadcaster.ParameterListenerImpl: disposing");
+ }
+
+ /**
+ * Set a log writer, so messages go to log instead of Standard.out
+ * @param log The log messages get printed to.
+ */
+ public void setLog(PrintWriter log) {
+ this.log = log;
+ }
+
+ }
+
+
+ /**
+ * Implementation of interface _XCompletedExecution.CheckInteractionHandler
+ * for the XCompletedExecution test
+ * @see ifc.sdb._XCompletedExecution
+ */
+ public class InteractionHandlerImpl implements _XCompletedExecution.CheckInteractionHandler {
+ private boolean handlerWasUsed = false;
+ private PrintWriter log = new PrintWriter(System.out);
+
+ public boolean checkInteractionHandler() {
+ return handlerWasUsed;
+ }
+
+ public void handle(XInteractionRequest xInteractionRequest) {
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: handle called.");
+ handlerWasUsed = true;
+
+ Object o = xInteractionRequest.getRequest();
+ ParametersRequest req = (ParametersRequest)o;
+ XIndexAccess params = req.Parameters;
+ int count = params.getCount();
+ try {
+ for(int i=0; i<count; i++) {
+ Object aObject = params.getByIndex(i);
+ Any any = (Any)aObject;
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter "+i+": "+params.getByIndex(i));
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i));
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter Name: '"+xProp.getPropertyValue("Name") + "' is set to Value '1'");
+ xProp.setPropertyValue("Value", new Integer(1));
+ handlerWasUsed = true;
+ }
+ }
+ catch(Exception eI) {
+ log.println("### _XCompletedExecution.InteractionHandlerImpl: Exception!");
+ eI.printStackTrace(log);
+ }
+ }
+
+ public void setLog(PrintWriter log) {
+ this.log = log;
+ }
+
+ }
+} // finish class ODatabaseForm
diff --git a/qadevOOo/tests/java/mod/_forms/ODateControl.java b/qadevOOo/tests/java/mod/_forms/ODateControl.java
new file mode 100644
index 000000000000..4b37ec21c2cf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODateControl.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.DateField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XDateField</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XDateField
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XDateField
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class ODateControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.DateField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "DateField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the ODateControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get ODateControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ODateControl", e);
+ }
+
+ log.println("creating a new environment for ODateControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ODateControl
diff --git a/qadevOOo/tests/java/mod/_forms/ODateModel.java b/qadevOOo/tests/java/mod/_forms/ODateModel.java
new file mode 100644
index 000000000000..d692bb27d6bf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODateModel.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.DateField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::awt::UnoControlDateFieldModel</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::form::component::DateField</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TestDB </b> (directory) : directory with test database </li>
+* <li><b> TestDB/TestDB.dbf </b> : table file. See
+* {@link util.DBTools DBTools} class for more information.</li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.awt.UnoControlDateFieldModel
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.form.component.DateField
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.awt._UnoControlDateFieldModel
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.form.component._DateField
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class ODateModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Date";
+ * super.m_kindOfControl="DateField";
+ * super.m_ObjectName = "stardiv.one.form.component.DateField";
+ *
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_DATE_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * NamedValue Date = new NamedValue();
+ * Date.Name = "Date";
+ * Date.Value = new Integer(DBTools.TST_DATE);
+ * super.m_propertiesToSet.add(Date);
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Date";
+
+ super.m_kindOfControl="DateField";
+
+ super.m_ObjectName = "stardiv.one.form.component.DateField";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_DATE_F;
+ super.m_propertiesToSet.add(DataField);
+
+ NamedValue Date = new NamedValue();
+ Date.Name = "Date";
+ Date.Value = new Integer(DBTools.TST_DATE);
+ super.m_propertiesToSet.add(Date);
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class ODateModel
diff --git a/qadevOOo/tests/java/mod/_forms/OEditControl.java b/qadevOOo/tests/java/mod/_forms/OEditControl.java
new file mode 100644
index 000000000000..4204606d087e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OEditControl.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.TextField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::form::XChangeBroadcaster</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.form.XChangeBroadcaster
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTextListener
+ * @see ifc.form._XChangeBroadcaster
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OEditControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.TextField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * <li> <code>'Win1'</code> for
+ * {@link ifc.form.XChangeBroadcaster} : the window (controller)
+ * of the tested component. </li>
+ * <li> <code>'Win2'</code> for
+ * {@link ifc.form.XChangeBroadcaster} : the window (controller)
+ * of another component. </li>
+ * <li> <code>'CONTROL'</code> for
+ * {@link ifc.form.XChangeBroadcaster} : the controller
+ * of another component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XControl aControl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OEditControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OEditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OEditControl", e);
+ }
+
+ log.println("creating a new environment for OEditControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // relations for XChangeBroadcaster
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("Win1",
+ (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ oObj));
+ tEnv.addObjRelation("Win2", forObjRel);
+ tEnv.addObjRelation("CONTROL", aControl);
+
+
+ // relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OEditControl
diff --git a/qadevOOo/tests/java/mod/_forms/OEditModel.java b/qadevOOo/tests/java/mod/_forms/OEditModel.java
new file mode 100644
index 000000000000..bcecd77550df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OEditModel.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.TextField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::component::TextField</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::awt::UnoControlEditModel</code></li>
+* <li> <code>com::sun::star::form::component::DatabaseTextField</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TestDB </b> (directory) : directory with test database </li>
+* <li><b> TestDB/TestDB.dbf </b> : table file. See
+* {@link util.DBTools DBTools} class for more information.</li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.component.TextField
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.awt.UnoControlEditModel
+* @see com.sun.star.form.component.DatabaseTextField
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form.component._TextField
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.awt._UnoControlEditModel
+* @see ifc.form.component._DatabaseTextField
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class OEditModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * <super.m_ChangePropertyName</CODE> = "Text";
+ * super.m_kindOfControl</CODE>="TextField";
+ * super.m_ObjectName</CODE> = "Edit";
+ * NamedValue myProp = new NamedValue();
+ * myProp.Name = "DataField";
+ * myProp.Value = DBTools.TST_STRING_F;
+ * super.m_propertiesToSet.add(myProp);
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="TextField";
+
+ super.m_ObjectName = "stardiv.one.form.component.Edit";
+
+ NamedValue myProp = new NamedValue();
+ myProp.Name = "DataField";
+ myProp.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(myProp);
+
+ super.m_LCShape_Type = "FixedText";
+
+ super.m_ChangePropertyName = "Text";
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class OEditModel
diff --git a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java
new file mode 100644
index 000000000000..b83e9ce007ee
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.FileControl</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::awt::UnoControlFileControlModel</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::form::component::FileControl</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.awt.UnoControlFileControlModel
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.form.component.FileControl
+ * @see ifc.io._XPersistObject
+ * @see ifc.container._XChild
+ * @see ifc.form._FormControlModel
+ * @see ifc.awt._UnoControlFileControlModel
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XPropertySet
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertyState
+ * @see ifc.container._XNamed
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.lang._XComponent
+ * @see ifc.form.component._FileControl
+ */
+public class OFileControlModel extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Draw document where controls are placed.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) tParam.getMSF()));
+
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create a document :");
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Can't create a document"));
+ }
+ }
+
+ /**
+ * Disposes Draw document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDrawDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates FileControl in the Form. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} : name of service which is
+ * represented by this object. </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ //get FileControlModel
+ String objName = "FileControl";
+
+ XControlShape aShape = null;
+
+ Size size = new Size();
+ Point position = new Point();
+ XControlModel aControl = null;
+
+ //get MSF
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xDrawDoc);
+
+ try {
+ Object oInt = oDocMSF.createInstance(
+ "com.sun.star.drawing.ControlShape");
+ Object aCon = oDocMSF.createInstance(
+ "com.sun.star.form.component." + objName);
+ aControl = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class, aCon);
+ aShape = (XControlShape) UnoRuntime.queryInterface(
+ XControlShape.class, oInt);
+ size.Height = 1500;
+ size.Width = 3000;
+ position.X = 1000;
+ position.Y = 1000;
+ aShape.setSize(size);
+ aShape.setPosition(position);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ log.println("Couldn't create a component " + e);
+ throw new StatusException(Status.failed("Can't create component"));
+ }
+
+ aShape.setControl(aControl);
+
+ DrawTools.getDrawPage(xDrawDoc, 0).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." +
+ objName);
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "HelpText";
+ prop.Value = "new Help Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OFileControlModel
diff --git a/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java b/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java
new file mode 100644
index 000000000000..c3a172eb746a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.FixedText</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::awt::UnoControlFixedTextModel</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.container.XChild
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.awt.UnoControlFixedTextModel
+* @see com.sun.star.lang.XComponent
+* @see ifc.io._XPersistObject
+* @see ifc.container._XChild
+* @see ifc.form._FormControlModel
+* @see ifc.form._FormComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XPropertyState
+* @see ifc.container._XNamed
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.awt._UnoControlFixedTextModel
+* @see ifc.lang._XComponent
+*/
+
+public class OFixedTextModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="CommandButton";
+ * super.m_ObjectName = "com.sun.star.form.component.CommandButton";
+ * super.m_LCShape_Type = "CommandButton";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="FixedText";
+
+ super.m_ObjectName = "stardiv.one.form.component.FixedText";
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OFixedTextModel
diff --git a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java
new file mode 100644
index 000000000000..5a1a4c3d6bb1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java
@@ -0,0 +1,240 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.FormattedField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OFormattedControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.FormattedField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "FormattedField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OFormattedControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OFormattedControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OFormattedControl", e);
+ }
+
+ log.println("creating a new environment for OFormattedControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OFormattedControl
diff --git a/qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java b/qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java
new file mode 100644
index 000000000000..73d174eae99f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DBTools;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.FormattedField</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::form::XReset</code></li>
+ * <li> <code>com::sun::star::form::XBoundComponent</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+ * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+ * <li> <code>com::sun::star::form::component::DatabaseFormattedField</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::form::XLoadListener</code></li>
+ * <li> <code>com::sun::star::awt::UnoControlFormattedFieldModel</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.form.XReset
+ * @see com.sun.star.form.XBoundComponent
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.form.DataAwareControlModel
+ * @see com.sun.star.form.XUpdateBroadcaster
+ * @see com.sun.star.form.component.DatabaseFormattedField
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XEventListener
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.form.XLoadListener
+ * @see com.sun.star.awt.UnoControlFormattedFieldModel
+ * @see com.sun.star.container.XChild
+ * @see ifc.io._XPersistObject
+ * @see ifc.form._XReset
+ * @see ifc.form._XBoundComponent
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.form._DataAwareControlModel
+ * @see ifc.form._XUpdateBroadcaster
+ * @see ifc.form.component._DatabaseFormattedField
+ * @see ifc.form._FormControlModel
+ * @see ifc.beans._XPropertyState
+ * @see ifc.container._XNamed
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XEventListener
+ * @see ifc.beans._XPropertyAccess
+ * @see ifc.beans._XPropertyContainer
+ * @see ifc.beans._XPropertySet
+ * @see ifc.form._XLoadListener
+ * @see ifc.awt._UnoControlFormattedFieldModel
+ * @see ifc.container._XChild
+ */
+public class OFormattedFieldWrapper extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ ' super.m_ChangePropertyName = "Text";
+ * super.m_kindOfControl="DatabaseImageControl";
+ * super.m_ObjectName = "stardiv.one.form.component.DatabaseImageControl";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_BINARY_STREAM_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Text";
+
+ super.m_kindOfControl="DatabaseFormattedField";
+
+ super.m_ObjectName = "stardiv.one.form.component.Edit";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ } /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class OFormattedFieldWrapper
diff --git a/qadevOOo/tests/java/mod/_forms/OFormsCollection.java b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java
new file mode 100644
index 000000000000..a04e06bbf1a5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.FormTools;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.Forms</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::container::XIndexReplace</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexContainer</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* </ul>
+*
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+*
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.container.XIndexReplace
+* @see com.sun.star.container.XNameContainer
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.container.XIndexContainer
+* @see com.sun.star.container.XNameAccess
+* @see ifc.container._XNameReplace
+* @see ifc.container._XIndexReplace
+* @see ifc.container._XNameContainer
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XEnumerationAccess
+* @see ifc.container._XIndexContainer
+* @see ifc.container._XNameAccess
+*/
+public class OFormsCollection extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a draw document");
+ xDrawDoc = DrawTools.createDrawDoc(((XMultiServiceFactory) tParam.getMSF()));
+ }
+
+ /**
+ * Disposes drawing document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDrawDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Adds some controls to the 'Standard' form of a draw page,
+ * then adds an empty form to a collection of forms. Then
+ * returns the collection as a test object. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'INSTANCE1' ... 'INSTANCEN'</code> for
+ * <code>XNameReplace, XNameContainer, XIndexReplace,
+ * XIndexContainer </code> : objects to be inserted
+ * or replaced with in interface tests. Number of relations
+ * depends on number of interface test threads. For each
+ * thread there must be an individual element. </li>
+ * <li> <code>'XNameContainer.AllowDuplicateNames'</code> :
+ * if this relation exists then container elements can have duplicate
+ * names. In case of forms' collection forms can have equal names.</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XDrawPage oDP = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ oDP = DrawTools.getDrawPage(xDrawDoc, 0);
+
+ (DrawTools.getShapes(oDP))
+ .add(FormTools.createControlShape(xDrawDoc, 2000, 1500, 1000, 1000,
+ "CheckBox"));
+ (DrawTools.getShapes(oDP))
+ .add(FormTools.createControlShape(xDrawDoc, 3000, 4500, 15000,
+ 1000, "CommandButton"));
+ (DrawTools.getShapes(oDP))
+ .add(FormTools.createControlShape(xDrawDoc, 5000, 3500, 7500, 5000,
+ "TextField"));
+
+ oObj = FormTools.getForms(oDP);
+ FormTools.insertForm(xDrawDoc, (XNameContainer) oObj, "SecondForm");
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println("adding INSTANCEn as obj relation to environment");
+
+ XComponent xComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xDrawDoc);
+ int THRCNT = 1;
+ if (Param.get("THRCNT")!= null) {
+ THRCNT = Integer.parseInt((String) Param.get("THRCNT"));
+ }
+
+ for (int n = 1; n < (THRCNT + 1); n++) {
+ log.println("adding INSTANCE" + n +
+ " as obj relation to environment");
+ tEnv.addObjRelation("INSTANCE" + n,
+ FormTools.createControl(xComp, "Form"));
+ }
+
+
+ // adding indicator that this collection can have duplicate
+ // elements with the same names for XNameContainer test.
+ tEnv.addObjRelation("XNameContainer.AllowDuplicateNames", new Object());
+
+ tEnv.addObjRelation("INSTANCE", FormTools.createControl(xComp, "Form"));
+ tEnv.addObjRelation("INSTANCE2",
+ FormTools.createControl(xComp, "Form"));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OFormsCollection
diff --git a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java
new file mode 100644
index 000000000000..92655bf9e2eb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java
@@ -0,0 +1,431 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.form.XGridColumnFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.GridControl</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::script::XEventAttacherManager</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::form::component::GridControl</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XIndexReplace</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* <li> <code>com::sun::star::form::XGridColumnFactory</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XIndexContainer</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* <li> <code>com::sun::star::container::XContainer</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+*
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.form.XReset
+* @see com.sun.star.script.XEventAttacherManager
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.form.component.GridControl
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XIndexReplace
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XNameContainer
+* @see com.sun.star.form.XGridColumnFactory
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XIndexContainer
+* @see com.sun.star.container.XChild
+* @see com.sun.star.container.XContainer
+* @see ifc.io._XPersistObject
+* @see ifc.container._XNameReplace
+* @see ifc.form._XReset
+* @see ifc.script._XEventAttacherManager
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.container._XElementAccess
+* @see ifc.form.component._GridControl
+* @see ifc.view._XSelectionSupplier
+* @see ifc.container._XEnumerationAccess
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XIndexReplace
+* @see ifc.container._XNamed
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XNameContainer
+* @see ifc.form._XGridColumnFactory
+* @see ifc.lang._XComponent
+* @see ifc.container._XNameAccess
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XIndexContainer
+* @see ifc.container._XChild
+* @see ifc.container._XContainer
+*/
+
+public class OGridControlModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="CommandButton";
+ * super.m_ObjectName = "com.sun.star.form.component.CommandButton";
+ * super.m_LCShape_Type = "CommandButton";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="GridControl";
+
+ super.m_ObjectName = "stardiv.one.form.component.Grid";
+
+ super.m_LCShape_Type = "GridControl";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ TestEnvironment tEnv = super.createTestEnvironment(Param, log);
+
+ XInterface oObj = tEnv.getTestObject();
+
+ XPropertySet aControl = null;
+ XPropertySet aControl2 = null;
+ XPropertySet aControl3 = null;
+ XPropertySet aControl4 = null;
+ XPropertySet aControl5 = null;
+
+ try {
+ XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface(
+ XGridColumnFactory.class, oObj);
+ aControl = columns.createColumn("TextField");
+ aControl2 = columns.createColumn("DateField");
+ aControl3 = columns.createColumn("TextField");
+ aControl4 = columns.createColumn("TextField");
+ aControl5 = columns.createColumn("TextField");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ }
+
+ XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, oObj);
+
+ try {
+ aContainer.insertByName("First", aControl);
+ aContainer.insertByName("Second", aControl2);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ }
+
+ //Relations for XSelectionSupplier
+ tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });
+
+ // adding relation for XNameContainer
+ tEnv.addObjRelation("XNameContainer.AllowDuplicateNames", new Object());
+
+
+ // adding relation for XContainer
+ tEnv.addObjRelation("INSTANCE", aControl3);
+ tEnv.addObjRelation("INSTANCE1", aControl4);
+ tEnv.addObjRelation("INSTANCE2", aControl5);
+
+
+ tEnv.addObjRelation("Comparer",
+ new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XNamed named1 = (XNamed) UnoRuntime.queryInterface(
+ XNamed.class, o1);
+ XNamed named2 = (XNamed) UnoRuntime.queryInterface(
+ XNamed.class, o2);
+
+ if (named1.getName().equals(named2.getName())) {
+ return 0;
+ }
+
+ return -1;
+ }
+
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ }
+ });
+
+
+// HashSet exclude = new HashSet();
+//
+// exclude.add("FormatKey");
+//
+// tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+// new Checker(m_XFormLoader, m_XPS, m_XCtrl, m_ChangePropertyName, m_ChangePropertyValue));
+ return tEnv;
+ }
+
+} // finish class OButtonModelold
+
+
+class OGridControlModelold extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) tParam.getMSF()));
+
+ log.println("creating a draw document");
+
+ try {
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create Draw document", e);
+ }
+ }
+
+ /**
+ * Disposes drawing document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDrawDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * <code>GridControl</code> component created and added to the draw
+ * page. Then two columns are created and added to the grid.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'INSTANCE1' ... 'INSTANCEN'</code> for
+ * <code>XNameReplace, XNameContainer, XIndexReplace,
+ * XIndexContainer </code> : objects to be inserted
+ * or replaced with in interface tests. Number of relations
+ * depends on number of interface test threads. For each
+ * thread there must be an individual element. </li>
+ * <li> <code>'XNameContainer.AllowDuplicateNames'</code> :
+ * if this relation exists then container elements can have duplicate
+ * names. <code>GridControl</code> can have.</li>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} : name of service which is
+ * represented by this object. </li>
+ * <li> <code>'INSTANCE'</code> for
+ * {@link ifc.container._XContainer} : a column instance. </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XInterface oInstance = null;
+ XPropertySet aControl = null;
+ XPropertySet aControl2 = null;
+ XPropertySet aControl3 = null;
+ XPropertySet aControl4 = null;
+ XPropertySet aControl5 = null;
+ XGridColumnFactory columns = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ //get GridControlModel
+ String objName = "Grid";
+ XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
+ 7000, 2000, 2000,
+ "GridControl");
+ oObj = shape.getControl();
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ try {
+ columns = (XGridColumnFactory) UnoRuntime.queryInterface(
+ XGridColumnFactory.class, oObj);
+ aControl = columns.createColumn("TextField");
+ aControl2 = columns.createColumn("DateField");
+ aControl3 = columns.createColumn("TextField");
+ aControl4 = columns.createColumn("TextField");
+ aControl5 = columns.createColumn("TextField");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ // Some exception occures.FAILED
+ log.println("!!! Couldn't create instance : " + e);
+ throw new StatusException("Can't create column instances.", e);
+ }
+
+ XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, oObj);
+
+ try {
+ aContainer.insertByName("First", aControl);
+ aContainer.insertByName("Second", aControl2);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("!!! Could't insert column Instance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't insert columns", e);
+ }
+
+ //Relations for XSelectionSupplier
+ tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });
+
+ // COMPARER
+
+ int THRCNT = 1;
+ String count = (String)Param.get("THRCNT");
+ if (count != null)
+ THRCNT = Integer.parseInt(count);
+
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println("adding INSTANCEn as obj relation to environment");
+
+ try {
+ for (int n = 1; n < (3 * THRCNT + 1); n++) {
+ log.println("adding INSTANCE" + n +
+ " as obj relation to environment");
+ oInstance = columns.createColumn("TextField");
+ tEnv.addObjRelation("INSTANCE" + n, oInstance);
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create 'INSTANCEn' relations", e);
+ }
+
+
+ // adding relation for XNameContainer
+ tEnv.addObjRelation("XNameContainer.AllowDuplicateNames", new Object());
+
+ // OK tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+
+ // adding relation for XContainer
+ tEnv.addObjRelation("INSTANCE", aControl3);
+ tEnv.addObjRelation("INSTANCE2", aControl4);
+
+
+ //adding ObjRelation for XPersistObject
+ // OK tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true)); // OK
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OGridControlModel
diff --git a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java
new file mode 100644
index 000000000000..c3707748fdf5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.GroupBox</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XView
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XWindow
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XView
+ */
+public class OGroupBoxControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.GroupBox</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 5000,
+ 7000, 2000, 2000,
+ "GroupBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OGroupBoxControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OGroupBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OGroupBoxControl", e);
+ }
+
+ log.println("creating a new environment for OGroupBoxControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+
+ // Adding relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow",
+ UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OGroupBoxControl
diff --git a/qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java b/qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java
new file mode 100644
index 000000000000..feb425c693df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.GroupBox</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::UnoControlGroupBoxModel</code></li>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.awt.UnoControlGroupBoxModel
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XPropertyAccess
+ * @see com.sun.star.beans.XPropertyContainer
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.awt._UnoControlGroupBoxModel
+ * @see ifc.io._XPersistObject
+ * @see ifc.container._XChild
+ * @see ifc.form._FormControlModel
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XPropertySet
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertyState
+ * @see ifc.container._XNamed
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.lang._XComponent
+ */
+public class OGroupBoxModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * <super.m_ChangePropertyName</CODE> = "Text";
+ * super.m_kindOfControl</CODE>="GroupBox";
+ * super.m_ObjectName</CODE> = "GroupBox";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="GroupBox";
+
+ super.m_ObjectName = "stardiv.one.form.component.GroupBox";
+
+ super.m_LCShape_Type = "FixedText";
+
+ super.m_ChangePropertyName = "Text";
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OGroupBoxModel
diff --git a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java
new file mode 100644
index 000000000000..f7557ca671d8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.PropertyValue;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.FormTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.HiddenControl</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::form::component::HiddenControl</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.container.XChild
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.form.component.HiddenControl
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.io._XPersistObject
+ * @see ifc.container._XChild
+ * @see ifc.form._FormControlModel
+ * @see ifc.form.component._HiddenControl
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XPropertySet
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertyState
+ * @see ifc.container._XNamed
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.lang._XComponent
+ */
+public class OHiddenModel extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) tParam.getMSF()));
+
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes drawing document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDrawDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates hidden component, then adds Form into draw page,
+ * and inserts the component into Form components' collection.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} : name of service which is
+ * represented by this object. </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+ String objName = "HiddenControl";
+ XInterface ctrl = SOF.createControl(xDrawDoc, objName);
+
+ try {
+ XDrawPage oDP = DrawTools.getDrawPage(xDrawDoc, 0);
+
+ XNameContainer nc = FormTools.getForms(oDP);
+ FormTools.insertForm(xDrawDoc, nc, "OHiddenModelForm");
+
+ Object frm = nc.getByName("OHiddenModelForm");
+
+ XNameContainer frmNC = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class, frm);
+
+ frmNC.insertByName("OHiddenModel", ctrl);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),
+ frmNC.getByName("OHiddenModel"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create and add control", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create and add control", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create and add control", e);
+ } catch (com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create and add control", e);
+ }
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ util.dbg.getSuppServices(oObj);
+
+ log.println("adding DrawDocument as obj relation to environment");
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component.Hidden");
+
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "Name";
+ prop.Value = "new Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "Name");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OHiddenModel
diff --git a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java
new file mode 100644
index 000000000000..60f208825863
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.ImageButton</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::form::XApproveActionBroadcaster</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.form.XApproveActionBroadcaster
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XView
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XWindow
+ * @see ifc.form._XApproveActionBroadcaster
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XView
+ */
+public class OImageButtonControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.ImageButton</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "ImageButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OImageButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OImageButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OImageButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for OImageButtonControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OImageButtonControl
diff --git a/qadevOOo/tests/java/mod/_forms/OImageButtonModel.java b/qadevOOo/tests/java/mod/_forms/OImageButtonModel.java
new file mode 100644
index 000000000000..3b5dbcded56f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageButtonModel.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.ImageButton</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* <li> <code>com::sun::star::awt::UnoControlImageControlModel</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::form::XImageProducerSupplier</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::component::ImageButton</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.container.XChild
+* @see com.sun.star.awt.UnoControlImageControlModel
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.form.XImageProducerSupplier
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.component.ImageButton
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.lang.XComponent
+* @see ifc.io._XPersistObject
+* @see ifc.container._XChild
+* @see ifc.awt._UnoControlImageControlModel
+* @see ifc.form._FormControlModel
+* @see ifc.form._FormComponent
+* @see ifc.form._XImageProducerSupplier
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XPropertyState
+* @see ifc.form.component._ImageButton
+* @see ifc.container._XNamed
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.lang._XComponent
+*/
+
+public class OImageButtonModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="ImageButton";
+ * super.m_ObjectName = "stardiv.one.form.component.ImageButton";
+ * super.m_LCShape_Type = "ImageButton";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="ImageButton";
+
+ super.m_ObjectName = "stardiv.one.form.component.ImageButton";
+
+ super.m_LCShape_Type = "ImageButton";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OImageButtonModel
diff --git a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java
new file mode 100644
index 000000000000..4dcec1573015
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.DatabaseImageControl</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XView
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XWindow
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XView
+ */
+public class OImageControlControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.DatabaseImageControl</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShapeWithDefaultControl(
+ xTextDoc, 3000, 4500, 15000, 10000,
+ "DatabaseImageControl");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OImageControlControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ the_win = the_access.getControl(the_Model).getPeer();
+ aControl = the_access.getControl(the_Model2);
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OImageControlControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OImageControlControl", e);
+ }
+
+ log.println(
+ "creating a new environment for OImageControlControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OImageControlControl
diff --git a/qadevOOo/tests/java/mod/_forms/OImageControlModel.java b/qadevOOo/tests/java/mod/_forms/OImageControlModel.java
new file mode 100644
index 000000000000..0525f6ff6778
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageControlModel.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.DatabaseImageControl</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::form::XImageProducerSupplier</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::awt::UnoControlImageControlModel</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code>
+* <b>(currently nonavailable)</b></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::form::component::DatabaseImageControl</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+*
+* @see com.sun.star.form.XImageProducerSupplier
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.awt.UnoControlImageControlModel
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.form.component.DatabaseImageControl
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.form._XImageProducerSupplier
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.awt._UnoControlImageControlModel
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.form.component._DatabaseImageControl
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class OImageControlModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="DatabaseImageControl";
+ * super.m_ObjectName = "stardiv.one.form.component.DatabaseImageControl";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_BINARY_STREAM_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl= "DatabaseImageControl";
+
+ super.m_ObjectName = "stardiv.one.form.component.ImageControl";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_BINARY_STREAM_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ } /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class OImageControlModel
diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java
new file mode 100644
index 000000000000..5d014aa759ee
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XListBox;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+public class OListBoxControl extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( ((XMultiServiceFactory) Param.getMSF()) );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null ;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"ListBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(
+ xTextDoc,3000,4500,5000,10000,"TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,xTextDoc.getCurrentController());
+
+ //now get the OListBoxControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200,200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get OListBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OListBoxControl", e );
+ }
+
+ log.println( "creating a new environment for OListBoxControl object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS",aGraphic);
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT",xTextDoc);
+ tEnv.addObjRelation("WINPEER",the_win);
+ tEnv.addObjRelation("TOOLKIT",the_kit);
+ tEnv.addObjRelation("MODEL",the_Model);
+
+ // Adding relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener() ;
+ final XListBox box = (XListBox) UnoRuntime.queryInterface(XListBox.class, oObj) ;
+ box.addItemListener(listener) ;
+ tEnv.addObjRelation("TestItemListener", listener) ;
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, anotherCtrl);
+
+ XWindow objWin = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, oObj);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape",aShape);
+
+ tEnv.addObjRelation("Win1",objWin);
+ tEnv.addObjRelation("Win2",forObjRel);
+
+ tEnv.addObjRelation("CONTROL",anotherCtrl);
+
+ // adding relation for XChangeBroadcaster
+ box.addItem("Item1", (short) 0);
+ box.addItem("Item2", (short) 1);
+
+ tEnv.addObjRelation("XChangeBroadcaster.Changer",
+ new ifc.form._XChangeBroadcaster.Changer() {
+ public void change(){
+ box.addItem("Item1", (short) 0);
+ box.addItem("Item2", (short) 1);
+ box.selectItemPos((short) 0, true);
+ box.selectItemPos((short) 1, true);
+ }
+ }
+ );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OListBoxControl
+
diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxModel.java b/qadevOOo/tests/java/mod/_forms/OListBoxModel.java
new file mode 100644
index 000000000000..c5aa052abbc0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OListBoxModel.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XBoundComponent;
+import com.sun.star.form.XLoadable;
+
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.form._XUpdateBroadcaster.UpdateChecker;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.DatabaseListBox</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::awt::UnoControlListBoxModel</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::form::component::ListBox</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::form::component::DatabaseListBox</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.awt.UnoControlListBoxModel
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.form.component.ListBox
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.form.component.DatabaseListBox
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.awt._UnoControlListBoxModel
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.form.component._ListBox
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.form.component._DatabaseListBox
+* @see ifc.container._XChild
+*/
+public class OListBoxModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Date";
+ * super.m_kindOfControl="DateField";
+ * super.m_ObjectName = "stardiv.one.form.component.DateField";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_DATE_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * NamedValue ListSource = new NamedValue();
+ * ListSource.Name = "ListSource";
+ * ListSource.Value = new String[] {
+ * "OListBoxModel1", "OListBoxModel2", "OListBoxModel3"};
+ * super.m_propertiesToSet.add(ListSource);
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "SelectedItems";
+
+ super.m_kindOfControl="ListBox";
+
+ super.m_ObjectName = "stardiv.one.form.component.ListBox";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(DataField);
+
+ NamedValue ListSource = new NamedValue();
+ ListSource.Name = "ListSource";
+ ListSource.Value = new String[] {
+ "OListBoxModel1", "OListBoxModel2", "OListBoxModel3"};
+ super.m_propertiesToSet.add(ListSource);
+
+ super.m_LCShape_Type = "FixedText";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * This test uses not the generic implementaion of <CODE>cecker()</CODE> of its
+ * super class. This tests uses its own implementation of <CODE>checker()</CODE>
+ * to test <CODE>com::sun::star::form::XUpdateBroadcaster</CODE>
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ TestEnvironment tEnv = super.createTestEnvironment(Param, log);
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new Checker(m_XFormLoader, m_XPS, m_XCtrl, m_ChangePropertyName, m_ChangePropertyValue));
+ return tEnv;
+ }
+
+ static class Checker implements UpdateChecker {
+ private short lastItem = (short) 0;
+ XLoadable formLoaderF = null;
+ XPropertySet ps = null;
+ XInterface ctrl = null;
+ String ChangePropertyName = null;
+ Object ChangePropertyValue = null;
+
+ public Checker(XLoadable xl, XPropertySet ps, XInterface ctrl, String ChangePropertyName, Object ChangePropertyValue) {
+ formLoaderF = xl;
+ this.ps = ps;
+ this.ctrl = ctrl;
+ this.ChangePropertyName=ChangePropertyName;
+ this.ChangePropertyValue=ChangePropertyValue;
+ }
+
+ public void update() throws Exception {
+ if (!formLoaderF.isLoaded()) {
+ formLoaderF.load();
+ }
+ lastItem = (short) (1 - lastItem);
+ ps.setPropertyValue(ChangePropertyName, new short[] { lastItem });
+ }
+
+ public void commit() throws SQLException {
+ XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface(
+ XBoundComponent.class, ctrl);
+ XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface(
+ XResultSetUpdate.class,
+ formLoaderF);
+
+ bound.commit();
+ update.updateRow();
+ }
+
+ public boolean wasCommited() throws Exception {
+ formLoaderF.reload();
+
+ short[] getS = (short[]) ps.getPropertyValue(ChangePropertyName);
+
+ return (getS.length > 0) && (lastItem == getS[0]);
+ }
+ }
+
+} // finish class OListBoxModel
diff --git a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java
new file mode 100644
index 000000000000..eac8ce39cb4e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+import util.DesktopTools;
+
+public class ONavigationBarControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.CommandButton</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "NavigationToolBar");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get ONavigationBarControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ONavigationBarControl", e);
+ }
+
+ log.println("creating a new environment for ONavigationBarControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ONavigationBarControl
diff --git a/qadevOOo/tests/java/mod/_forms/ONavigationBarModel.java b/qadevOOo/tests/java/mod/_forms/ONavigationBarModel.java
new file mode 100644
index 000000000000..75b8c2089c45
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONavigationBarModel.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+public class ONavigationBarModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_kindOfControl="NavigationToolBar";
+ * super.m_ObjectName = "om.sun.star.form.component.NavigationToolBar";
+ * super.m_LCShape_Type = "NavigationToolBar";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_kindOfControl="NavigationToolBar";
+
+ super.m_ObjectName = "com.sun.star.form.component.NavigationToolBar";
+
+ super.m_LCShape_Type = "NavigationToolBar";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class ONavigationBarModel
+
diff --git a/qadevOOo/tests/java/mod/_forms/ONumericControl.java b/qadevOOo/tests/java/mod/_forms/ONumericControl.java
new file mode 100644
index 000000000000..3a89d4639814
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONumericControl.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.NumericField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XNumericField</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XNumericField
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XNumericField
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class ONumericControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.NumericField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "NumericField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the ONumericControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get ONumericControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ONumericControl", e);
+ }
+
+ log.println("creating a new environment for ONumericControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ tEnv.addObjRelation("XTextComponent.onlyNumbers", new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ONumericControl
diff --git a/qadevOOo/tests/java/mod/_forms/ONumericModel.java b/qadevOOo/tests/java/mod/_forms/ONumericModel.java
new file mode 100644
index 000000000000..2e4a32bf9aa0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONumericModel.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.for.component.NumericField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::component::NumericField</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::awt::UnoControlNumericFieldModel</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.component.NumericField
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.awt.UnoControlNumericFieldModel
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form.component._NumericField
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.awt._UnoControlNumericFieldModel
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class ONumericModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Time";
+ * super.m_kindOfControl="TimeField";
+ * super.m_ObjectName = "stardiv.one.form.component.TimeField";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_INT_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Value";
+
+ super.m_kindOfControl="NumericField";
+
+ super.m_ObjectName = "stardiv.one.form.component.NumericField";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_DOUBLE_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ } /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+} // finish class ONumericModel
diff --git a/qadevOOo/tests/java/mod/_forms/OPatternControl.java b/qadevOOo/tests/java/mod/_forms/OPatternControl.java
new file mode 100644
index 000000000000..31046fab2eb0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OPatternControl.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.PatternField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::awt::XPatternField</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.awt.XPatternField
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.awt._XPatternField
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OPatternControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.PatternField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object anotherCtrl = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "PatternField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OPatternControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ anotherCtrl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OPatternControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OPatternControl", e);
+ }
+
+ log.println("creating a new environment for OPatternControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // Adding relation for XWindow
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ anotherCtrl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class OPatternControl
diff --git a/qadevOOo/tests/java/mod/_forms/OPatternModel.java b/qadevOOo/tests/java/mod/_forms/OPatternModel.java
new file mode 100644
index 000000000000..070ed5a9e870
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OPatternModel.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.form.component.PatternField</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::io::XPersistObject</code></li>
+ * <li> <code>com::sun::star::form::XReset</code></li>
+ * <li> <code>com::sun::star::form::XBoundComponent</code></li>
+ * <li> <code>com::sun::star::form::FormComponent</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * <li> <code>com::sun::star::form::component::PatternField</code></li>
+ * <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+ * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+ * <li> <code>com::sun::star::awt::UnoControlPatternFieldModel</code></li>
+ * <li> <code>com::sun::star::form::component::DatabasePatternField</code></li>
+ * <li> <code>com::sun::star::form::FormControlModel</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::form::XLoadListener</code></li>
+ * <li> <code>com::sun::star::container::XChild</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.io.XPersistObject
+ * @see com.sun.star.form.XReset
+ * @see com.sun.star.form.XBoundComponent
+ * @see com.sun.star.form.FormComponent
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see com.sun.star.form.component.PatternField
+ * @see com.sun.star.form.DataAwareControlModel
+ * @see com.sun.star.form.XUpdateBroadcaster
+ * @see com.sun.star.awt.UnoControlPatternFieldModel
+ * @see com.sun.star.form.component.DatabasePatternField
+ * @see com.sun.star.form.FormControlModel
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XEventListener
+ * @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.form.XLoadListener
+ * @see com.sun.star.container.XChild
+ * @see ifc.io._XPersistObject
+ * @see ifc.form._XReset
+ * @see ifc.form._XBoundComponent
+ * @see ifc.form._FormComponent
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XMultiPropertySet
+ * @see ifc.form.component._PatternField
+ * @see ifc.form._DataAwareControlModel
+ * @see ifc.form._XUpdateBroadcaster
+ * @see ifc.awt._UnoControlPatternFieldModel
+ * @see ifc.form.component._DatabasePatternField
+ * @see ifc.form._FormControlModel
+ * @see ifc.beans._XPropertyState
+ * @see ifc.container._XNamed
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XEventListener
+ * @see ifc.beans._XPropertySet
+ * @see ifc.form._XLoadListener
+ * @see ifc.container._XChild
+ */
+public class OPatternModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Text";
+ * super.m_kindOfControl="PatternField";
+ * super.m_ObjectName = "stardiv.one.form.component.PatternField";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_STRING_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Text";
+
+ super.m_kindOfControl="PatternField";
+
+ super.m_ObjectName = "stardiv.one.form.component.PatternField";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ } /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ return super.createTestEnvironment(Param, log);
+ }
+
+} // finish class OPatternModel
diff --git a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java
new file mode 100644
index 000000000000..52ff5ffb189e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.RadioButton</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XRadioButton</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XRadioButton
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XView
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XWindow
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XRadioButton
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XView
+ */
+public class ORadioButtonControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.RadioButton</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "RadioButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the ORadioButtonControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get ORadioButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ORadioButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for ORadioButtonControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ORadioButtonControl
diff --git a/qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java b/qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java
new file mode 100644
index 000000000000..f846b3a8132d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyValue;
+import java.io.PrintWriter;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.RadioButton</code>. <p>
+*
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::component::RadioButton</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::awt::UnoControlRadioButtonModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.component.RadioButton
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.awt.UnoControlRadioButtonModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.io._XPersistObject
+* @see ifc.form.component._RadioButton
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.awt._UnoControlRadioButtonModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class ORadioButtonModel extends GenericModelTest {
+
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName</CODE> = "State";
+ * super.m_kindOfControl</CODE>="RadioButton";
+ * super.m_ObjectName</CODE> = "RadioButton";
+ * NamedValue myProp = new NamedValue();
+ * myProp.Name = "DataField";
+ * myProp.Value = DBTools.TST_STRING_F;
+ * super.m_propertiesToSet.add(myProp);
+ * super.m_LCShape_Type = "GroupBox";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+ super.m_ChangePropertyName = "State";
+
+ super.m_kindOfControl="RadioButton";
+
+ super.m_ObjectName = "stardiv.one.form.component.RadioButton";
+
+ NamedValue myProp = new NamedValue();
+ myProp.Name = "DataField";
+ myProp.Value = DBTools.TST_STRING_F;
+ super.m_propertiesToSet.add(myProp);
+
+ super.m_LCShape_Type = "GroupBox";
+
+ }
+ /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ TestEnvironment tEnv = super.createTestEnvironment(Param, log);
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_INT_F);
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "HelpText";
+ prop.Value = "new Help Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText");
+
+ return tEnv;
+ }
+
+} // finish class ORadioButtonModel
diff --git a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java
new file mode 100644
index 000000000000..1104c65abd75
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.WriterTools;
+
+public class OScrollBarModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(((XMultiServiceFactory) tParam.getMSF()));
+ }
+
+ /**
+ * Disposes the Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"ScrollBar");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+ log.println( "creating a new environment for OScrollBarModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ System.out.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ String objName = "ScrollBar";
+ tEnv.addObjRelation("OBJNAME", "com.sun.star.form.component." + objName);
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "HelpText";
+ prop.Value = "new Help Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText");
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java
new file mode 100644
index 000000000000..c4a574755192
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.WriterTools;
+
+public class OSpinButtonModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(((XMultiServiceFactory) tParam.getMSF()));
+ }
+
+ /**
+ * Disposes the Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Adds spin button into text and retrieves it's control model.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"SpinButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+ log.println( "creating a new environment for OButtonModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("OBJNAME", "com.sun.star.form.component.SpinButton");
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "HelpText";
+ prop.Value = "new Help Text since XPropertyAccess";
+ tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
+ tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText");
+
+ System.out.println("Implementation name: "+util.utils.getImplName(oObj));
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java
new file mode 100644
index 000000000000..30c457630c4c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java
@@ -0,0 +1,258 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+/**
+ * Test for object which is represented by default controller
+ * of the <code>com.sun.star.form.component.TimeField</code>
+ * component. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::awt::XView</code></li>
+ * <li> <code>com::sun::star::form::XBoundControl</code></li>
+ * <li> <code>com::sun::star::awt::XControl</code></li>
+ * <li> <code>com::sun::star::awt::XTextComponent</code></li>
+ * <li> <code>com::sun::star::awt::XLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::awt::XTimeField</code></li>
+ * <li> <code>com::sun::star::awt::XTextListener</code></li>
+ * <li> <code>com::sun::star::awt::XWindow</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::awt::XTextLayoutConstrains</code></li>
+ * <li> <code>com::sun::star::lang::XEventListener</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.awt.XView
+ * @see com.sun.star.form.XBoundControl
+ * @see com.sun.star.awt.XControl
+ * @see com.sun.star.awt.XTextComponent
+ * @see com.sun.star.awt.XLayoutConstrains
+ * @see com.sun.star.awt.XTimeField
+ * @see com.sun.star.awt.XTextListener
+ * @see com.sun.star.awt.XWindow
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.awt.XTextLayoutConstrains
+ * @see com.sun.star.lang.XEventListener
+ * @see ifc.awt._XView
+ * @see ifc.form._XBoundControl
+ * @see ifc.awt._XControl
+ * @see ifc.awt._XTextComponent
+ * @see ifc.awt._XLayoutConstrains
+ * @see ifc.awt._XTimeField
+ * @see ifc.awt._XTextListener
+ * @see ifc.awt._XWindow
+ * @see ifc.lang._XComponent
+ * @see ifc.awt._XTextLayoutConstrains
+ * @see ifc.lang._XEventListener
+ */
+public class OTimeControl extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Creates two components and inserts them to the form of
+ * text document. One component
+ * (<code>com.sun.star.form.component.TimeField</code>) is created
+ * for testing, another to be passed as relation. Using a controller
+ * of the text document the controller of the first component is
+ * obtained and returned in environment as a test object. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'GRAPHICS'</code> for
+ * {@link ifc.awt._XView} : a graphics component
+ * created using screen device of the window peer of
+ * the controller tested. </li>
+ * <li> <code>'CONTEXT'</code> for
+ * {@link ifc.awt._XControl} : the text document
+ * where the component is inserted. </li>
+ * <li> <code>'WINPEER'</code> for
+ * {@link ifc.awt._XControl} : Window peer of the
+ * controller tested. </li>
+ * <li> <code>'TOOLKIT'</code> for
+ * {@link ifc.awt._XControl} : toolkit of the component.</li>
+ * <li> <code>'MODEL'</code> for
+ * {@link ifc.awt._XControl} : the model of the controller.</li>
+ * <li> <code>'XWindow.AnotherWindow'</code> for
+ * {@link ifc.awt._XWindow} : the controller of another
+ * component. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "TimeField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //now get the OTimeControl
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get OTimeControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get OTimeControl", e);
+ }
+
+ log.println("creating a new environment for OTimeControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ FormTools.switchDesignOf(((XMultiServiceFactory) Param.getMSF()), xTextDoc);
+ shortWait();
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} // finish class OTimeControl
diff --git a/qadevOOo/tests/java/mod/_forms/OTimeModel.java b/qadevOOo/tests/java/mod/_forms/OTimeModel.java
new file mode 100644
index 000000000000..e77eff500152
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OTimeModel.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._forms;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XBoundComponent;
+import com.sun.star.form.XLoadable;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.HashSet;
+import ifc.form._XUpdateBroadcaster.UpdateChecker;
+
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.form.component.TimeField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlTimeFieldModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::form::component::TimeField</code></li>
+* <li> <code>com::sun::star::form::XReset</code></li>
+* <li> <code>com::sun::star::form::XBoundComponent</code></li>
+* <li> <code>com::sun::star::form::FormComponent</code></li>
+* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
+* <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::form::FormControlModel</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XEventListener</code></li>
+* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::form::XLoadListener</code></li>
+* <li> <code>com::sun::star::container::XChild</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TestDB </b> (directory) : directory with test database </li>
+* <li><b> TestDB/TestDB.dbf </b> : table file. See
+* {@link util.DBTools DBTools} class for more information.</li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlTimeFieldModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.form.component.TimeField
+* @see com.sun.star.form.XReset
+* @see com.sun.star.form.XBoundComponent
+* @see com.sun.star.form.FormComponent
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see com.sun.star.form.XUpdateBroadcaster
+* @see com.sun.star.form.DataAwareControlModel
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.form.FormControlModel
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XEventListener
+* @see com.sun.star.beans.XPropertyAccess
+* @see com.sun.star.beans.XPropertyContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.form.XLoadListener
+* @see com.sun.star.container.XChild
+* @see ifc.awt._UnoControlTimeFieldModel
+* @see ifc.io._XPersistObject
+* @see ifc.form.component._TimeField
+* @see ifc.form._XReset
+* @see ifc.form._XBoundComponent
+* @see ifc.form._FormComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XMultiPropertySet
+* @see ifc.form._XUpdateBroadcaster
+* @see ifc.form._DataAwareControlModel
+* @see ifc.beans._XPropertyState
+* @see ifc.form._FormControlModel
+* @see ifc.container._XNamed
+* @see ifc.lang._XComponent
+* @see ifc.lang._XEventListener
+* @see ifc.beans._XPropertySet
+* @see ifc.form._XLoadListener
+* @see ifc.container._XChild
+*/
+public class OTimeModel extends GenericModelTest {
+ /**
+ * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
+ * <pre>
+ * super.m_ChangePropertyName = "Time";
+ * super.m_kindOfControl="TimeField";
+ * super.m_ObjectName = "stardiv.one.form.component.TimeField";
+ * NamedValue DataField = new NamedValue();
+ * DataField.Name = "DataField";
+ * DataField.Value = DBTools.TST_INT_F;
+ * super.m_propertiesToSet.add(DataField);
+ *
+ * super.m_LCShape_Type = "FixedText";
+ * </pre>
+ * Then <CODE>super.initialize()</CODE> was called.
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+
+ super.initialize(tParam, log);
+
+ super.m_ChangePropertyName = "Time";
+
+ super.m_kindOfControl="TimeField";
+
+ super.m_ObjectName = "stardiv.one.form.component.TimeField";
+
+ NamedValue DataField = new NamedValue();
+ DataField.Name = "DataField";
+ DataField.Value = DBTools.TST_INT_F;
+ super.m_propertiesToSet.add(DataField);
+
+ super.m_LCShape_Type = "FixedText";
+
+ } /**
+ * calls <CODE>cleanup()</CODE> from it's super class
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ super.cleanup(tParam, log);
+ }
+
+ /**
+ * calls <CODE>createTestEnvironment()</CODE> from it's super class
+ * This test uses not the generic implementaion of <CODE>cecker()</CODE> of its
+ * super class. This tests uses its own implementation of <CODE>checker()</CODE>
+ * to test <CODE>com::sun::star::form::XUpdateBroadcaster</CODE>
+ * @param Param the test parameter
+ * @param log the log writer
+ * @return lib.TestEnvironment
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ TestEnvironment tEnv = super.createTestEnvironment(Param, log);
+
+ HashSet exclude = new HashSet();
+
+ exclude.add("FormatKey");
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new Checker(m_XFormLoader, m_XPS, m_XCtrl, m_ChangePropertyName, m_ChangePropertyValue));
+ return tEnv;
+ }
+
+ static class Checker implements UpdateChecker {
+ private short lastItem = (short) 0;
+ XLoadable formLoaderF = null;
+ XPropertySet ps = null;
+ XInterface ctrl = null;
+ String ChangePropertyName = null;
+ Object ChangePropertyValue = null;
+
+ public Checker(XLoadable xl, XPropertySet ps, XInterface ctrl, String ChangePropertyName, Object ChangePropertyValue) {
+ formLoaderF = xl;
+ this.ps = ps;
+ this.ctrl = ctrl;
+ this.ChangePropertyName=ChangePropertyName;
+ this.ChangePropertyValue=ChangePropertyValue;
+ }
+
+ private int lastTime = 0;
+
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded()) {
+ formLoaderF.load();
+ }
+
+ Integer time = (Integer) ps.getPropertyValue("Time");
+
+ if (time != null) {
+ lastTime = time.intValue() + 150000;
+ }
+
+ ps.setPropertyValue("Time", new Integer(lastTime));
+ }
+
+ public void commit() throws com.sun.star.sdbc.SQLException {
+ XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface(
+ XBoundComponent.class, ctrl);
+ XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface(
+ XResultSetUpdate.class,
+ formLoaderF);
+
+ bound.commit();
+ update.updateRow();
+ }
+
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ formLoaderF.reload();
+
+ Integer getT = (Integer) ps.getPropertyValue("Time");
+
+ return (getT != null) &&
+ (Math.abs(getT.intValue() - lastTime) < 100);
+ }
+ }
+} // finish class OTimeModel
diff --git a/qadevOOo/tests/java/mod/_forms/package.html b/qadevOOo/tests/java/mod/_forms/package.html
new file mode 100644
index 000000000000..15ed2ca3a131
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'forms'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fps/FilePicker.java b/qadevOOo/tests/java/mod/_fps/FilePicker.java
new file mode 100644
index 000000000000..810e71c425f4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fps/FilePicker.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fps;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ui.FilePicker</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ui::XFilePicker</code></li>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+* <li> <code>com::sun::star::ui::XExecutableDialog</code></li>
+* <li> <code>com::sun::star::ui::XFilePickerControlAccess</code></li>
+* <li> <code>com::sun::star::ui::XFilterManager</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::ui::XFilePickerNotifier</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ui.XFilePicker
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.lang.XTypeProvider
+* @see com.sun.star.ui.XExecutableDialog
+* @see com.sun.star.ui.XFilePickerControlAccess
+* @see com.sun.star.ui.XFilterManager
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.ui.XFilePickerNotifier
+* @see com.sun.star.ui.XFilePicker
+* @see ifc.ui._XFilePicker
+* @see ifc.lang._XInitialization
+* @see ifc.lang._XServiceInfo
+* @see ifc.lang._XTypeProvider
+* @see ifc.ui._XExecutableDialog
+* @see ifc.ui._XFilePickerControlAccess
+* @see ifc.ui._XFilterManager
+* @see ifc.lang._XComponent
+* @see ifc.ui._XFilePickerNotifier
+*/
+public class FilePicker extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ui.FilePicker</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XInitialization.args'</code> for
+ * {@link ifc.lang._XInitialization} : argument
+ * for creating dialog from teamplate. </li>
+ * <li> <code>'XFilePickerControlAccess.ControlID'</code> for
+ * {@link ifc.ui._XFilePickerControlAccess} : here
+ * it is identifier of check box.</li>
+ * <li> <code>'XFilePickerControlAccess.ControlValue'</code> for
+ * {@link ifc.ui._XFilePickerControlAccess} :
+ * The value for control to set (since the initial value
+ * of the control is empty) .</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+
+ Object[] iniArgs = new Object[] { new Short
+ (com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_READONLY_VERSION)};
+ short ctrlId =
+ com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_READONLY;
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ui.dialogs.FilePicker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XInitialization
+ tEnv.addObjRelation("XInitialization.args", iniArgs) ;
+
+ // adding relation for XFilePickerControlAccess
+ tEnv.addObjRelation("XFilePickerControlAccess.ControlID",
+ new Short(ctrlId)) ;
+ tEnv.addObjRelation("XFilePickerControlAccess.ControlValue",
+ Boolean.FALSE) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java b/qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java
new file mode 100644
index 000000000000..7ba8bee180dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ftransl;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.datatransfer.DataFormatTranslator</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::datatransfer::XDataFormatTranslator</code></li>
+ * <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.datatransfer.XDataFormatTranslator
+ * @see com.sun.star.lang.XTypeProvider
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.datatransfer._XDataFormatTranslator
+ * @see ifc.lang._XTypeProvider
+ */
+public class DataFormatTranslator extends TestCase {
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.datatransfer.DataFormatTranslator</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.datatransfer.DataFormatTranslator" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("DataFormatTranslator Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+ log.println( "creating a new environment for DataFormatTranslator object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class DataFormatTranslator
+
diff --git a/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java b/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java
new file mode 100755
index 000000000000..db2a50b0e622
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ControlMenuController.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+
+/**
+ */
+public class ControlMenuController extends TestCase {
+ XInterface oObj = null;
+ XTextDocument xTextDoc;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ *
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Create test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ControlMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'ControlMenuController'", e);
+ }
+
+
+/* log.println("Creating instance...");
+
+ xTextDoc = WriterTools.createTextDoc(xMSF);
+
+/* XText xText = xTextDoc.getText();
+ XTextCursor xTextCursor = xText.createTextCursor();
+
+ for (int i = 0; i < 11; i++) {
+ xText.insertString(xTextCursor, "A sample text and why not? ", false);
+ }
+
+ XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ // the supplier is available from the model
+ XUIConfigurationManagerSupplier xSupplier =
+ (XUIConfigurationManagerSupplier)UnoRuntime.queryInterface(
+ XUIConfigurationManagerSupplier.class, xModel);
+
+ xManager = xSupplier.getUIConfigurationManager();
+
+ // just to make sure, it's the right one.
+ log.println("TestObject: " + util.utils.getImplName(xManager));
+ tEnv = new TestEnvironment(xManager); */
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java
new file mode 100644
index 000000000000..c0ce8bd1fe80
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/Desktop.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.frame.Desktop</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::beans::XPropertySet</code></li>
+* <li><code>com::sun::star::frame::XComponentLoader</code></li>
+* <li><code>com::sun::star::frame::XDesktop</code></li>
+* <li><code>com::sun::star::frame::XDispatchProvider</code></li>
+* <li><code>com::sun::star::frame::XFrame</code></li>
+* <li><code>com::sun::star::frame::XFramesSupplier</code></li>
+* <li><code>com::sun::star::frame::XTasksSupplier</code></li>
+* <li><code>com::sun::star::lang::XComponent</code></li>
+* <li><code>com::sun::star::task::XStatusIndicatorFactory</code></li>
+* </ul><p>
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.frame.XComponentLoader
+* @see com.sun.star.frame.XDesktop
+* @see com.sun.star.frame.XDispatchProvider
+* @see com.sun.star.frame.XFrame
+* @see com.sun.star.frame.XFramesSupplier
+* @see com.sun.star.frame.XTasksSupplier
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.task.XStatusIndicatorFactory
+* @see ifc.beans._XPropertySet
+* @see ifc.frame._XComponentLoader
+* @see ifc.frame._XDesktop
+* @see ifc.frame._XDispatchProvider
+* @see ifc.frame._XFrame
+* @see ifc.frame._XFramesSupplier
+* @see ifc.frame._XTasksSupplier
+* @see ifc.lang._XComponent
+* @see ifc.task._XStatusIndicatorFactory
+*/
+public class Desktop extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ try {
+ xTextDoc.dispose();
+ } catch (com.sun.star.lang.DisposedException de) {}
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.frame.Desktop</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.Desktop");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchProvider.URL", ".uno:Open");
+
+ tEnv.addObjRelation("Desktop",(XDesktop)
+ UnoRuntime.queryInterface(XDesktop.class,oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java
new file mode 100644
index 000000000000..f552f185cda6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XModel;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.DispatchStatement;
+import com.sun.star.frame.XDispatchRecorder;
+import com.sun.star.frame.XDispatchRecorderSupplier;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.util.URL;
+import util.utils;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::container::XElementAccess</code></li>
+* <li><code>com::sun::star::container::XIndexAccess</code></li>
+* <li><code>com::sun::star::container::XIndexReplace</code></li>
+* <li><code>com::sun::star::frame::XDispatchRecorder</code></li>
+* </ul><p>
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XIndexReplace
+* @see com.sun.star.frame.XDispatchRecorder
+* @see ifc.container._XElementAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XIndexReplace
+* @see ifc.frame._XDispatchRecorder
+*/
+public class DispatchRecorder extends TestCase {
+ XComponent oDoc = null;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.frame.Desktop</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ XFrame xFrame = null;
+ XDispatchRecorder xDR = null;
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
+ oDoc = SOF.createTextDoc(null);
+ try {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
+ xFrame = model.getCurrentController().getFrame();
+
+ XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xFrame);
+ XDispatchRecorderSupplier xDRS = null;
+ xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
+ new Type(XDispatchRecorderSupplier.class),
+ xFramePS.getPropertyValue("DispatchRecorderSupplier"));
+ if (xDRS == null) {
+
+ Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.DispatchRecorderSupplier");
+ xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
+ xDRS = (XDispatchRecorderSupplier)
+ UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
+ }
+
+ xDR = xDRS.getDispatchRecorder();
+ if (xDR != null) {
+ oObj = xDR;
+ } else {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.DispatchRecorder");
+ xDR = (XDispatchRecorder) UnoRuntime.queryInterface
+ (XDispatchRecorder.class, oObj);
+ xDRS.setDispatchRecorder(xDR);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create component", e);
+ }
+
+
+ // fill recorder with content. It's needed for XIndexReplace
+ URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "Text";
+ prop.Value = "XDispatchRecorder.recordDispatch()";
+ PropertyValue[] dispArgs = new PropertyValue[] {prop};
+ xDR.recordDispatch(dispURL, dispArgs);
+
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // INSTANCEn : _XIndexReplace
+ log.println("adding INSTANCEn as obj relation to environment");
+
+ int THRCNT = 1;
+ if (Param.get("THRCNT")!= null) {
+ THRCNT = Integer.parseInt((String) Param.get("THRCNT"));
+ }
+
+ URL instanceURL = null;
+ DispatchStatement instance = new DispatchStatement();
+ PropertyValue dispProp = new PropertyValue();
+
+ for (int n = 1; n < (THRCNT + 1); n++) {
+ log.println("adding INSTANCE" + n +
+ " as obj relation to environment");
+ instanceURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertText");
+ dispProp.Name = "Text";
+ dispProp.Value = "Instance " + n;
+ dispArgs = new PropertyValue[] {dispProp};
+ instance.aCommand = instanceURL.Complete;
+ instance.aArgs = dispArgs;
+ instance.aTarget = "_top";
+ instance.nFlags = com.sun.star.frame.FrameSearchFlag.ALL;
+
+ tEnv.addObjRelation("INSTANCE" + n, instance);
+ }
+
+ tEnv.addObjRelation("XDispatchRecorder.Frame", xFrame);
+ log.println("Object created: TRUE");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(oDoc);
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java
new file mode 100644
index 000000000000..50323a5b055e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::frame::XDispatchRecorderSupplier</code></li>
+* </ul><p>
+* @see com.sun.star.frame.XDispatchRecorderSupplier
+* @see ifc.frame._XDispatchRecorderSupplier
+*/
+public class DispatchRecorderSupplier extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates instance of
+ * <code>com.sun.star.comp.framework.DispatchRecorderSupplier</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.DispatchRecorderSupplier");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java
new file mode 100644
index 000000000000..59e760bad0b2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.document.DocumentInfo</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::beans::XFastPropertySet</code></li>
+* <li><code>com::sun::star::beans::XPropertySet</code></li>
+* <li><code>com::sun::star::document::XDocumentInfo</code></li>
+* <li><code>com::sun::star::document::XStandaloneDocumentInfo</code></li>
+* <li><code>com::sun::star::lang::XComponent</code></li>
+* </ul><p>
+* @see com.sun.star.beans.XFastPropertySet
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.document.XDocumentInfo
+* @see com.sun.star.document.XStandaloneDocumentInfo
+* @see com.sun.star.lang.XComponent
+* @see ifc.beans._XFastPropertySet
+* @see ifc.beans._XPropertySet
+* @see ifc.document._XDocumentInfo
+* @see ifc.document._XStandaloneDocumentInfo
+* @see ifc.lang._XComponent
+*/
+public class DocumentProperties extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Obtains the property <code>'DocumentInfo'</code> of the created document.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XDocumentInfoSupplier xdis = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc);
+ //oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, docInfo);
+ oObj = xdis.getDocumentInfo();
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/FontMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontMenuController.java
new file mode 100755
index 000000000000..da86e8276b18
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/FontMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class FontMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'FontMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java b/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java
new file mode 100755
index 000000000000..a27f0d60ec63
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/FontSizeMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class FontSizeMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FontSizeMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'FontSizeMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java b/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java
new file mode 100755
index 000000000000..c84a6c1f8f4b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/FooterMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class FooterMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FooterMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'FooterMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java b/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java
new file mode 100755
index 000000000000..bce5015156e1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/FormatMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class FormatMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.FormatMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'FormatMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java
new file mode 100644
index 000000000000..6e9b3d8ad780
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/Frame.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::frame::XDispatchProvider</code></li>
+* <li><code>com::sun::star::frame::XFrame</code></li>
+* <li><code>com::sun::star::frame::XFramesSupplier</code></li>
+* <li><code>com::sun::star::task::XStatusIndicatorFactory</code></li>
+* <li><code>com::sun::star::lang::XComponent</code></li>
+* </ul><p>
+* @see com.sun.star.frame.XDispatchProvider
+* @see com.sun.star.frame.XFrame
+* @see com.sun.star.frame.XFramesSupplier
+* @see com.sun.star.task.XStatusIndicatorFactory
+* @see com.sun.star.lang.XComponent
+* @see ifc.frame._XDispatchProvider
+* @see ifc.frame._XFrame
+* @see ifc.frame._XFramesSupplier
+* @see ifc.task._XStatusIndicatorFactory
+* @see ifc.lang._XComponent
+*/
+public class Frame extends TestCase {
+
+ XTextDocument xTextDoc;
+ XFrame frame = null;
+
+
+ /**
+ * Creates a text document and obtains a frame of current controller.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ frame = xTextDoc.getCurrentController().getFrame();
+ oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, frame);
+
+ log.println(util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ ".uno:SwitchControlDesignMode");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+ /**
+ * Disposes the document created and finally disposes
+ * the frame containing the document (for case when the frame
+ * contains no model after some interafce manipulations).
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ try {
+ XCloseable xTextClose = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
+ xTextClose.close(true);
+ } catch(Exception e){}
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java b/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java
new file mode 100755
index 000000000000..d4baffdc4500
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/HeaderMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class HeaderMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.HeaderMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'HeaderMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java
new file mode 100644
index 000000000000..2f16d9922295
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java
@@ -0,0 +1,317 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XHierarchicalNameAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.container.XNameReplace;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.lang.XTypeProvider;
+import com.sun.star.task.XJob;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XChangesBatch;
+import com.sun.star.uno.AnyConverter;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::task::XJobExecutor</code></li>
+ * </ul><p>
+ * The following files are needed for testcase creation :
+ * <ul>
+ * <li> <code>qadevlibs/JobExecutor.jar</code> :
+ * this is java component <code>test.Job</code> which
+ * should be registered before or during this testcase
+ * creation. This component must implement
+ * <code>com.sun.star.task.XJob</code> interface and count
+ * <code>execute</code> method calls. It also should
+ * implement <code>container.XNamed</code> interface and
+ * <code>getName</code> method must return string with number
+ * of calls.</li>
+ * <ul> <p>
+ *
+ * Also <b>important prerequicity</b>: if Job and Event is not yet
+ * added to configuration or <code>test.Job</code> component is
+ * not yet registered, the SOffice <b>must be destroyed</b> during
+ * testcase initialization. <p>
+ *
+ * @see com.sun.star.task.XJobExecutor
+ * @see ifc.task._XJobExecutor
+ */
+public class JobExecutor extends TestCase {
+
+ static Job job = new Job();
+ XNamed xNamed = null;
+ Object oRootCfg = null;
+
+ /**
+ * For testcase initializing :
+ * <ol>
+ * <li> Implementation <code>test.Job</code> must be registered in
+ * SOffice registry. </li>
+ * <li> Configuration in package <code>org.OpenOffice.Office.Jobs</code>
+ * must be updated. <code>TestJob</code> must be registered for
+ * service <code>test.Job</code> and event for this job named
+ * <code>TextEvent</code> must be registered. </li>
+ * </ol>. <p>
+ *
+ * First these two conditions are checked. If job and event are not
+ * registered they are inserted into configuration and commited.
+ * After what SOffice must be destroyed for proper initialization
+ * of <code>JobExecutor</code> after startup. <p>
+ *
+ * Then if the implementation was not registered before it is
+ * registered in soffice <code>applicat.rbd</code> file (registering
+ * the component in currently running Java environment has no effect
+ * for <code>JobExecutor</code> in some reasons). <p>
+ *
+ * Note: SOffice is started again while the next
+ * <code>(XMultiServiceFactory)SOLink.getMSF()</code> call.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ boolean serviceRegistered = false;
+ boolean configured = false;
+
+ try {
+ Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job");
+ serviceRegistered = obj != null;
+ } catch(com.sun.star.uno.Exception e) {}
+
+ log.println("Service test.Job is "
+ + (serviceRegistered ? "already" : "not yet") + " registered.");
+ if (! serviceRegistered){
+ String message = "You have to register 'test.Job' before office is stared.\n";
+ message += "Please run '$OFFICEPATH/program/pkgchk $DOCPTH/qadevlibs/JobExecutor.jar'";
+ throw new StatusException(message, new Exception());
+ }
+
+
+ XNameAccess jobs = null;
+ XNameAccess events = null;
+ try {
+ Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.configuration.ConfigurationProvider");
+ XMultiServiceFactory xConfigMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, obj);
+ PropertyValue[] args = new PropertyValue[1];
+ args[0] = new PropertyValue();
+ args[0].Name = "nodepath";
+ args[0].Value = "org.openoffice.Office.Jobs";
+ oRootCfg = xConfigMSF.createInstanceWithArguments(
+ "com.sun.star.configuration.ConfigurationUpdateAccess", args);
+ XHierarchicalNameAccess xHNA = (XHierarchicalNameAccess)
+ UnoRuntime.queryInterface(XHierarchicalNameAccess.class, oRootCfg);
+ obj = xHNA.getByHierarchicalName("Jobs");
+ jobs = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, obj);
+ obj = xHNA.getByHierarchicalName("Events");
+ events = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, obj);
+ } catch (Exception e) {
+ throw new StatusException("Couldn't get configuration", e);
+ }
+
+ configured = jobs.hasByName("TestJob") && events.hasByName("TestEvent");
+
+ log.println("Test job and event is "
+ + (configured ? "already" : "not yet") + " configured.");
+
+ if (!configured) {
+ try {
+ log.println("Adding configuration to Jobs ...");
+ XSingleServiceFactory jobsFac = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, jobs);
+ Object oNewJob = jobsFac.createInstance();
+ XNameReplace xNewJobNR = (XNameReplace)
+ UnoRuntime.queryInterface(XNameReplace.class, oNewJob);
+ xNewJobNR.replaceByName("Service", "test.Job");
+ XNameContainer xJobsNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, jobs);
+ xJobsNC.insertByName("TestJob", oNewJob);
+
+ log.println("Adding configuration to Events ...");
+ XSingleServiceFactory eventsFac = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, events);
+ Object oNewEvent = eventsFac.createInstance();
+
+ XNameAccess xNewEventNA = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oNewEvent);
+ Object oJobList = xNewEventNA.getByName("JobList");
+ XSingleServiceFactory jobListFac = (XSingleServiceFactory)
+ AnyConverter.toObject(new Type(XSingleServiceFactory.class),
+ oJobList);
+ XNameContainer jobListNC = (XNameContainer)
+ AnyConverter.toObject(new Type(XNameContainer.class),
+ oJobList);
+ log.println("\tAdding TimeStamps to Events ...");
+ Object oNewJobTimeStamps = jobListFac.createInstance();
+
+ jobListNC.insertByName("TestJob", oNewJobTimeStamps);
+
+
+ XNameContainer xEventsNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, events);
+ xEventsNC.insertByName("TestEvent", oNewEvent);
+
+ XChangesBatch xCB = (XChangesBatch)
+ UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg);
+ xCB.commitChanges();
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {}
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change config", e);
+ }
+ }
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ *
+ * Service <code>com.sun.star.comp.framework.JobExecutor</code>
+ * is created.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ Object job = null;
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.JobExecutor");
+ job = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, job);
+ log.println("Count = " + xNamed.getName());
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("CallCounter", xNamed);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ }
+}
+
+/**
+ * Currently not used.
+ */
+class Job implements
+ XServiceInfo, XSingleServiceFactory {
+
+ private static class Impl implements XServiceInfo, XTypeProvider, XJob, XNamed {
+ int callCount = 0;
+
+ public byte[] getImplementationId() {
+ return toString().getBytes();
+ }
+
+ public Type[] getTypes() {
+ Class interfaces[] = getClass().getInterfaces();
+ Type types[] = new Type[interfaces.length];
+ for(int i = 0; i < interfaces.length; ++ i)
+ types[i] = new Type(interfaces[i]);
+ return types;
+ }
+
+ public Object execute(NamedValue[] param) {
+ callCount++;
+
+ return null;
+ }
+
+ public String getName() {
+ return String.valueOf(callCount);
+ }
+
+ public void setName(String n) {}
+
+ public boolean supportsService(String name) {
+ return __serviceName.equals(name);
+ }
+
+ public String[] getSupportedServiceNames() {
+ return new String[] {__serviceName};
+ }
+
+ public String getImplementationName() {
+ return getClass().getName();
+ }
+ }
+
+ public static final String __serviceName = "test.Job";
+ static Impl impl = new Impl();
+
+ public Object createInstanceWithArguments(Object[] args) {
+ return impl;
+ }
+
+ public Object createInstance() {
+ return createInstanceWithArguments(null);
+ }
+
+ public boolean supportsService(String name) {
+ return __serviceName.equals(name);
+ }
+
+ public String[] getSupportedServiceNames() {
+ return new String[] {__serviceName};
+ }
+
+ public String getImplementationName() {
+ return getClass().getName();
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/JobHandler.java b/qadevOOo/tests/java/mod/_fwk/JobHandler.java
new file mode 100644
index 000000000000..abfaf198f64e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/JobHandler.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::frame::XDispatchProvider</code></li>
+* <li><code>com::sun::star::lang::XInitialization</code></li>
+* </ul><p>
+* @see com.sun.star.frame.XDispatchProvider
+* @see com.sun.star.lang.XInitialization
+* @see ifc.frame._XDispatchProvider
+* @see ifc.lang._XInitialization
+*/
+public class JobHandler extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+ boolean serviceRegistered = false;
+
+ try {
+ Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance("test.Job");
+ serviceRegistered = obj != null;
+ } catch(com.sun.star.uno.Exception e) {}
+
+ log.println("Service test.Job is "
+ + (serviceRegistered ? "already" : "not yet") + " registered.");
+ if (! serviceRegistered){
+ String message = "You have to register 'test.Job' before office is stared.\n";
+ message += "Please run '$OFFICEPATH/program/pkgchk $DOCPTH/qadevlibs/JobExecutor.jar'";
+ throw new StatusException(message, new Exception());
+ }
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.jobs.JobDispatch");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchProvider.URL", "vnd.sun.star.job:alias=TestJob");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java
new file mode 100755
index 000000000000..6ba1b97fce76
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.util.XCloseable;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.WriterTools;
+
+/**
+ */
+public class LayoutManager extends TestCase {
+ XInterface xManager = null;
+ XTextDocument xTextDoc;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Create test environment:
+ * <ul>
+ * <li>Create test doc</li>
+ * <li>Get the frame</li>
+ * <li>Get the LayoutManager from the frame</li>
+ * </ul>
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ log.println("Creating instance...");
+
+ xTextDoc = WriterTools.createTextDoc(xMSF);
+
+ XText xText = xTextDoc.getText();
+ XTextCursor xTextCursor = xText.createTextCursor();
+
+ for (int i = 0; i < 11; i++) {
+ xText.insertString(xTextCursor, "A sample text and why not? ", false);
+ }
+
+ XFrame xFrame = xTextDoc.getCurrentController().getFrame();
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xFrame);
+ try {
+ Object any = xProp.getPropertyValue("LayoutManager");
+ xManager = (XInterface)UnoRuntime.queryInterface(XInterface.class, any);
+ }
+ catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not get property 'LayoutManager' from the current frame.", e);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not get property 'LayoutManager' from the current frame.", e);
+ }
+
+ // just to make sure, it's the right one.
+ log.println("TestObject: " + util.utils.getImplName(xManager));
+ tEnv = new TestEnvironment(xManager);
+
+ tEnv.addObjRelation("XLayoutManager.TextDoc", xTextDoc);
+ tEnv.addObjRelation("XLayoutManager.Frame",xFrame);
+
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java b/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java
new file mode 100755
index 000000000000..22f3fcb269e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/MacrosMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ *
+ */
+public class MacrosMenuController extends TestCase{
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.MacrosMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'MacrosMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java
new file mode 100644
index 000000000000..fc5e84c0532d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::lang::XInitialization</code></li>
+* <li><code>com::sun::star::frame::XDispatchProvider</code></li>
+* </ul><p>
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.frame.XDispatchProvider
+* @see ifc.lang._XInitialization
+* @see ifc.frame._XDispatchProvider
+*/
+public class MailToDispatcher extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.framework.MailToDispatcher</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.MailToDispatcher");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "mailto:soffice@sparc.spb.su");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java b/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java
new file mode 100755
index 000000000000..d8ca9a58a85d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/MenuBarFactory.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ */
+public class MenuBarFactory extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.MenuBarFactory");
+
+ tEnv = new TestEnvironment(oObj);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Cannot create test object 'MenuBarFactory'", e);
+ }
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java
new file mode 100755
index 000000000000..026faf8c1012
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import lib.*;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.text.XTextDocument;
+
+/** Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::frame::XModuleManager</code></li>
+ * <li><code>com::sun::star::container::XNameAccess</code></li>
+ * <li><code>com::sun::star::container::XElementAccess</code></li>
+ * </ul><p>
+ * @see com.sun.star.frame.XModuleManager
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.frame._XModuleManager
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ */
+public class ModuleManager extends TestCase {
+
+ XTextDocument xTextDoc = null;
+ XComponent xWebDoc = null;
+ XComponent xGlobalDoc = null;
+ XSpreadsheetDocument xSheetDoc = null;
+ XComponent xDrawDoc = null;
+ XComponent xImpressDoc = null;
+ XComponent xMathDoc = null;
+
+ /** Creating a Testenvironment for the interfaces to be tested.
+ * @param Param test parameters
+ * @param log simple logger
+ * @throws StatusException was thrwon on error
+ * @return the test environement
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.ModuleManager");
+ } catch(Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ // get text document interfaces
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xTextMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+ XController xTextController = xTextMode1.getCurrentController();
+ XFrame xTextFrame = xTextController.getFrame();
+
+
+ // get webdoc interfaces
+ try {
+ log.println("creating a web document");
+ xWebDoc = SOF.loadDocument("private:factory/swriter/web");
+
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xWebMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xWebDoc);
+ XController xWebController = xWebMode1.getCurrentController();
+ XFrame xWebFrame = xWebController.getFrame();
+
+ // get global document interfaces
+ try {
+ log.println("creating a global document");
+ xGlobalDoc = SOF.loadDocument("private:factory/swriter/GlobalDocument");
+
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xGlobalMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xGlobalDoc);
+ XController xGlobalController = xGlobalMode1.getCurrentController();
+ XFrame xGlobalFrame = xGlobalController.getFrame();
+
+ // get clac interfaces
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xSheetMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xSheetDoc);
+
+ XController xSheetController = xSheetMode1.getCurrentController();
+ XFrame xSheetFrame = xSheetController.getFrame();
+ // get draw interfaces
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xDrawMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xDrawDoc);
+ XController xDrawController = xDrawMode1.getCurrentController();
+ XFrame xDrawFrame = xDrawController.getFrame();
+
+ // get impress interfaces
+ try {
+ log.println("creating a impress document");
+ xImpressDoc = SOF.createImpressDoc(null);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xImpressMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xImpressDoc);
+ XController xImpressController = xImpressMode1.getCurrentController();
+ XFrame xImpressFrame = xImpressController.getFrame();
+
+ // get math interfaces
+ try {
+ log.println("creating a math document");
+ xMathDoc = SOF.createMathDoc(null);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+ XModel xMathMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xMathDoc);
+ XController xMathController = xMathMode1.getCurrentController();
+ XFrame xMathFrame = xMathController.getFrame();
+
+ PropertyValue[] xFrameSeq = new PropertyValue[7];
+ xFrameSeq[0] = new PropertyValue();
+ xFrameSeq[0].Name = "com.sun.star.text.TextDocument";
+ xFrameSeq[0].Value = xTextFrame;
+ xFrameSeq[1] = new PropertyValue();
+ xFrameSeq[1].Name = "com.sun.star.text.WebDocument";
+ xFrameSeq[1].Value = xWebFrame;
+ xFrameSeq[2] = new PropertyValue();
+ xFrameSeq[2].Name = "com.sun.star.text.GlobalDocument";
+ xFrameSeq[2].Value = xGlobalFrame;
+ xFrameSeq[3] = new PropertyValue();
+ xFrameSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument";
+ xFrameSeq[3].Value = xSheetFrame;
+ xFrameSeq[4] = new PropertyValue();
+ xFrameSeq[4].Name = "com.sun.star.drawing.DrawingDocument";
+ xFrameSeq[4].Value = xDrawFrame;
+ xFrameSeq[5] = new PropertyValue();
+ xFrameSeq[5].Name = "com.sun.star.formula.FormulaProperties";
+ xFrameSeq[5].Value = xMathFrame;
+ xFrameSeq[6] = new PropertyValue();
+ xFrameSeq[6].Name = "com.sun.star.presentation.PresentationDocument";
+ xFrameSeq[6].Value = xImpressFrame;
+
+ PropertyValue[] xControllerSeq = new PropertyValue[7];
+ xControllerSeq[0] = new PropertyValue();
+ xControllerSeq[0].Name = "com.sun.star.text.TextDocument";
+ xControllerSeq[0].Value = xTextController;
+ xControllerSeq[1] = new PropertyValue();
+ xControllerSeq[1].Name = "com.sun.star.text.WebDocument";
+ xControllerSeq[1].Value = xWebController;
+ xControllerSeq[2] = new PropertyValue();
+ xControllerSeq[2].Name = "com.sun.star.text.GlobalDocument";
+ xControllerSeq[2].Value = xGlobalController;
+ xControllerSeq[3] = new PropertyValue();
+ xControllerSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument";
+ xControllerSeq[3].Value = xSheetController;
+ xControllerSeq[4] = new PropertyValue();
+ xControllerSeq[4].Name = "com.sun.star.drawing.DrawingDocument";
+ xControllerSeq[4].Value = xDrawController;
+ xControllerSeq[5] = new PropertyValue();
+ xControllerSeq[5].Name = "com.sun.star.formula.FormulaProperties";
+ xControllerSeq[5].Value = xMathController;
+ xControllerSeq[6] = new PropertyValue();
+ xControllerSeq[6].Name = "com.sun.star.presentation.PresentationDocument";
+ xControllerSeq[6].Value = xImpressController;
+
+ PropertyValue[] xModelSeq = new PropertyValue[7];
+ xModelSeq[0] = new PropertyValue();
+ xModelSeq[0].Name = "com.sun.star.text.TextDocument";
+ xModelSeq[0].Value = xTextMode1;
+ xModelSeq[1] = new PropertyValue();
+ xModelSeq[1].Name = "com.sun.star.text.WebDocument";
+ xModelSeq[1].Value = xWebMode1;
+ xModelSeq[2] = new PropertyValue();
+ xModelSeq[2].Name = "com.sun.star.text.GlobalDocument";
+ xModelSeq[2].Value = xGlobalMode1;
+ xModelSeq[3] = new PropertyValue();
+ xModelSeq[3].Name = "com.sun.star.sheet.SpreadsheetDocument";
+ xModelSeq[3].Value = xSheetMode1;
+ xModelSeq[4] = new PropertyValue();
+ xModelSeq[4].Name = "com.sun.star.drawing.DrawingDocument";
+ xModelSeq[4].Value = xDrawMode1;
+ xModelSeq[5] = new PropertyValue();
+ xModelSeq[5].Name = "com.sun.star.presentation.PresentationDocument";
+ xModelSeq[5].Value = xImpressMode1;
+ xModelSeq[6] = new PropertyValue();
+ xModelSeq[6].Name = "com.sun.star.formula.FormulaProperties";
+ xModelSeq[6].Value = xMathMode1;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ tEnv.addObjRelation("XModuleManager.XFrame", xFrameSeq);
+ tEnv.addObjRelation("XModuleManager.XController", xControllerSeq);
+ tEnv.addObjRelation("XModuleManager.XModel", xModelSeq);
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /** Disposes text document.
+ * @param tParam test parameters
+ * @param log simple logger
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " closing all documents " );
+ DesktopTools.closeDoc(xTextDoc);
+ DesktopTools.closeDoc(xWebDoc);
+ DesktopTools.closeDoc(xGlobalDoc);
+ DesktopTools.closeDoc(xSheetDoc);
+ DesktopTools.closeDoc(xDrawDoc);
+ DesktopTools.closeDoc(xImpressDoc);
+ DesktopTools.closeDoc(xMathDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java
new file mode 100755
index 000000000000..4f4f950e0ed6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.embed.ElementModes;
+import com.sun.star.embed.XStorage;
+import com.sun.star.embed.XTransactedObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.ui.XModuleUIConfigurationManagerSupplier;
+import ifc.ui._XUIConfiguration;
+import java.io.PrintWriter;
+import com.sun.star.lang.EventObject;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.util.XCloseable;
+import com.sun.star.ui.ConfigurationEvent;
+import com.sun.star.ui.XUIConfigurationManager;
+import ifc.ui._XUIConfigurationManager;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.WriterTools;
+import util.utils;
+
+/**
+ */
+public class ModuleUIConfigurationManager extends TestCase {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = null;
+ XTextDocument xTextDoc = null;
+ XStorage xStore = null;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ if (xTextDoc != null) {
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+ log.println(" disposing storage");
+ if (xStore != null) {
+ xStore.dispose();
+ }
+ }
+
+ /**
+ * Create environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+
+ try {
+ xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ log.println("Creating instance...");
+ xTextDoc = WriterTools.createTextDoc(xMSF);
+
+ Object o = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier");
+ XModuleUIConfigurationManagerSupplier xMUICMS = (XModuleUIConfigurationManagerSupplier)
+ UnoRuntime.queryInterface(XModuleUIConfigurationManagerSupplier.class, o);
+
+ util.dbg.printInterfaces(xMUICMS);
+ oObj = xMUICMS.getUIConfigurationManager("com.sun.star.text.TextDocument");
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+
+ XNameAccess xMM = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, xMSF.createInstance("com.sun.star.comp.framework.ModuleManager"));
+ String[] names = xMM.getElementNames();
+
+ o = xMSF.createInstance("com.sun.star.embed.StorageFactory");
+ XSingleServiceFactory xStorageService = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, o);
+ Object[]props = new Object[2];
+
+ String aFile = util.utils.getOfficeTempDir(xMSF) + "dummyFile.dat";
+ log.println("storage file : '"+ aFile + "'");
+
+ props[0] = aFile;
+ props[1] = new Integer(ElementModes.READWRITE);
+ xStore = (XStorage)UnoRuntime.queryInterface(XStorage.class, xStorageService.createInstanceWithArguments(props));
+
+ PropertyValue[] initProps = new PropertyValue[4];
+ PropertyValue propVal = new PropertyValue();
+ propVal.Name = "DefaultConfigStorage";
+ propVal.Value = xStore;
+ initProps[0] = propVal;
+ propVal = new PropertyValue();
+ propVal.Name = "UserConfigStorage";
+ propVal.Value = xStore;
+ initProps[1] = propVal;
+ propVal = new PropertyValue();
+ propVal.Name = "ModuleIdentifier";
+ propVal.Value = "swriter";
+ initProps[2] = propVal;
+ propVal = new PropertyValue();
+ propVal.Name = "UserRootCommit";
+ propVal.Value = (XTransactedObject)UnoRuntime.queryInterface(XTransactedObject.class, xStore);
+ initProps[3] = propVal;
+
+
+ tEnv.addObjRelation("XInitialization.args", initProps);
+
+ // the short cut manager service name
+ // 2do: correct the service name when it's no longer in
+ tEnv.addObjRelation("XConfigurationManager.ShortCutManager",
+ "com.sun.star.ui.ModuleAcceleratorConfiguration");
+
+ // the resourceURL
+ tEnv.addObjRelation("XModuleUIConfigurationManager.ResourceURL",
+ "private:resource/menubar/menubar");
+ tEnv.addObjRelation("XUIConfiguration.XUIConfigurationListenerImpl",
+ new ConfigurationListener(log,
+ (XUIConfigurationManager)UnoRuntime.queryInterface(
+ XUIConfigurationManager.class, oObj), xMSF));
+ tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName",
+ "com.sun.star.comp.framework.ModuleUIConfigurationManager");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Cannot create test object", e);
+ }
+ return tEnv;
+ }
+
+ /**
+ * An implementation of the _XUIConfiguration.XUIConfigurationListenerImpl
+ * interface to trigger the event for a listener call.
+ * @see ifc.ui._XUIConfiguration
+ */
+ public static class ConfigurationListener implements _XUIConfiguration.XUIConfigurationListenerImpl {
+ private boolean triggered = false;
+ private PrintWriter log = null;
+ private XUIConfigurationManager xUIManager = null;
+ private XMultiServiceFactory xMSF = null;
+
+ public ConfigurationListener(PrintWriter _log, XUIConfigurationManager xUIManager, XMultiServiceFactory xMSF) {
+ log = _log;
+ this.xUIManager = xUIManager;
+ this.xMSF = xMSF;
+ }
+ public void reset(){
+ triggered = false;
+ }
+ public void fireEvent() {
+ try {
+ XIndexAccess xMenuBarSettings = xUIManager.getSettings(
+ "private:resource/menubar/menubar", true);
+
+ PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
+ "Trigger Event", xMenuBarSettings, xMSF, log);
+ _XUIConfigurationManager.createMenuBarItem("Click for Macro",
+ (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer.class, prop[3].Value), log);
+ XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
+ x.insertByIndex(x.getCount(), prop);
+ xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
+ xUIManager.reset();
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalAccessException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ }
+ public boolean actionWasTriggered(){
+ return triggered;
+ }
+ public void disposing(EventObject e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.disposing the listener.");
+ }
+ public void elementInserted(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementInserted.");
+ }
+ public void elementRemoved(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementRemoved.");
+ }
+ public void elementReplaced(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementReplaced.");
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java
new file mode 100755
index 000000000000..9da4e7fa8d59
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ *
+ */
+public class ModuleUIConfigurationManagerSupplier extends TestCase{
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier");
+ tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigurationManager",
+ "com.sun.star.frame.StartModule");
+ tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName", "com.sun.star.comp.framework.ModuleUIConfigurationManager");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Cannot create test object", e);
+ }
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java
new file mode 100755
index 000000000000..2b1da80a87d5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.util.XCloseable;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class ObjectMenuController extends TestCase {
+ XInterface oObj = null;
+ XTextDocument xTextDoc;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Create test environment:
+ * <ul>
+ * <li>create a text doc</li>
+ * <li>get the model from the text doc</li>
+ * <li>query model for XUIConfigurationManagerSupplier interface</li>
+ * <li>get the manager from the supplier</li>
+ * </ul>
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ObjectMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'ControlMenuController'", e);
+ }
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java
new file mode 100755
index 000000000000..91ac2fbd8e70
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.XCloseable;
+import com.sun.star.frame.XUIControllerRegistration;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.WriterTools;
+
+/**
+ */
+public class PopupMenuControllerFactory extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+
+ /**
+ * Create test environment:
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface xInst = null;
+
+ log.println("Creating instance...");
+
+ xTextDoc = WriterTools.createTextDoc(xMSF);
+ util.dbg.printInterfaces(xTextDoc);
+
+ try {
+ xInst = (XInterface)xMSF.createInstance(
+ "com.sun.star.comp.framework.PopupMenuControllerFactory");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ log.println("TestObject: " + util.utils.getImplName(xInst));
+ tEnv = new TestEnvironment(xInst);
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ try {
+ Object o = xProp.getPropertyValue("DefaultContext");
+ XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o);
+ tEnv.addObjRelation("DC", xContext);
+ }
+ catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test.");
+ e.printStackTrace(log);
+ }
+
+ // register one controller, so it can be instantiated
+ XUIControllerRegistration xReg = (XUIControllerRegistration)
+ UnoRuntime.queryInterface(XUIControllerRegistration.class, xInst);
+
+ xReg.registerController(".uno:MyCommandUrl", "", "com.sun.star.comp.framework.FooterMenuController");
+ tEnv.addObjRelation("XUIControllerRegistration.RegisteredController", ".uno:MyCommandUrl");
+ tEnv.addObjRelation("XMultiComponentFactory.ServiceNames", new String[]{".uno:MyCommandUrl"});
+
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java
new file mode 100644
index 000000000000..9caa75de4d4f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::lang::XInitialization</code></li>
+* <li><code>com::sun::star::frame::XDispatchProvider</code></li>
+* </ul><p>
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.frame.XDispatchProvider
+* @see ifc.lang._XInitialization
+* @see ifc.frame._XDispatchProvider
+*/
+public class ServiceHandler extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.framework.ServiceHandler</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.ServiceHandler");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "service:com.sun.star.io.Pipe");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/SoundHandler.java b/qadevOOo/tests/java/mod/_fwk/SoundHandler.java
new file mode 100644
index 000000000000..d94c3d57a123
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/SoundHandler.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import util.utils;
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::frame::XDispatch</code></li>
+* <li><code>com::sun::star::frame::XNotifyingDispatch</code></li>
+* </ul><p>
+* @see com.sun.star.frame.XDispatch
+* @see com.sun.star.frame.XNotifyingDispatch
+* @see ifc.frame._XDispatch
+* @see ifc.frame._XNotifyingDispatch
+*/
+public class SoundHandler extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.frame.ContentHandler");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ URL dispURL = utils.parseURL((XMultiServiceFactory)Param.getMSF(),
+ utils.getFullTestURL("ok.wav"));
+ System.out.println("DISPATCHURL: "+ dispURL.Complete);
+
+ tEnv.addObjRelation("XDispatch.URL", dispURL);
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java
new file mode 100644
index 000000000000..a7d09a818331
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/StatusBarControllerFactory.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ */
+public class StatusBarControllerFactory extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.StatusBarControllerFactory");
+
+ tEnv = new TestEnvironment(oObj);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Cannot create test object 'StatusBarControllerFactory'", e);
+ }
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ try {
+ Object o = xProp.getPropertyValue("DefaultContext");
+ XComponentContext xContext = (XComponentContext)UnoRuntime.queryInterface(XComponentContext.class, o);
+ tEnv.addObjRelation("DC", xContext);
+ }
+ catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Cannot get the 'DefaultContext' for XMultiComponentFactory test.");
+ e.printStackTrace(log);
+ }
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java b/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java
new file mode 100644
index 000000000000..a27761f0389c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ToolBarsMenuController.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class ToolBarsMenuController extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ToolBarsMenuController");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'ToolBarsMenuController'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java b/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java
new file mode 100644
index 000000000000..2adf240b8db4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/UICategoryDescription.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class UICategoryDescription extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.UICategoryDescription");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'UICategoryDescription'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java b/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java
new file mode 100755
index 000000000000..7b506972e5f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/UICommandDescription.java
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ *
+ * @author sg128468
+ */
+public class UICommandDescription extends TestCase {
+ XInterface oObj = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.frame.UICommandDescription");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could not create object 'UICommandDescription'", e);
+ }
+
+ log.println("TestObject: " + utils.getImplName(oObj));
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java
new file mode 100755
index 000000000000..235e8a4be8ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.embed.ElementModes;
+import com.sun.star.embed.XStorage;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.ui._XUIConfiguration;
+import java.io.PrintWriter;
+import com.sun.star.lang.EventObject;
+import com.sun.star.ui.ConfigurationEvent;
+import com.sun.star.ui.UIElementType;
+import com.sun.star.ui.XUIConfigurationManager;
+import com.sun.star.ui.XUIConfigurationStorage;
+import ifc.ui._XUIConfigurationManager;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ */
+public class UIConfigurationManager extends TestCase {
+ XUIConfigurationManager xManager = null;
+
+
+ /**
+ * Create test environment:
+ * <ul>
+ * <li>create a text doc</li>
+ * <li>get the model from the text doc</li>
+ * <li>query model for XUIConfigurationManagerSupplier interface</li>
+ * <li>get the manager from the supplier</li>
+ * </ul>
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ log.println("Creating instance...");
+
+ try {
+ xManager = (XUIConfigurationManager)UnoRuntime.queryInterface(
+ XUIConfigurationManager.class, xMSF.createInstance(
+ "com.sun.star.comp.framework.UIConfigurationManager"));
+ }
+ catch(com.sun.star.uno.Exception e) {
+ }
+ // just to make sure, it's the right one.
+ log.println("TestObject: " + utils.getImplName(xManager));
+ tEnv = new TestEnvironment(xManager);
+
+ // create a configuration storage
+ try {
+ String sourceDeleteCfg = util.utils.getFullTestURL("delete.cfg");
+ String deleteCfg = util.utils.getFullURL(util.utils.getOfficeTemp(xMSF) + "delete.cfg");
+ util.utils.copyFile(xMSF, sourceDeleteCfg, deleteCfg);
+ XStorage xSubStorage = null;
+ Object o = (XInterface)xMSF.createInstance("com.sun.star.embed.StorageFactory");
+ XSingleServiceFactory xSSF = (XSingleServiceFactory)UnoRuntime.queryInterface(
+ XSingleServiceFactory.class, o);
+ Object[] props = new Object[2];
+ props[0] = deleteCfg;
+ props[1] = new Integer(ElementModes.READWRITE);
+ XStorage xRootStorage = (XStorage)UnoRuntime.queryInterface(XStorage.class, xSSF.createInstanceWithArguments(props));
+ xSubStorage = xRootStorage.openStorageElement("Configurations2", ElementModes.READWRITE);
+
+ XUIConfigurationStorage xConfigStorage =(XUIConfigurationStorage)UnoRuntime.queryInterface(XUIConfigurationStorage.class, xManager);
+ xConfigStorage.setStorage(xSubStorage);
+ tEnv.addObjRelation("XUIConfigurationStorage.Storage", xSubStorage);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ log.println("Could not create storage: " + e.toString());
+ }
+ util.dbg.printInterfaces(xManager);
+
+ tEnv.addObjRelation("XUIConfiguration.XUIConfigurationListenerImpl",
+ new ConfigurationListener(log, xManager, xMSF));
+
+ // the short cut manager service name
+ // 2do: correct the service name when it's no longer in
+ tEnv.addObjRelation("XConfigurationManager.ShortCutManager",
+ "com.sun.star.ui.DocumentAcceleratorConfiguration");
+ return tEnv;
+ }
+
+ /**
+ * An implementation of the _XUIConfiguration.XUIConfigurationListenerImpl
+ * interface to trigger the event for a listener call.
+ * @see ifc.ui._XUIConfiguration
+ */
+ public static class ConfigurationListener implements _XUIConfiguration.XUIConfigurationListenerImpl {
+ private boolean triggered = false;
+ private PrintWriter log = null;
+ private XUIConfigurationManager xUIManager = null;
+ private XMultiServiceFactory xMSF = null;
+ private static int iUniqueCounter;
+
+ public ConfigurationListener(PrintWriter _log, XUIConfigurationManager xUIManager, XMultiServiceFactory xMSF) {
+ log = _log;
+ this.xUIManager = xUIManager;
+ this.xMSF = xMSF;
+ iUniqueCounter = 0;
+ }
+ public void reset(){
+ triggered = false;
+ }
+ public void fireEvent() {
+ try {
+ if (iUniqueCounter == 0) {
+ iUniqueCounter++;
+ PropertyValue[][]props = xUIManager.getUIElementsInfo(UIElementType.UNKNOWN);
+ XIndexAccess xMenuBarSettings = xUIManager.getSettings(
+ "private:resource/menubar/menubar", true);
+
+ PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
+ "Trigger Event", xMenuBarSettings, xMSF, log);
+ _XUIConfigurationManager.createMenuBarItem("Click for Macro",
+ (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer.class, prop[3].Value), log);
+ XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
+ x.insertByIndex(x.getCount(), prop);
+ xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
+ xUIManager.reset();
+ }
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IllegalAccessException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
+ e.printStackTrace(log);
+ }
+ }
+ public boolean actionWasTriggered(){
+ return triggered;
+ }
+ public void disposing(EventObject e) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.disposing the listener.");
+ }
+ public void elementInserted(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementInserted.");
+ }
+ public void elementRemoved(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementRemoved.");
+ }
+ public void elementReplaced(ConfigurationEvent configEvent) {
+ triggered = true;
+ log.println("_XUIConfiguration.XUIConfigurationListenerImpl.elementReplaced.");
+ }
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java b/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java
new file mode 100755
index 000000000000..7c26c3b18b87
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.util.XCloseable;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.WriterTools;
+
+/**
+ */
+public class UIElementFactoryManager extends TestCase {
+ Object oObj = null;
+ XTextDocument xTextDoc;
+
+ /**
+ * Cleanup: close the created document
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * Create test environment:
+ * <ul>
+ * <li>create a text doc</li>
+ * <li>get the model from the text doc</li>
+ * <li>query model for XUIConfigurationManagerSupplier interface</li>
+ * <li>get the manager from the supplier</li>
+ * </ul>
+ * @param tParam The test parameters.
+ * @param The log writer.
+ * @return The test environment.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ log.println("Creating instance...");
+ xTextDoc = WriterTools.createTextDoc(xMSF);
+ try {
+ oObj = xMSF.createInstance("com.sun.star.ui.UIElementFactoryManager");
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Cannot create test object.", e);
+ }
+ log.println("TestObject: " + util.utils.getImplName(oObj));
+
+ tEnv = new TestEnvironment((XInterface)oObj);
+
+
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java
new file mode 100644
index 000000000000..f9984b93308e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that implements the following interfaces :
+* <ul>
+* <li><code>com::sun::star::util::XURLTransformer</code></li>
+* </ul><p>
+* @see com.sun.star.util.XURLTransformer
+* @see ifc.util._XURLTransformer
+*/
+public class URLTransformer extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.framework.URLTransformer");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't create instance"));
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java b/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java
new file mode 100644
index 000000000000..e50998ab1b26
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/ContentHandlerFactory.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.lang._XMultiServiceFactory
+ */
+public class ContentHandlerFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.frame.ContentHandlerFactory</code>. <p>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.frame.ContentHandlerFactory") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ContentHandlerFactory", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames());
+ String[] dummy = xNA.getElementNames();
+
+ // com.sun.star.container.XContainerQuery
+ NamedValue[] querySequenze = new NamedValue[1];
+ NamedValue query = new NamedValue();
+ query.Name = "Name";
+ query.Value = "com.sun.star.comp.framework.SoundHandler";
+ querySequenze[0] = query;
+
+ tEnv.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties",
+ querySequenze);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java
new file mode 100644
index 000000000000..f274282c45cb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.framework.FilterFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.lang._XMultiServiceFactory
+ */
+public class FilterFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.framework.FilterFactory</code>.
+ * Prepares relation for
+ * <code>XMultiServiceFactory.createInstanceWithArguments</code> method
+ * test. Only filters wich have their service names can be instantiated
+ * in some reasons (?). For instantiation used filter type as service
+ * name and its name as a parameter. <p>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.document.FilterFactory") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FilterFactory", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ String[] filterNames = xNA.getElementNames();
+
+ // XNameContainer; XNameReplace
+ String filterName = filterNames[0];
+ Object[] instance = null;;
+ PropertyValue instanceProp = new PropertyValue();
+ try{
+ instance = (Object[]) xNA.getByName(filterName);
+ PropertyValue[] props = (PropertyValue[]) instance;
+ instanceProp = (PropertyValue) getPropertyValue
+ (((PropertyValue[]) instance), "FilterService"); //instance[9];
+ } catch (com.sun.star.container.NoSuchElementException e){
+ throw new StatusException(
+ Status.failed("Couldn't get elements from object"));
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ throw new StatusException(
+ Status.failed("Couldn't get elements from object"));
+ }
+
+ log.println("adding INSTANCE 1 as obj relation to environment");
+
+ log.println("fill property 'TemplateName' with 'INSTANCE1'");
+ setPropertyValueValue((PropertyValue[])instance, "TemplateName", "INSTANCE1");
+ tEnv.addObjRelation("INSTANCE" +1, instance);
+
+
+ // XMSF
+ Vector vFTypes = new Vector();
+ Vector vFArgs = new Vector();
+ for (int i = 0; i < filterNames.length; i++) {
+ PropertyValue[] filterProps = null;
+ try {
+ System.out.println(filterNames[i]);
+ filterProps = (PropertyValue[])
+ xNA.getByName(filterNames[i]);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ throw new StatusException("Couldn't create relation", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ throw new StatusException("Couldn't create relation", e);
+ }
+ String filterImpl = (String) getPropertyValueValue
+ (filterProps, "FilterService");
+ if (filterImpl != null && filterImpl.length() > 0) {
+ String filterType = (String) getPropertyValueValue
+ (filterProps, "Type");
+ vFTypes.add(filterType);
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "FilterName";
+ prop.Value = filterNames[i];
+ vFArgs.add(new Object[] {prop});
+
+ log.println("Found filter '" + filterNames[i] + "', type: " +
+ filterType + ", service name: '" + filterImpl + "'");
+ }
+ }
+
+ tEnv.addObjRelation("XMSF.serviceNamesWithArgs",
+ vFTypes.toArray(new String[vFTypes.size()]));
+ tEnv.addObjRelation("XMSF.Args",
+ vFArgs.toArray(new Object[vFArgs.size()][]));
+
+ // com.sun.star.container.XContainerQuery
+ NamedValue[] querySequenze = new NamedValue[1];
+ NamedValue query = new NamedValue();
+ query.Name = "Name";
+ query.Value = "Rich Text Format";
+ querySequenze[0] = query;
+
+ tEnv.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties",
+ querySequenze);
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected Object getPropertyValueValue(PropertyValue[] props, String pName) {
+ int i = 0;
+ while (i < props.length && !props[i].Name.equals(pName)) {
+ i++;
+ }
+ return i < props.length ? props[i].Value : null;
+
+ }
+
+ protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue) {
+ int i = 0;
+ while (i < props.length && !props[i].Name.equals(pName)) {
+ i++;
+ }
+ props[i].Value = pValue;
+ }
+
+ protected PropertyValue getPropertyValue(PropertyValue[] props, String pName) {
+ int i = 0;
+ while (i < props.length && !props[i].Name.equals(pName)) {
+ i++;
+ }
+ return i < props.length ? props[i] : null;
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java
new file mode 100644
index 000000000000..dc83d96dd928
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.NamedValue;
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.lang._XMultiServiceFactory
+ */
+public class FrameLoaderFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.frame.FrameLoaderFactory") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FrameLoaderFactory", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames());
+
+ // com.sun.star.container.XContainerQuery
+ NamedValue[] querySequenze = new NamedValue[1];
+ NamedValue query = new NamedValue();
+ query.Name = "Name";
+ query.Value = "com.sun.star.frame.Bibliography";
+ querySequenze[0] = query;
+
+ tEnv.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties",
+ querySequenze);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/PathSettings.java b/qadevOOo/tests/java/mod/_fwl/PathSettings.java
new file mode 100644
index 000000000000..7bfe808b43f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/PathSettings.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.uno.UnoRuntime;
+import java.io.PrintWriter;
+import java.util.HashSet;
+import java.util.Set;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.framework.PathSettings</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::util::PathSettings</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.util.PathSettings
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XMultiPropertySet
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.util._PathSettings
+ * @see ifc.beans._XPropertySet
+ * @see ifc.beans._XMultiPropertySet
+ */
+public class PathSettings extends TestCase {
+
+ private static NamedValue[] m_Properties;
+ private static XPropertySet xPS;
+
+ /**
+ * restores the old values of the path settings
+ * @param tParam the test parameter
+ * @param log the log writer
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println("restore old values of path settings...");
+
+ for (int i=0; i < m_Properties.length; i++){
+ try{
+
+ xPS.setPropertyValue(m_Properties[i].Name, m_Properties[i].Value);
+
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ } catch (PropertyVetoException e){
+ } catch (IllegalArgumentException e){
+ } catch (WrappedTargetException e){
+ }
+ }
+ }
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.framework.PathSettings</code>.
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.comp.framework.PathSettings") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ Set exclProps = new HashSet();
+ exclProps.add("UIConfig");
+ tEnv.addObjRelation("XFastPropertySet.ExcludeProps", exclProps);
+ tEnv.addObjRelation("XMultiPropertySet.ExcludeProps", exclProps);
+
+ saveAllPropertyValues(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ private void saveAllPropertyValues(XInterface oObj){
+
+ xPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+
+ XPropertySetInfo xPSI = xPS.getPropertySetInfo();
+
+ Property[] allProperties = xPSI.getProperties();
+ m_Properties = new NamedValue[allProperties.length];
+
+ for (int i=0; i < allProperties.length; i++){
+ try{
+ m_Properties[i] = new NamedValue(allProperties[i].Name,
+ xPS.getPropertyValue(allProperties[i].Name));
+
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ } catch (WrappedTargetException e){
+ }
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/SubstituteVariables.java b/qadevOOo/tests/java/mod/_fwl/SubstituteVariables.java
new file mode 100644
index 000000000000..1cda9fdcbf1c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/SubstituteVariables.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.frame.FrameLoaderFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * </ul> <p>
+ *
+ * @see com::sun::star::util::XStringSubstitution
+ * @see ifc.util._XStringSubstitution
+ */
+public class SubstituteVariables extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.util.PathSubstitution</code>. <p>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.util.PathSubstitution") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SubstituteVariables", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java
new file mode 100644
index 000000000000..80d42dcd297f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.container.XNameAccess;
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XStorable;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import util.SOfficeFactory;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.document.TypeDetection</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XContainerQuery</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XNameContainer</code></li>
+ * <li> <code>com::sun::star::container::XNameReplace</code></li>
+ * <li> <code>com::sun::star::document::XTypeDetection</code></li>
+ * <li> <code>com::sun::star::util::XFlushable</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XContainerQuery
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XNameContainer
+ * @see com.sun.star.container.XNameReplace
+ * @see com.sun.star.document.XTypeDetection
+ * @see com.sun.star.util.XFlushable
+ * @see ifc.container._XContainerQuery
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XNameContainer
+ * @see ifc.container._XNameReplace
+ * @see ifc.document._XTypeDetection
+ * @see ifc.util.XFlushable
+ */
+public class TypeDetection extends TestCase {
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.document.TypeDetection</code>. <p>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.document.TypeDetection") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TypeDetection", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ log.println("ImplName: "+utils.getImplName(oObj));
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ String[] elementNames = xNA.getElementNames();
+ String elementName = elementNames[0];
+ Object[] instance = null;;
+ try{
+ instance = (Object[]) xNA.getByName(elementName);
+ } catch (com.sun.star.container.NoSuchElementException e){
+ throw new StatusException(
+ Status.failed("Couldn't get elements from object"));
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ throw new StatusException(
+ Status.failed("Couldn't get elements from object"));
+ }
+
+ log.println("adding INSTANCE 1 as obj relation to environment");
+
+ setPropertyValueValue((PropertyValue[])instance, "Preferred", "INSTANCE1");
+ tEnv.addObjRelation("INSTANCE" +1, instance);
+
+ // com.sun.star.container.XContainerQuery
+ NamedValue[] querySequenze = new NamedValue[1];
+ NamedValue query = new NamedValue();
+ query.Name = "Name";
+ query.Value = "writer_Text";
+ querySequenze[0] = query;
+
+
+ log.println("create text document with bookmarks");
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ String fileURL = null;
+ try {
+ xTextDoc = SOF.createTextDoc( null );
+ XInterface xBookMark = SOF.createBookmark( xTextDoc );
+ SOF.insertTextContent( xTextDoc, (XTextContent) xBookMark );
+
+ fileURL = utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF() );
+ fileURL = fileURL + "bookmarks.oot";
+
+ XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDoc);
+ System.out.println(fileURL);
+ store.storeToURL(fileURL, new PropertyValue[0]);
+
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create Bookmark", e );
+ }
+
+ tEnv.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties",
+ querySequenze);
+ tEnv.addObjRelation("XTypeDetection.bookmarkDoc", fileURL+"#bookmark");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+ protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue) {
+ int i = 0;
+ while (i < props.length && !props[i].Name.equals(pName)) {
+ i++;
+ }
+ props[i].Value = pValue;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java
new file mode 100644
index 000000000000..6ef935db601c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.lang.Locale;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.i18n.BreakIterator</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::i18n::XBreakIterator</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.i18n._XBreakIterator
+*/
+public class BreakIterator extends TestCase {
+
+ XComponent xTextDoc;
+
+ /**
+ * Loads a Text document with name 'Iterator.sxw' from test
+ * documents directory
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xTextDoc = SOF.loadDocument(utils.getFullTestURL("Iterator.sxw"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't load document", e );
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.BreakIterator</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.i18n.BreakIterator" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("Locale", new Locale("en", "US", ""));
+
+ XTextDocument xDoc = (XTextDocument)UnoRuntime.queryInterface
+ (XTextDocument.class, xTextDoc);
+ XTextRange xTextRange = (XTextRange)xDoc.getText();
+ tEnv.addObjRelation("UnicodeString", xTextRange.getString());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Disposes the Text document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+} // finish class BreakIterator
+
diff --git a/qadevOOo/tests/java/mod/_i18n/CalendarImpl.java b/qadevOOo/tests/java/mod/_i18n/CalendarImpl.java
new file mode 100644
index 000000000000..6ff2b549b76c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/CalendarImpl.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.i18n.Calendar</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::i18n::Calendar</code></li>
+* </ul>
+* @see ifc.i18n._Calendar
+*/
+public class CalendarImpl extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.Calendar</code>.
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.i18n.LocaleCalendar" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/ChapterCollator.java b/qadevOOo/tests/java/mod/_i18n/ChapterCollator.java
new file mode 100644
index 000000000000..0b22deed7a93
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/ChapterCollator.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.i18n.ChapterCollator</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::i18n::XCollator</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.i18n._XCollator
+* @see ifc.lang._XServiceInfo
+*/
+public class ChapterCollator extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.ChapterCollator</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.i18n.ChapterCollator" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/CharacterClassification.java b/qadevOOo/tests/java/mod/_i18n/CharacterClassification.java
new file mode 100644
index 000000000000..1044442ca56d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/CharacterClassification.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.i18n.CharacterClassification</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::i18n::XCharacterClassification</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.i18n.XCharacterClassification
+ * @see ifc.i18n._XCharacterClassification
+ */
+public class CharacterClassification extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.CharacterClassification</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.i18n.CharacterClassification" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("CharacterClassification Service not available" );
+ throw new StatusException
+ ( "CharacterClassification Service not available", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for CharacterClassification object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class CharacterClassification
+
diff --git a/qadevOOo/tests/java/mod/_i18n/Collator.java b/qadevOOo/tests/java/mod/_i18n/Collator.java
new file mode 100644
index 000000000000..a6d7b81ed063
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/Collator.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.i18n.Collator</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::i18n::XCollator</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.i18n._XCollator
+*/
+public class Collator extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.Collator</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.i18n.Collator" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java b/qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java
new file mode 100644
index 000000000000..c0299087ed8d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.i18n.IndexEntrySupplier</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::i18n::XIndexEntrySupplier</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.i18n.XIndexEntrySupplier
+ * @see ifc.i18n._XIndexEntrySupplier
+ */
+public class IndexEntrySupplier extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.IndexEntrySupplier</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.i18n.IndexEntrySupplier" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/LocaleData.java b/qadevOOo/tests/java/mod/_i18n/LocaleData.java
new file mode 100644
index 000000000000..935a534fbeb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/LocaleData.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.i18n.LocaleData</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::i18n::XLocaleData</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.i18n.XLocaleData
+ * @see ifc.i18n._XLocaleData
+ */
+public class LocaleData extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.LocaleData</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.i18n.LocaleData" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("LocaleData Service not available" );
+ throw new StatusException( "LocaleData Service not available", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for LocaleData object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class LocaleData
+
diff --git a/qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java b/qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java
new file mode 100644
index 000000000000..86a676380c7e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.i18n.NumberFormatCodeMapper</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::i18n::XNumberFormatCode</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.i18n.XNumberFormatCode
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.i18n._XNumberFormatCode
+ */
+public class NumberFormatCodeMapper extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.NumberFormatCodeMapper</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.i18n.NumberFormatCodeMapper" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("NumberFormatCodeMapper Service not available" );
+ throw new StatusException
+ ( "NumberFormatCodeMapper Service not available", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for NumberFormatCodeMapper object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class NumberFormatCodeMapper
+
diff --git a/qadevOOo/tests/java/mod/_i18n/TextSearch.java b/qadevOOo/tests/java/mod/_i18n/TextSearch.java
new file mode 100644
index 000000000000..20b678d4b155
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/TextSearch.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.util.TextSearch</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::util::XTextSearch</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.util._XTextSearch
+*/
+public class TextSearch extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.util.TextSearch</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.util.TextSearch" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/Transliteration.java b/qadevOOo/tests/java/mod/_i18n/Transliteration.java
new file mode 100644
index 000000000000..808311032e4c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/Transliteration.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.i18n.Transliteration</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::i18n::XTransliteration</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.i18n._XTransliteration
+*/
+public class Transliteration extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.i18n.Transliteration</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.i18n.Transliteration" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_implreg.uno/ImplementationRegistration.java b/qadevOOo/tests/java/mod/_implreg.uno/ImplementationRegistration.java
new file mode 100644
index 000000000000..0c85c74d1eab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_implreg.uno/ImplementationRegistration.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._implreg.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.registry.ImplementationRegistration</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::registry::XImplementationRegistration</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.registry.XImplementationRegistration
+* @see com.sun.star.registry.ImplementationRegistration
+* @see ifc.registry._XImplementationRegistration
+*/
+public class ImplementationRegistration extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service
+ * <code>com.sun.star.registry.ImplementationRegistration</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.registry.ImplementationRegistration" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ if (oInterface == null)
+ log.println("Service wasn't created") ;
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class NestedRegistry
+
diff --git a/qadevOOo/tests/java/mod/_implreg.uno/package.html b/qadevOOo/tests/java/mod/_implreg.uno/package.html
new file mode 100644
index 000000000000..0be74c09b1f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_implreg.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'impreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java b/qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java
new file mode 100644
index 000000000000..cc48e6e314c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._impreg;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.registry.ImplementationRegistration</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::registry::XImplementationRegistration</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.registry.XImplementationRegistration
+* @see com.sun.star.registry.ImplementationRegistration
+* @see ifc.registry._XImplementationRegistration
+*/
+public class ImplementationRegistration extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service
+ * <code>com.sun.star.registry.ImplementationRegistration</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.registry.ImplementationRegistration" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ if (oInterface == null)
+ log.println("Service wasn't created") ;
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class NestedRegistry
+
diff --git a/qadevOOo/tests/java/mod/_impreg/package.html b/qadevOOo/tests/java/mod/_impreg/package.html
new file mode 100644
index 000000000000..0be74c09b1f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_impreg/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'impreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_insp/Introspection.java b/qadevOOo/tests/java/mod/_insp/Introspection.java
new file mode 100644
index 000000000000..891d182df31d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_insp/Introspection.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._insp;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.beans.Introspection</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::beans::XIntrospection</code></li>
+* </ul>
+* This object test can be run in several
+* threads concurently.
+* @see com.sun.star.beans.XIntrospection
+* @see com.sun.star.beans.Introspection
+* @see ifc.beans._XIntrospection
+*/
+public class Introspection extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.comp.stoc.Introspection</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.Introspection" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class Introspection
+
diff --git a/qadevOOo/tests/java/mod/_insp/package.html b/qadevOOo/tests/java/mod/_insp/package.html
new file mode 100644
index 000000000000..13780f055979
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_insp/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'insp'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_introspection.uno/Introspection.java b/qadevOOo/tests/java/mod/_introspection.uno/Introspection.java
new file mode 100644
index 000000000000..ba4b9431df42
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_introspection.uno/Introspection.java
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._introspection.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.beans.Introspection</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::beans::XIntrospection</code></li>
+* </ul>
+* This object test can be run in several
+* threads concurently.
+* @see com.sun.star.beans.XIntrospection
+* @see com.sun.star.beans.Introspection
+* @see ifc.beans._XIntrospection
+*/
+public class Introspection extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.comp.stoc.Introspection</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.Introspection" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class Introspection
+
diff --git a/qadevOOo/tests/java/mod/_introspection.uno/package.html b/qadevOOo/tests/java/mod/_introspection.uno/package.html
new file mode 100644
index 000000000000..13780f055979
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_introspection.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'insp'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_inv/Invocation.java b/qadevOOo/tests/java/mod/_inv/Invocation.java
new file mode 100644
index 000000000000..98d5e91b4ea3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_inv/Invocation.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._inv;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.script.Invocation</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XSingleServiceFactory</code></li>
+* </ul>
+* @see com.sun.star.script.Invocation
+* @see com.sun.star.lang.XSingleServiceFactory
+* @see ifc.lang._XSingleServiceFactory
+*/
+public class Invocation extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.script.Invocation</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XSingleServiceFactory.createInstance.negative'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory} ;
+ * <code>String</code> relation; If its value 'true' then
+ * <code>createInstance</code> method for the object isn't
+ * supported. In this case object doesn't support this method.</li>
+ * <li> <code>'XSingleServiceFactory.arguments'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory} ;
+ * has <code>Object[]</code> type. This relation is used as
+ * a parameter for <code>createInstanceWithArguments</code>
+ * method call. If this relation doesn't exist test pass
+ * zerro length array as argument. Here
+ * <code>com.sun.star.io.Pipe</code> instance is passed.</li>
+ * <li> <code>'XSingleServiceFactory.MustSupport'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory}.
+ * Specifies that created instance must support
+ * <code>com.sun.star.script.XInvocation</code> interface.
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.script.Invocation");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ // the createInstance should fail according to the documentation
+ tEnv.addObjRelation(
+ "XSingleServiceFactory.createInstance.negative", "true");
+
+ // creating parameters to createInstanceWithArguments
+ Object[] args = new Object[1];
+
+ args[0] = xMSF.createInstance("com.suns.star.io.Pipe");
+
+ tEnv.addObjRelation(
+ "XSingleServiceFactory.arguments", args);
+
+ tEnv.addObjRelation("XSingleServiceFactory.MustSupport",
+ new Class[] {com.sun.star.script.XInvocation.class});
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_inv/package.html b/qadevOOo/tests/java/mod/_inv/package.html
new file mode 100644
index 000000000000..945e2c80f719
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_inv/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'inv'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java b/qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java
new file mode 100644
index 000000000000..2b13633d8b2f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._invadp;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.script.InvocationAdapterFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::script::XInvocationAdapterFactory</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.script.XInvocationAdapterFactory
+* @see com.sun.star.script.InvocationAdapterFactory
+* @see ifc.script._XInvocationAdapterFactory
+*/
+public class InvocationAdapterFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.script.InvocationAdapterFactory</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.script.InvocationAdapterFactory");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_invadp/package.html b/qadevOOo/tests/java/mod/_invadp/package.html
new file mode 100644
index 000000000000..3e8474139317
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invadp/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'invadp'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_invocadapt.uno/InvocationAdapterFactory.java b/qadevOOo/tests/java/mod/_invocadapt.uno/InvocationAdapterFactory.java
new file mode 100644
index 000000000000..6b1e5e47d7eb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invocadapt.uno/InvocationAdapterFactory.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._invocadapt.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.script.InvocationAdapterFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::script::XInvocationAdapterFactory</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.script.XInvocationAdapterFactory
+* @see com.sun.star.script.InvocationAdapterFactory
+* @see ifc.script._XInvocationAdapterFactory
+*/
+public class InvocationAdapterFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.script.InvocationAdapterFactory</code>.
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.script.InvocationAdapterFactory");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_invocadapt.uno/package.html b/qadevOOo/tests/java/mod/_invocadapt.uno/package.html
new file mode 100644
index 000000000000..3e8474139317
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invocadapt.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'invadp'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_invocation.uno/Invocation.java b/qadevOOo/tests/java/mod/_invocation.uno/Invocation.java
new file mode 100644
index 000000000000..6b376a3618d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invocation.uno/Invocation.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._invocation.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.script.Invocation</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XSingleServiceFactory</code></li>
+* </ul>
+* @see com.sun.star.script.Invocation
+* @see com.sun.star.lang.XSingleServiceFactory
+* @see ifc.lang._XSingleServiceFactory
+*/
+public class Invocation extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates service <code>com.sun.star.script.Invocation</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XSingleServiceFactory.createInstance.negative'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory} ;
+ * <code>String</code> relation; If its value 'true' then
+ * <code>createInstance</code> method for the object isn't
+ * supported. In this case object doesn't support this method.</li>
+ * <li> <code>'XSingleServiceFactory.arguments'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory} ;
+ * has <code>Object[]</code> type. This relation is used as
+ * a parameter for <code>createInstanceWithArguments</code>
+ * method call. If this relation doesn't exist test pass
+ * zerro length array as argument. Here
+ * <code>com.sun.star.io.Pipe</code> instance is passed.</li>
+ * <li> <code>'XSingleServiceFactory.MustSupport'</code> :
+ * for interface {@link _ifc.lang.XSingleServiceFactory}.
+ * Specifies that created instance must support
+ * <code>com.sun.star.script.XInvocation</code> interface.
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.script.Invocation");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ // the createInstance should fail according to the documentation
+ tEnv.addObjRelation(
+ "XSingleServiceFactory.createInstance.negative", "true");
+
+ // creating parameters to createInstanceWithArguments
+ Object[] args = new Object[1];
+
+ args[0] = xMSF.createInstance("com.suns.star.io.Pipe");
+
+ tEnv.addObjRelation(
+ "XSingleServiceFactory.arguments", args);
+
+ tEnv.addObjRelation("XSingleServiceFactory.MustSupport",
+ new Class[] {com.sun.star.script.XInvocation.class});
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_invocation.uno/package.html b/qadevOOo/tests/java/mod/_invocation.uno/package.html
new file mode 100644
index 000000000000..945e2c80f719
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invocation.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'inv'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java b/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java
new file mode 100644
index 000000000000..17ba5818306f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._javaloader.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+* Test for <code>com.sun.star.comp.stoc.Java2</code> service <p>
+* Files which are used :
+* <ul>
+* <li> <code>MyPersistObjectImpl.jar</code> : jar which will be loaded in
+* <code>XImplementationLoader</code> interface test. </li>
+* <ul>
+* Multithread testing compilant.
+* @see com.sun.star.loader.XImplementationLoader
+* @see com.sun.star.lang.XServiceInfo
+* @see ifc.loader._XImplementationLoader
+* @see ifc.lang._XServiceInfo
+*/
+public class JavaComponentLoader extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.comp.stoc.Java2</code>
+ * service. <p>
+ * The following object relations created :
+ * <ul>
+ * <li> <code>'ImplementationLoader'</code> : service which is
+ * responsible for loading jar implementations. </li>
+ * <li> <code>'ImplementationUrl'</code> : jar file location. </li>
+ * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance(
+ "com.sun.star.comp.stoc.JavaComponentLoader" );
+ }
+ catch( Exception e ) {
+ log.println("JavaComponentLoader Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for JavaComponentLoader object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding object relation for XImplementationLoader ifc test
+ tEnv.addObjRelation("ImplementationLoader",
+ "com.sun.star.loader.JavaComponentLoader") ;
+
+ String implURL = utils.getFullTestURL("qadevlibs/MyPersistObjectImpl.jar");
+ tEnv.addObjRelation("ImplementationUrl", implURL) ;
+ log.println("looking for shared lib: " + implURL);
+ tEnv.addObjRelation("ImplementationName",
+ "com.sun.star.cmp.MyPersistObject") ;
+
+ return tEnv;
+ } // finish method createTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java b/qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java
new file mode 100644
index 000000000000..81ee0485888c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._javaloader;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for <code>com.sun.star.comp.stoc.Java2</code> service <p>
+* Files which are used :
+* <ul>
+* <li> <code>MyPersistObjectImpl.jar</code> : jar which will be loaded in
+* <code>XImplementationLoader</code> interface test. </li>
+* <ul>
+* Multithread testing compilant.
+* @see com.sun.star.loader.XImplementationLoader
+* @see com.sun.star.lang.XServiceInfo
+* @see ifc.loader._XImplementationLoader
+* @see ifc.lang._XServiceInfo
+*/
+public class JavaComponentLoader extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.comp.stoc.Java2</code>
+ * service. <p>
+ * The following object relations created :
+ * <ul>
+ * <li> <code>'ImplementationLoader'</code> : service which is
+ * responsible for loading jar implementations. </li>
+ * <li> <code>'ImplementationUrl'</code> : jar file location. </li>
+ * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance(
+ "com.sun.star.comp.stoc.JavaComponentLoader" );
+ }
+ catch( Exception e ) {
+ log.println("JavaComponentLoader Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for JavaComponentLoader object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding object relation for XImplementationLoader ifc test
+ tEnv.addObjRelation("ImplementationLoader",
+ "com.sun.star.loader.JavaComponentLoader") ;
+
+ String implURL = utils.getFullTestURL("qadevlibs/MyPersistObjectImpl.jar");
+ tEnv.addObjRelation("ImplementationUrl", implURL) ;
+ log.println("looking for shared lib: " + implURL);
+ tEnv.addObjRelation("ImplementationName",
+ "com.sun.star.cmp.MyPersistObject") ;
+
+ return tEnv;
+ } // finish method createTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_javavm.uno/JavaVirtualMachine.java b/qadevOOo/tests/java/mod/_javavm.uno/JavaVirtualMachine.java
new file mode 100644
index 000000000000..09192967bce0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_javavm.uno/JavaVirtualMachine.java
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._javavm.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.java.JavaVirtualMachine</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::java::XJavaThreadRegister_11</code></li>
+* <li> <code>com::sun::star::java::XJavaVM</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.java.XJavaThreadRegister_11
+* @see com.sun.star.java.XJavaVM
+* @see com.sun.star.java.XJavaVirtualMachine
+* @see ifc.java._XJavaThreadRegister_11
+* @see ifc.java._XJavaVM
+*/
+public class JavaVirtualMachine extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.java.JavaVirtualMachine</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.java.JavaVirtualMachine");
+
+ return new TestEnvironment(xInt);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_javavm.uno/package.html b/qadevOOo/tests/java/mod/_javavm.uno/package.html
new file mode 100644
index 000000000000..a58e59cf2325
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_javavm.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'jen'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java
new file mode 100644
index 000000000000..c7fbc712ed91
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._jdbc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see ifc.sdbc._XDriver
+*/
+public class JDBCDriver extends TestCase {
+ /**
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>flat.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments.
+ * The values for list are obtained from the parameter
+ * <code>jdbc.user</code> and <code>jdbc.password</code>.</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.sdbc.JDBCDriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for JDBCDriver object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String jdbcURL = (String) Param.get("jdbc.url");
+ if (jdbcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "jdbc:" + jdbcURL);
+
+ String user = (String) Param.get("jdbc.user");
+ String password = (String) Param.get("jdbc.password");
+ if (user == null || password == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
+ }
+ PropertyValue[] info = new PropertyValue[4];
+ info[0] = new PropertyValue();
+ info[0].Name = "JavaDriverClass";
+ info[0].Value = DBTools.TST_JDBC_DRIVER;
+ info[1] = new PropertyValue();
+ info[1].Name = "user";
+ info[1].Value = user;
+ info[2] = new PropertyValue();
+ info[2].Name = "password";
+ info[2].Value = password;
+ info[3] = new PropertyValue();
+ info[3].Name = "isPasswordRequired";
+ info[3].Value = new Boolean(true);
+
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String flatUrl = (String) Param.get("flat.url");
+ if (flatUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'flat.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "sdbc:flat:" + flatUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java b/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java
new file mode 100644
index 000000000000..ba25eb21342e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._jen;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.java.JavaVirtualMachine</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::java::XJavaThreadRegister_11</code></li>
+* <li> <code>com::sun::star::java::XJavaVM</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.java.XJavaThreadRegister_11
+* @see com.sun.star.java.XJavaVM
+* @see com.sun.star.java.XJavaVirtualMachine
+* @see ifc.java._XJavaThreadRegister_11
+* @see ifc.java._XJavaVM
+*/
+public class JavaVirtualMachine extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.java.JavaVirtualMachine</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.java.JavaVirtualMachine");
+
+ return new TestEnvironment(xInt);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_jen/package.html b/qadevOOo/tests/java/mod/_jen/package.html
new file mode 100644
index 000000000000..a58e59cf2325
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_jen/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'jen'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_lng/DicList.java b/qadevOOo/tests/java/mod/_lng/DicList.java
new file mode 100644
index 000000000000..806b38290c93
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/DicList.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.Locale;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.linguistic2.XDictionary;
+import com.sun.star.linguistic2.XDictionaryList;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.lingu2.DicList</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::linguistic2::XSearchableDictionaryList</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::linguistic2::XDictionaryList</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.linguistic2.XSearchableDictionaryList
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.linguistic2.XDictionaryList
+ * @see ifc.linguistic2._XSearchableDictionaryList
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.linguistic2._XDictionaryList
+ */
+public class DicList extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.lingu2.DicList</code>. Then two dictionaries
+ * are created (positive and negative) and added to the list, one
+ * entry is added to each of dictionaries and they both are activated.
+ * The distionary list is retruned as a component for testing.
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance("com.sun.star.lingu2.DicList");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //creating a user defined dictionary for XSearchableDictionaryList
+ XDictionaryList xDicList = (XDictionaryList) UnoRuntime.queryInterface(
+ XDictionaryList.class, oObj);
+ xDicList.removeDictionary(xDicList.getDictionaryByName("MyDictionary"));
+ XDictionary xDic = xDicList.createDictionary("NegativDic",new Locale(
+ "en","US","WIN"),com.sun.star.linguistic2.DictionaryType.NEGATIVE,"");
+ XDictionary xDic2 = xDicList.createDictionary("PositivDic",new Locale(
+ "en","US","WIN"),com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+ xDic2.add("Positiv",false,"");
+ xDic.add("Negativ",true,"");
+ xDicList.addDictionary(xDic);
+ xDicList.addDictionary(xDic2);
+ xDic.setActive(true);
+ xDic2.setActive(true);
+
+ return tEnv;
+ }
+
+} // finish class DicList
+
diff --git a/qadevOOo/tests/java/mod/_lng/LinguProps.java b/qadevOOo/tests/java/mod/_lng/LinguProps.java
new file mode 100644
index 000000000000..77e951568f38
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/LinguProps.java
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.linguistic2.LinguProperties</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::linguistic2::LinguProperties</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.linguistic2.LinguProperties
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertySet
+ * @see ifc.linguistic2._LinguProperties
+ */
+public class LinguProps extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.linguistic2.LinguProperties</code>.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.linguistic2.LinguProperties");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+
+} // finish class LinguProps
+
diff --git a/qadevOOo/tests/java/mod/_lng/LngSvcMgr.java b/qadevOOo/tests/java/mod/_lng/LngSvcMgr.java
new file mode 100644
index 000000000000..f2433f0cf3a4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/LngSvcMgr.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.linguistic2.LinguServiceManager</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::linguistic2::XLinguServiceManager</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.linguistic2.XLinguServiceManager
+ * @see ifc.lang._XComponent
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.linguistic2._XLinguServiceManager
+ */
+public class LngSvcMgr extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.linguistic2.LinguServiceManager</code>.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.linguistic2.LinguServiceManager");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+
+} // finish class LngSvcMgr
+
diff --git a/qadevOOo/tests/java/mod/_lnn/Hyphenator.java b/qadevOOo/tests/java/mod/_lnn/Hyphenator.java
new file mode 100644
index 000000000000..7e313385d07b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/Hyphenator.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.linguistic2.Hyphenator</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * <li> <code>com::sun::star::linguistic2::XHyphenator</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::linguistic2::XSupportedLocales</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::lang::XServiceDisplayName</code></li>
+ * <li> <code>com::sun::star::linguistic2::XLinguServiceEventBroadcaster</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.linguistic2.XHyphenator
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.linguistic2.XSupportedLocales
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.lang.XServiceDisplayName
+ * @see com.sun.star.linguistic2.XLinguServiceEventBroadcaster
+ * @see ifc.lang._XInitialization
+ * @see ifc.linguistic2._XHyphenator
+ * @see ifc.lang._XComponent
+ * @see ifc.linguistic2._XSupportedLocales
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.lang._XServiceDisplayName
+ * @see ifc.linguistic2._XLinguServiceEventBroadcaster
+ */
+public class Hyphenator extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.linguistic2.Hyphenator</code>.
+ * Then a property for using new German rules for hyphenation
+ * is set.
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.linguistic2.Hyphenator");
+ Object LP = xMSF.createInstance
+ ("com.sun.star.linguistic2.LinguProperties");
+ XPropertySet LProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,LP);
+ LProps.setPropertyValue("IsGermanPreReform",new Boolean(true));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+
+} // finish class Hyphenator
+
diff --git a/qadevOOo/tests/java/mod/_lnn/SpellChecker.java b/qadevOOo/tests/java/mod/_lnn/SpellChecker.java
new file mode 100644
index 000000000000..55cc7e143099
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/SpellChecker.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.linguistic2.XLinguServiceManager;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.linguistic2.SpellChecker</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::linguistic2::XSupportedLocales</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::linguistic2::XSpellChecker</code></li>
+ * <li> <code>com::sun::star::lang::XServiceDisplayName</code></li>
+ * <li> <code>com::sun::star::linguistic2::XLinguServiceEventBroadcaster</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.linguistic2.XSupportedLocales
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.linguistic2.XSpellChecker
+ * @see com.sun.star.lang.XServiceDisplayName
+ * @see com.sun.star.linguistic2.XLinguServiceEventBroadcaster
+ * @see ifc.lang._XInitialization
+ * @see ifc.lang._XComponent
+ * @see ifc.linguistic2._XSupportedLocales
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.linguistic2._XSpellChecker
+ * @see ifc.lang._XServiceDisplayName
+ * @see ifc.linguistic2._XLinguServiceEventBroadcaster
+ */
+public class SpellChecker extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.linguistic2.SpellChecker</code>.
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+ Object LinguServiceManager = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.lingu2.SpellChecker");
+ LinguServiceManager = xMSF.createInstance
+ ("com.sun.star.linguistic2.LinguServiceManager");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XLinguServiceManager xLinguServiceManager = (XLinguServiceManager) UnoRuntime.queryInterface(XLinguServiceManager.class, LinguServiceManager);
+ tEnv.addObjRelation("AlternativeChecker",xLinguServiceManager.getSpellChecker());
+
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_lnn/Thesaurus.java b/qadevOOo/tests/java/mod/_lnn/Thesaurus.java
new file mode 100644
index 000000000000..65c5939798f1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/Thesaurus.java
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.linguistic2.Thesaurus</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::linguistic2::XSupportedLocales</code></li>
+ * <li> <code>com::sun::star::linguistic2::XThesaurus</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::lang::XServiceDisplayName</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.linguistic2.XSupportedLocales
+ * @see com.sun.star.linguistic2.XThesaurus
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.lang.XServiceDisplayName
+ * @see ifc.lang._XInitialization
+ * @see ifc.lang._XComponent
+ * @see ifc.linguistic2._XSupportedLocales
+ * @see ifc.linguistic2._XThesaurus
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.lang._XServiceDisplayName
+ */
+public class Thesaurus extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.linguistic2.Thesaurus</code>.
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.linguistic2.Thesaurus");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java b/qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java
new file mode 100644
index 000000000000..42ded566f92d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._mcnttype;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.mcnttype.MimeContentTypeFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::datatransfer::XMimeContentTypeFactory</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.datatransfer.XMimeContentTypeFactory
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.lang.XTypeProvider
+* @see com.sun.star.mcnttype.MimeContentTypeFactory
+* @see ifc.datatransfer._XMimeContentTypeFactory
+* @see ifc.lang._XServiceInfo
+* @see ifc.lang._XTypeProvider
+*/
+public class MimeContentTypeFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.datatransfer.MimeContentTypeFactory</code>. <p>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+
+
+ try {
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.datatransfer.MimeContentTypeFactory" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_mozab/MozabDriver.java b/qadevOOo/tests/java/mod/_mozab/MozabDriver.java
new file mode 100644
index 000000000000..a50398eff832
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_mozab/MozabDriver.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._mozab;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+* Test allows to run object tests in several threads concurently.
+* @see com.sun.star.sdbc.Driver
+* @see com.sun.star.sdbc.XDriver
+* @see com.sun.star.sdbcx.XCreateCatalog
+* @see com.sun.star.sdbcx.XDropCatalog
+* @see ifc.sdbc._XDriver
+* @see ifc.sdbcx._XCreateCatalog
+* @see ifc.sdbcx._XDropCatalog
+*/
+public class MozabDriver extends TestCase {
+ /**
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>mozab.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments.
+ * </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.comp.sdbc.MozabDriver");
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String mozabURL = (String) Param.get("mozab.url");
+ if (mozabURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'mozabURL' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:address:" + mozabURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_namingservice.uno/NamingService.java b/qadevOOo/tests/java/mod/_namingservice.uno/NamingService.java
new file mode 100644
index 000000000000..73ff7815b9f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_namingservice.uno/NamingService.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._namingservice.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.uno.NamingService</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::uno::XNamingService</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.uno.XNamingService
+* @see com.sun.star.uno.NamingService
+* @see ifc.uno._XNamingService
+*/
+public class NamingService extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.uno.NamingService</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XNamingService.RegisterObject'</code> for
+ * {@link ifc.uno._XNamingService} : an object
+ * which can be registered. Here it is an instance
+ * of <code>com.sun.star.lang.ServiceManager</code>
+ * service.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.uno.NamingService" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // objRelation for XNamingService as object to be registered
+ try {
+ tEnv.addObjRelation("XNamingService.RegisterObject",
+ xMSF.createInstance
+ ("com.sun.star.lang.ServiceManager")) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create object relation") ;
+ throw new StatusException("Can't create object relation", e) ;
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_namingservice/NamingService.java b/qadevOOo/tests/java/mod/_namingservice/NamingService.java
new file mode 100644
index 000000000000..d7bffd85e347
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_namingservice/NamingService.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._namingservice;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.uno.NamingService</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::uno::XNamingService</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.uno.XNamingService
+* @see com.sun.star.uno.NamingService
+* @see ifc.uno._XNamingService
+*/
+public class NamingService extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.uno.NamingService</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XNamingService.RegisterObject'</code> for
+ * {@link ifc.uno._XNamingService} : an object
+ * which can be registered. Here it is an instance
+ * of <code>com.sun.star.lang.ServiceManager</code>
+ * service.</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.uno.NamingService" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // objRelation for XNamingService as object to be registered
+ try {
+ tEnv.addObjRelation("XNamingService.RegisterObject",
+ ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.lang.ServiceManager")) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create object relation") ;
+ throw new StatusException("Can't create object relation", e) ;
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_namingservice/package.html b/qadevOOo/tests/java/mod/_namingservice/package.html
new file mode 100644
index 000000000000..5eae896a6805
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_namingservice/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'namingservice'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java b/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java
new file mode 100644
index 000000000000..b1c9c8642254
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._nestedreg.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.XInterface;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.RegistryTools;
+import util.utils;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.registry.NestedRegistry</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::registry::XSimpleRegistry</code></li>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> XSimpleRegistry.rdb </b> : Registry file created before. </li>
+* <li><b> XSimpleRegistry_open#.rdb </b> : Temporary registry file as copy of
+* <b> XSimpleRegistry.rdb </b> in the SOffice temp directory.
+* ('#' - is an ordinary number) </li>
+* <li><b> XSimpleRegistry_merge#.rdb </b> : Temporary registry file as copy of
+* <b> XSimpleRegistry.rdb </b> in the SOffice temp directory.
+* ('#' - is an ordinary number) </li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.registry.XSimpleRegistry
+* @see com.sun.star.lang.XInitialization
+* @see ifc.registry._XSimpleRegistry
+* @see ifc.lang._XInitialization
+*/
+public class NestedRegistry extends TestCase {
+
+ protected static int uniq = 0 ;
+ XSimpleRegistry reg1;
+ XSimpleRegistry reg2;
+
+ public synchronized void disposeTestEnvironment( TestEnvironment tEnv,
+ TestParameters tParam ) {
+ try {
+ reg1.destroy();
+ reg2.destroy();
+ }
+ catch (com.sun.star.registry.InvalidRegistryException e) {}
+ }
+
+ /**
+ * Creates a temporary copy of file, which is deleted when VM exits.
+ * @param src Source file path.
+ * @param dst Destination file path.
+ * @throws java.io.IOException If any problems occur during copiing.
+ */
+ protected void copyFile(String src, String dst, PrintWriter log)
+ throws java.io.IOException {
+ File srcF = new File(src) ;
+ File dstF = new File(dst) ;
+
+ if (dstF.exists()) dstF.delete() ;
+ dstF.createNewFile() ;
+
+ dstF.deleteOnExit() ;
+
+ FileInputStream fIn = new FileInputStream(srcF) ;
+ FileOutputStream fOut = new FileOutputStream(dstF) ;
+
+ byte[] buf = new byte[1024] ;
+ int bytesRead = 0 ;
+ while ((bytesRead = fIn.read(buf)) > 0)
+ fOut.write(buf, 0, bytesRead) ;
+
+ fIn.close() ;
+ fOut.close() ;
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two temporary copies of registry file created before, opens
+ * them, and creates service <code>com.sun.star.comp.stoc.NestedRegistry</code>
+ * with these two registries. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'NR'</code> for {@link ifc.registry._XSimpleRegistry} :
+ * Just informs interface test that <code>NestedRegistry</code>
+ * service is tested. If this relation exists, than some methods
+ * are not supported. The relation is a <code>String</code> with
+ * object name.</li>
+ * <li> <code>'XSimpleRegistry.open'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * <li> <code>'XSimpleRegistry.destroy'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * <li> <code>'XSimpleRegistry.merge'</code> for
+ * {@link ifc.registry._XSimpleRegistry}
+ * </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ final String tmpDir = utils.getOfficeTempDirSys(
+ (XMultiServiceFactory)Param.getMSF()) ;
+ final String openF = tmpDir + "XSimpleRegistry_open" + uniq + ".rdb" ;
+ final String destroyF = tmpDir
+ + "XSimpleRegistry_destroy" + uniq + ".rdb" ;
+ final String mergeF = tmpDir + "XSimpleRegistry_merge" + uniq + ".rdb" ;
+ uniq++ ;
+
+ log.println("creating copies of the registry for XSimpleRegistry");
+ try {
+ String source = utils.getFullTestDocName("XSimpleRegistry.rdb");
+ copyFile(source, openF, log) ;
+ copyFile(source, mergeF, log) ;
+ } catch (java.io.IOException e) {
+ log.println("Exception occured while copying files");
+ e.printStackTrace(log);
+ throw new StatusException("Exception occured while copying files", e);
+ }
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ reg1 = RegistryTools.
+ createRegistryService(xMSF) ;
+ reg1.open(mergeF, false, true) ;
+ reg2 = RegistryTools.
+ createRegistryService(xMSF) ;
+ reg2.open(openF, false, true) ;
+ XSimpleRegistry[] arg = new XSimpleRegistry[2];
+ arg[0]=reg1;
+ arg[1]=reg2;
+ oInterface = xMSF.createInstanceWithArguments
+ ( "com.sun.star.comp.stoc.NestedRegistry", arg );
+ }
+ catch( Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("NR","NestedRegistry");
+
+ tEnv.addObjRelation("XSimpleRegistry.open", openF) ;
+ tEnv.addObjRelation("XSimpleRegistry.merge", mergeF) ;
+ tEnv.addObjRelation("XSimpleRegistry.destroy", destroyF) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+
+ }
+
+} // finish class NestedRegistry
+
diff --git a/qadevOOo/tests/java/mod/_nestedreg.uno/package.html b/qadevOOo/tests/java/mod/_nestedreg.uno/package.html
new file mode 100644
index 000000000000..16090213476e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_nestedreg.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'defreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java
new file mode 100644
index 000000000000..0705d424cd57
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._odbc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Here <code>com.sun.star.sdbc.Driver</code> service is tested.<p>
+ * Test allows to run object tests in several threads concurently.
+ * @see com.sun.star.sdbc.Driver
+ * @see com.sun.star.sdbc.XDriver
+ * @see ifc.sdbc._XDriver
+ */
+public class ODBCDriver extends TestCase {
+ /**
+ * Creates an instance of the service
+ * <code>com.sun.star.sdbc.Driver</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDriver.URL'</code> for {@link ifc.sdbc._XDriver}:
+ * is the URL of the database to which to connect.
+ * The URL is obtained from the parameter <code>odbc.url</code></li>
+ * <li> <code>'XDriver.UNSUITABLE_URL'</code> for {@link ifc.sdbc._XDriver}:
+ * the wrong kind of URL to connect using given driver.
+ * The URL is obtained from the parameter <code>jdbc.url</code></li>
+ * <li> <code>'XDriver.INFO'</code> for {@link ifc.sdbc._XDriver}:
+ * a list of arbitrary string tag/value pairs as connection arguments.
+ * </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.sdbc.ODBCDriver");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create object"));
+ }
+
+ log.println("creating a new environment for ODBCDriver object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding relation for sdbc.XDriver
+ String odbcURL = (String) Param.get("odbc.url");
+ if (odbcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'odbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.URL", "sdbc:odbc:" + odbcURL);
+
+ PropertyValue[] info = new PropertyValue[0];
+ tEnv.addObjRelation("XDriver.INFO", info);
+
+ String jdbcUrl = (String) Param.get("jdbc.url");
+ if (jdbcUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java
new file mode 100644
index 000000000000..aabee75977bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._pcr;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XFrames;
+import com.sun.star.frame.XFramesSupplier;
+import com.sun.star.inspection.XObjectInspector;
+import com.sun.star.inspection.XObjectInspectorModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.CloseVetoException;
+import com.sun.star.util.XCloseable;
+import helper.PropertyHandlerImpl;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import util.DesktopTools;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.reflection.ObjectInspector</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::inspection::XObjectInspector</code></li>
+ * <li> <code>com::sun::star::frame::XController</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.inspection.XObjectInspector
+ * @see com.sun.star.frame.XController
+ */
+public class ObjectInspector extends TestCase {
+
+ /**
+ * module variable which holds the Desktop
+ * @see com.sun.star.frame.Desktop
+ */
+ protected static Object StarDesktop = null;
+
+ /**
+ * assign to the module variable <CODE>StarDesktop</CODE> the desktop
+ * @param Param the test parameters
+ * @param log the log writer
+ * @see lib.TestParameters
+ * @see share.LogWriter
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println("create a desktop...");
+ StarDesktop = DesktopTools.createDesktop((XMultiServiceFactory) Param.getMSF());
+ if (StarDesktop == null){
+ throw new StatusException("Could not get a Desktop: null", null);
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.inspection.ObjectInspector</code> and adds it to
+ * a floating frame.<br>
+ * To test <CODE>com.sun.star.inspection.XObjectInspector.inspect()</CODE>
+ * an own implementation of
+ * <CODE>com.sun.star.inspection.XPropertyHandler</CODE> was used.
+ * @param tParam the tests parameter
+ * @param log the logger
+ * @return the test environement
+ * @see util.DesktopTools
+ * @see helper.PropertyHandlerImpl
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ this.cleanup(tParam, log);
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface oInspector = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspector");
+
+ XObjectInspector xInspector = (XObjectInspector) UnoRuntime.queryInterface(XObjectInspector.class, oInspector);
+
+ log.println("ImplementationName '" + utils.getImplName(xInspector) + "'");
+
+ XInterface oInspectorModel = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel");
+
+ XObjectInspectorModel xInspectorModel = (XObjectInspectorModel)
+ UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModel);
+
+ XInterface oInspectorModelToSet = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel");
+
+ XObjectInspectorModel xInspectorModelToSet = (XObjectInspectorModel)
+ UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModelToSet);
+
+
+ log.println("create a floating frame...");
+
+ XWindow xWindow = null;
+ try{
+
+ XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
+
+ xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
+
+ } catch (StatusException e){
+ throw new StatusException("Coud not create test object", e);
+ }
+
+ XInterface oFrame = (XInterface) xMSF.createInstance("com.sun.star.frame.Frame");
+
+ XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame);
+
+ xFrame.setName("ObjectInspector");
+ xFrame.initialize(xWindow);
+
+ XFramesSupplier xFramesSup = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, StarDesktop);
+
+ XFrames xFrames = xFramesSup.getFrames();
+ xFrames.append(xFrame);
+
+
+ log.println("attach ObjectInspector to floating frame...");
+
+ XInitialization xOII = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, xInspectorModel);
+
+ xOII.initialize(new Object[0]);
+
+ xInspector.setInspectorModel(xInspectorModel);
+
+ // for debug purposes the following lines could commented out. But in
+ // this case the com.sun.star.frame.XController would be failed!
+ //xInspector.attachFrame(xFrame);
+ //xWindow.setVisible(true);
+
+ Object[] oInspect = new Object[1];
+ oInspect[0] = new PropertyHandlerImpl();
+
+ TestEnvironment tEnv = new TestEnvironment(xInspector);
+
+ // com.sun.star.frame.XController
+ tEnv.addObjRelation("Frame",xFrame);
+
+ tEnv.addObjRelation("XObjectInspector.toInspect", oInspect);
+
+ tEnv.addObjRelation("XObjectInspector.InspectorModelToSet", xInspectorModelToSet);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+
+ /**
+ * Closes the ObjectOnspector using <CODE>XCloseable</CODE>
+ * @see com.sun.star.util.XCloseable
+ * @param Param the test parameter
+ * @param log the logger
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog if one exists ... ");
+
+ XFrame existentInspector = null;
+
+ XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, StarDesktop);
+
+ existentInspector = xFrame.findFrame( "ObjectInspector", 255 );
+
+ if ( existentInspector != null ){
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, existentInspector);
+ try{
+ closer.close(true);
+ } catch (CloseVetoException e){
+ log.println("Could not close inspector: " + e.toString());
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java
new file mode 100644
index 000000000000..2330de06ee7d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._pcr;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XFrame;
+import com.sun.star.inspection.XObjectInspectorModel;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.CloseVetoException;
+import com.sun.star.util.XCloseable;
+import helper.PropertyHandlerFactroy;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import util.DesktopTools;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.reflection.ObjectInspectorModel</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::inspection::XObjectInspectorModel</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.inspection.XObjectInspectorModel
+ */
+public class ObjectInspectorModel extends TestCase {
+
+ /**
+ * module variable which holds the Desktop
+ * @see com.sun.star.frame.Desktop
+ */
+ protected static Object StarDesktop = null;
+
+ /**
+ * assign to the module variable <CODE>StarDesktop</CODE> the desktop
+ * @param Param the test parameters
+ * @param log the log writer
+ * @see lib.TestParameters
+ * @see share.LogWriter
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println("create a desktop...");
+ StarDesktop = DesktopTools.createDesktop((XMultiServiceFactory) Param.getMSF());
+ if (StarDesktop == null){
+ throw new StatusException("Could not get a Desktop: null", null);
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.inspection.ObjectInspectorModel</code> with a <code>DefaultContext</code> and
+ * <code>PropertyHandlerFactroy[]</code> as parameter
+ *
+ * @param tParam the tests parameter
+ * @param log the logger
+ * @return the test environement
+ * @see util.DesktopTools
+ * @see helper.PropertyHandlerImpl
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ this.cleanup(tParam, log);
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ XPropertySet xMSFProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ XComponentContext xDefaultContext = null;
+ try{
+ // Get the default context from the office server.
+ Object oDefaultContext = xMSFProp.getPropertyValue("DefaultContext");
+
+ // Query for the interface XComponentContext.
+ xDefaultContext = (XComponentContext) UnoRuntime.queryInterface(
+ XComponentContext.class, oDefaultContext);
+
+ } catch (UnknownPropertyException e){
+ throw new StatusException("could not get DefaultContext from xMSF", e);
+ } catch (WrappedTargetException e){
+ throw new StatusException("could not get DefaultContext from xMSF", e);
+ } catch (Exception e){
+ throw new StatusException("could not get DefaultContext from xMSF", e);
+ }
+
+ try {
+
+ Object[] oHandlerFactories = new Object[1];
+ oHandlerFactories[0] = new PropertyHandlerFactroy();
+
+ int minHelpTextLines = 200;
+ int maxHelpTextLines = 400;
+
+ XObjectInspectorModel oInspectorModel = com.sun.star.inspection.ObjectInspectorModel.
+ createWithHandlerFactoriesAndHelpSection(xDefaultContext, oHandlerFactories,
+ minHelpTextLines, maxHelpTextLines);
+
+ log.println("ImplementationName '" + utils.getImplName(oInspectorModel) + "'");
+
+ TestEnvironment tEnv = new TestEnvironment(oInspectorModel);
+
+ // com.sun.star.inspection.XObjectInspectorModel
+ tEnv.addObjRelation("minHelpTextLines", new Integer(minHelpTextLines));
+ tEnv.addObjRelation("maxHelpTextLines", new Integer(maxHelpTextLines));
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+
+ /**
+ * Closes the ObjectOnspector using <CODE>XCloseable</CODE>
+ * @see com.sun.star.util.XCloseable
+ * @param Param the test parameter
+ * @param log the logger
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog if one exists ... ");
+
+ XFrame existentInspector = null;
+
+ XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, StarDesktop);
+
+ existentInspector = xFrame.findFrame( "ObjectInspector", 255 );
+
+ if ( existentInspector != null ){
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, existentInspector);
+ try{
+ closer.close(true);
+ } catch (CloseVetoException e){
+ log.println("Could not close inspector: " + e.toString());
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_proxyfac.uno/ProxyFactory.java b/qadevOOo/tests/java/mod/_proxyfac.uno/ProxyFactory.java
new file mode 100644
index 000000000000..b3ee9aeb8e53
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyfac.uno/ProxyFactory.java
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._proxyfac.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.ProxyFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::reflection::XProxyFactory</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.reflection.XProxyFactory
+* @see com.sun.star.reflection.ProxyFactory
+* @see ifc.reflection._XProxyFactory
+*/
+public class ProxyFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.reflection.ProxyFactory</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.reflection.ProxyFactory");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java b/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java
new file mode 100644
index 000000000000..15ce8a8ef4df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._proxyfac;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.ProxyFactory</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::reflection::XProxyFactory</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.reflection.XProxyFactory
+* @see com.sun.star.reflection.ProxyFactory
+* @see ifc.reflection._XProxyFactory
+*/
+public class ProxyFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.reflection.ProxyFactory</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.reflection.ProxyFactory");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_proxyfac/package.html b/qadevOOo/tests/java/mod/_proxyfac/package.html
new file mode 100644
index 000000000000..807d5622d1ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyfac/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'proxyfac'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java b/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java
new file mode 100644
index 000000000000..41c467479a8e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._proxyset;
+
+import java.io.PrintWriter;
+import java.util.Hashtable;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.system.SOffice52ProxySettings</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::system::XProxySettings</code></li>
+ * <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.system.XProxySettings
+ * @see com.sun.star.lang.XTypeProvider
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.system._XProxySettings
+ * @see ifc.lang._XTypeProvider
+ */
+public class SOffice52ProxySettings extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of
+ * <code>com.sun.star.system.SOffice52ProxySettings</code>,for testing.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XProxySettings.proxySettings'</code> for
+ * {@link ifc.system._XProxySettings} : </li>
+ * <p>It passes a Hashtable with expected proxy settings as object
+ * relation "XProxySettings.proxySettings", to verify results. The expected
+ * settings are taken from parameters. The following parameters are recognized:
+ * <ul>
+ * <li>test.proxy.soffice52.ftpProxyAddress</li>
+ * <li>test.proxy.soffice52.ftpProxyPort</li>
+ * <li>test.proxy.soffice52.gopherProxyAddress</li>
+ * <li>test.proxy.soffice52.gopherProxyPort</li>
+ * <li>test.proxy.soffice52.httpProxyAddress</li>
+ * <li>test.proxy.soffice52.httpProxyPort</li>
+ * <li>test.proxy.soffice52.httpsProxyAddress</li>
+ * <li>test.proxy.soffice52.httpsProxyPort</li>
+ * <li>test.proxy.soffice52.socksProxyAddress</li>
+ * <li>test.proxy.soffice52.socksProxyPort</li>
+ * <li>test.proxy.soffice52.proxyBypassAddress</li>
+ * <li>test.proxy.soffice52.proxyEnabled</li>
+ * </ul>.
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance(
+ "com.sun.star.system.SOffice52ProxySettings");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // extracting parameters to proxy settings
+ Hashtable proxySettings = new Hashtable(12);
+
+ String prefix = "test.proxy.soffice52.";
+
+ final String[] names = {
+ "ftpProxyAddress",
+ "ftpProxyPort",
+ "gopherProxyAddress",
+ "gopherProxyPort",
+ "httpProxyAddress",
+ "httpProxyPort",
+ "httpsProxyAddress",
+ "httpsProxyPort",
+ "socksProxyAddress",
+ "socksProxyPort",
+ "proxyBypassAddress",
+ "proxyEnabled"
+ };
+
+ for (int i = 0; i < names.length; i++) {
+ String name = prefix + names[i];
+ String value = (String) tParam.get(name);
+
+ if (value == null) {
+ value = "";
+ }
+
+ proxySettings.put(names[i], value);
+ }
+
+ tEnv.addObjRelation("XProxySettings.proxySettings", proxySettings);
+
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java b/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java
new file mode 100644
index 000000000000..80068cfadf71
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._proxyset;
+
+import java.io.PrintWriter;
+import java.util.Hashtable;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.system.SystemProxySettings</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::system::XProxySettings</code></li>
+ * <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.system.XProxySettings
+ * @see com.sun.star.lang.XTypeProvider
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.system._XProxySettings
+ * @see ifc.lang._XTypeProvider
+ */
+public class SystemProxySettings extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of
+ * <code>com.sun.star.system.SystemProxySettings</code>,for testing.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XProxySettings.proxySettings'</code> for
+ * {@link ifc.system._XProxySettings} : </li>
+ * <p>It passes a Hashtable with expected proxy settings as object
+ * relation "XProxySettings.proxySettings", to verify results. The expected
+ * settings are taken from parameters. The following parameters are recognized:
+ * <ul>
+ * <li>test.proxy.soffice52.ftpProxyAddress</li>
+ * <li>test.proxy.soffice52.ftpProxyPort</li>
+ * <li>test.proxy.soffice52.gopherProxyAddress</li>
+ * <li>test.proxy.soffice52.gopherProxyPort</li>
+ * <li>test.proxy.soffice52.httpProxyAddress</li>
+ * <li>test.proxy.soffice52.httpProxyPort</li>
+ * <li>test.proxy.soffice52.httpsProxyAddress</li>
+ * <li>test.proxy.soffice52.httpsProxyPort</li>
+ * <li>test.proxy.soffice52.socksProxyAddress</li>
+ * <li>test.proxy.soffice52.socksProxyPort</li>
+ * <li>test.proxy.soffice52.proxyBypassAddress</li>
+ * <li>test.proxy.soffice52.proxyEnabled</li>
+ * </ul>.
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.system.SystemProxySettings" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // extracting parameters to proxy settings
+ Hashtable proxySettings = new Hashtable(12);
+
+ String prefix = "test.proxy.system.";
+
+ final String[] names = {
+ "ftpProxyAddress",
+ "ftpProxyPort",
+ "gopherProxyAddress",
+ "gopherProxyPort",
+ "httpProxyAddress",
+ "httpProxyPort",
+ "httpsProxyAddress",
+ "httpsProxyPort",
+ "socksProxyAddress",
+ "socksProxyPort",
+ "proxyBypassAddress",
+ "proxyEnabled"
+ };
+
+ for (int i = 0; i < names.length; i++) {
+ String name = prefix + names[i];
+ String value = (String) tParam.get(name);
+
+ if (value == null) {
+ value = "";
+ }
+
+ proxySettings.put(names[i], value);
+ }
+
+ tEnv.addObjRelation("XProxySettings.proxySettings", proxySettings);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_qadevOOo/SelfTest.java b/qadevOOo/tests/java/mod/_qadevOOo/SelfTest.java
new file mode 100755
index 000000000000..0bbe59be86df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_qadevOOo/SelfTest.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._qadevOOo;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+
+public class SelfTest extends TestCase
+{
+ private XTextDocument xTextDoc = null;
+
+ protected void initialize(TestParameters tParam, PrintWriter log)
+ {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) tParam.getMSF());
+
+ log.println("initialize the selftest");
+ try
+ {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log)
+ {
+ log.println(" cleanup selftest");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log)
+ {
+ XInterface oObj = null;
+ log.println("creating a test environment");
+
+ // get the bodytext of textdocument here
+ log.println("getting the TextCursor");
+
+ final XSimpleText aText = xTextDoc.getText();
+ final XTextCursor textCursor = aText.createTextCursor();
+ oObj = textCursor;
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java
new file mode 100644
index 000000000000..0e6d823d20d5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._rdbtdp;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.TypeDescriptionProvider</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XHierarchicalNameAccess</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.container.XHierarchicalNameAccess
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.reflection.TypeDescriptionProvider
+* @see ifc.container._XHierarchicalNameAccess
+* @see ifc.lang._XComponent
+*/
+public class RegistryTypeDescriptionProvider extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.reflection.TypeDescriptionProvider</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ElementName'</code> for
+ * {@link ifc.container._XHierarchicalNameAccess} :
+ * name of the existing element. Here it type name for
+ * <code>com.sun.star.uno.XInterface</code> interface.</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, xMSF);
+ // get context
+ XComponentContext xContext = (XComponentContext)
+ UnoRuntime.queryInterface(XComponentContext.class,
+ xProp.getPropertyValue("DefaultContext"));
+ // get the type description manager
+ Object o = xContext.getValueByName("/singletons/" +
+ "com.sun.star.reflection.theTypeDescriptionManager");
+ // the manager contains all providers
+ XEnumerationAccess aProviderAccess = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, o);
+ // collect enumeration
+ XEnumeration xProviderEnum;
+ if (aProviderAccess.hasElements())
+ xProviderEnum = aProviderAccess.createEnumeration();
+ else
+ throw new lib.StatusException(Status.failed(
+ "No TypeDescriptionProvider given"));
+ // take the first registry type description provider
+ oInterface = xProviderEnum.nextElement();
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oInterface);
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ //oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XHierarchicalNameAccess
+ tEnv.addObjRelation("ElementName", "com.sun.star.uno.XInterface") ;
+ tEnv.addObjRelation("SearchString", "com.sun.star.loader");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_rdbtdp/package.html b/qadevOOo/tests/java/mod/_rdbtdp/package.html
new file mode 100644
index 000000000000..ee0975e6e4cb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_rdbtdp/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'rdbtdp'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_regtypeprov.uno/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_regtypeprov.uno/RegistryTypeDescriptionProvider.java
new file mode 100644
index 000000000000..840e6e5a2df8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_regtypeprov.uno/RegistryTypeDescriptionProvider.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._regtypeprov.uno;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import java.io.PrintWriter;
+import lib.Status;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.reflection.TypeDescriptionProvider</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XHierarchicalNameAccess</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.container.XHierarchicalNameAccess
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.reflection.TypeDescriptionProvider
+* @see ifc.container._XHierarchicalNameAccess
+* @see ifc.lang._XComponent
+*/
+public class RegistryTypeDescriptionProvider extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.reflection.TypeDescriptionProvider</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ElementName'</code> for
+ * {@link ifc.container._XHierarchicalNameAccess} :
+ * name of the existing element. Here it type name for
+ * <code>com.sun.star.uno.XInterface</code> interface.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, xMSF);
+ // get context
+ XComponentContext xContext = (XComponentContext)
+ UnoRuntime.queryInterface(XComponentContext.class,
+ xProp.getPropertyValue("DefaultContext"));
+ // get the type description manager
+ Object o = xContext.getValueByName("/singletons/" +
+ "com.sun.star.reflection.theTypeDescriptionManager");
+ // the manager contains all providers
+ XEnumerationAccess aProviderAccess = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, o);
+ // collect enumeration
+ XEnumeration xProviderEnum;
+ if (aProviderAccess.hasElements())
+ xProviderEnum = aProviderAccess.createEnumeration();
+ else
+ throw new lib.StatusException(Status.failed(
+ "No TypeDescriptionProvider given"));
+ // take the first registry type description provider
+ oInterface = xProviderEnum.nextElement();
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oInterface);
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ //oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XHierarchicalNameAccess
+ tEnv.addObjRelation("ElementName", "com.sun.star.uno.XInterface") ;
+ tEnv.addObjRelation("SearchString", "com.sun.star.loader");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_remotebridge.uno/various.java b/qadevOOo/tests/java/mod/_remotebridge.uno/various.java
new file mode 100644
index 000000000000..8cdd56280b97
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_remotebridge.uno/various.java
@@ -0,0 +1,309 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._remotebridge.uno;
+
+import com.sun.star.bridge.XBridge;
+import com.sun.star.bridge.XBridgeFactory;
+import com.sun.star.bridge.XInstanceProvider;
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.bridge.Bridge</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::bridge::XBridge</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.bridge.XBridge
+* @see com.sun.star.bridge.Bridge
+* @see ifc.lang._XInitialization
+* @see ifc.lang._XComponent
+* @see ifc.bridge._XBridge
+*/
+public class various extends TestCase {
+
+ /**
+ * String for establishing a connection
+ */
+ protected String connectString = null ;
+
+ /**
+ * Choose the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 50000;
+ private int curPort = 50000;
+
+ private XAcceptor xAcctr;
+ private XConnector xCntr;
+ private XBridgeFactory xBrdgFctr;
+ private AcceptorThread accThread;
+
+ public XInterface bridge = null;
+
+ /**
+ * Implementation of interface XInstanceProvider
+ *
+ * @see com.sun.star.bridge.XInstanceProvider
+ */
+ protected class MyInstanceProvider implements XInstanceProvider {
+ /**
+ * a MultiServiceFactory for creating instances
+ *
+ * @see com.sun.star.lang.MultiServiceFactory
+ */
+ private XMultiServiceFactory xMSF = null;
+
+ /**
+ * Construct object with a MultiServiceFactory
+ *
+ * @see com.sun.star.lang.MultiServiceFactory
+ */
+ public MyInstanceProvider(XMultiServiceFactory xMSF) {
+ this.xMSF = xMSF;
+ }
+
+ /**
+ * get an instance by name
+ */
+ public Object getInstance(String aInstanceName)
+ throws com.sun.star.container.NoSuchElementException
+ {
+ System.out.println("######## Try to get "+aInstanceName);
+ try {
+ return xMSF.createInstance(aInstanceName);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+ }
+
+ /**
+ * Calls <code>accept()</code> method in a separate thread.
+ * Then stores exception thrown by call if it occured, or
+ * return value.
+ */
+ protected class AcceptorThread extends Thread {
+ /**
+ * If exception occured during method call it is
+ * stored in this field.
+ */
+ public Exception ex = null ;
+ private XAcceptor acc = null ;
+ private XInstanceProvider xInstProv = null ;
+ private XBridgeFactory xBrdgFctr = null;
+ /**
+ * If method call returns some value it stores in this field.
+ */
+ public XConnection acceptedCall = null ;
+
+ /**
+ * Creates object which can call <code>accept</code> method
+ * of the Acceptor object specified.
+ */
+ public AcceptorThread(XAcceptor acc, XInstanceProvider xInstProv,
+ XBridgeFactory xBrdgFctr) {
+ this.acc = acc ;
+ this.xInstProv = xInstProv;
+ this.xBrdgFctr = xBrdgFctr;
+ }
+
+ /**
+ * Call <code>accept()</code> method and establish a bridge with an
+ * instance provider
+ */
+ public void run() {
+ try {
+ acceptedCall = acc.accept(connectString) ;
+ xBrdgFctr.createBridge("MyBridge", "urp",
+ acceptedCall, xInstProv);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ ex = e ;
+ } catch (com.sun.star.connection.ConnectionSetupException e) {
+ ex = e ;
+ } catch (com.sun.star.connection.AlreadyAcceptingException e) {
+ ex = e ;
+ } catch (com.sun.star.bridge.BridgeExistsException e) {
+ ex = e ;
+ }
+ }
+ }
+
+ private final boolean[] bridgeDisposed = new boolean[1] ;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.bridge.Bridge</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XInitialization.args'</code> for
+ * {@link ifc.lang._XInitialization} and
+ * {@link ifc.bridge._XBridge} : contains arguments
+ * for <code>initialize()</code> method test.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.Bridge");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+ // creating arguments for XInitialization
+ // first, creating a connection
+ // connection string
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+
+ // select the port
+// curPort; //utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ connectString = "socket,host=" +
+ cncstr.substring(idx, cncstr.indexOf(",", idx)) +
+ ",port=" + curPort;
+
+ // create acceptor
+ XInterface oAcctr = (XInterface)xMSF.createInstance(
+ "com.sun.star.connection.Acceptor") ;
+
+ xAcctr = (XAcceptor)UnoRuntime.queryInterface(
+ XAcceptor.class, oAcctr);
+ // create connector
+ XInterface oCntr = (XInterface)xMSF.createInstance(
+ "com.sun.star.connection.Connector") ;
+ xCntr = (XConnector)UnoRuntime.queryInterface(
+ XConnector.class, oCntr);
+
+ // create bridge factory
+ XInterface oBrdg = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.BridgeFactory") ;
+ xBrdgFctr = (XBridgeFactory)
+ UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg);
+
+ // create own implementation of XInstanceProvider
+ XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
+ // create waiting acceptor thread
+ accThread = new AcceptorThread(xAcctr, xInstProv, xBrdgFctr);
+ accThread.start();
+ // let the thread sleep
+ try {
+ Thread.sleep(500);
+ }
+ catch (java.lang.InterruptedException e) {}
+
+ // establish the connection
+ XConnection xConnection = xCntr.connect(connectString);
+
+ String protocol = "urp";
+ String bridgeName = protocol + ":" + connectString;
+
+/* bridgeDisposed[0] = false ;
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xInt);
+ final PrintWriter logF = log;
+ xComp.addEventListener(new XEventListener() {
+ public void disposing(EventObject ev) {
+ bridgeDisposed[0] = true ;
+ logF.println("The bridge Disposed.");
+ }
+ });
+*/
+ tEnv.addObjRelation("XInitialization.args", new Object[] {
+ bridgeName, protocol, xConnection, null});
+
+ bridge = tEnv.getTestObject();
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+
+ /**
+ * Stop the acceptor thread and dispose the bridge
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+
+ System.out.println("++++++++ cleanup");
+ xAcctr.stopAccepting();
+ if (accThread.isAlive()) {
+ accThread.interrupt();
+ }
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xAcctr);
+ if (xComp != null)
+ xComp.dispose();
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xCntr);
+ if (xComp != null)
+ xComp.dispose();
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xBrdgFctr);
+ if (xComp != null)
+ xComp.dispose();
+
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, bridge);
+ if (xComp != null) {
+ System.out.println("######## Dispose bridge");
+ bridgeDisposed[0] = true;
+ xComp.dispose();
+ // wait for dispose
+ try {
+ Thread.sleep(5000);
+ }
+ catch(java.lang.InterruptedException e) {
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_remotebridge/package.html b/qadevOOo/tests/java/mod/_remotebridge/package.html
new file mode 100644
index 000000000000..64610d7f8124
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_remotebridge/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'remotebridge'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_remotebridge/various.java b/qadevOOo/tests/java/mod/_remotebridge/various.java
new file mode 100644
index 000000000000..c2cb26046a03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_remotebridge/various.java
@@ -0,0 +1,305 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._remotebridge;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.bridge.XBridgeFactory;
+import com.sun.star.bridge.XInstanceProvider;
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.bridge.Bridge</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XInitialization</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::bridge::XBridge</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.lang.XInitialization
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.bridge.XBridge
+* @see com.sun.star.bridge.Bridge
+* @see ifc.lang._XInitialization
+* @see ifc.lang._XComponent
+* @see ifc.bridge._XBridge
+*/
+public class various extends TestCase {
+
+ /**
+ * String for establishing a connection
+ */
+ protected String connectString = null ;
+
+ /**
+ * Choose the first port after <code>basePort</code>
+ * which is free.
+ */
+ protected static final int basePort = 50000;
+ private int curPort = 50000;
+
+ private XAcceptor xAcctr;
+ private XConnector xCntr;
+ private XBridgeFactory xBrdgFctr;
+ private AcceptorThread accThread;
+
+ public XInterface bridge = null;
+
+ /**
+ * Implementation of interface XInstanceProvider
+ *
+ * @see com.sun.star.bridge.XInstanceProvider
+ */
+ protected class MyInstanceProvider implements XInstanceProvider {
+ /**
+ * a MultiServiceFactory for creating instances
+ *
+ * @see com.sun.star.lang.MultiServiceFactory
+ */
+ private XMultiServiceFactory xMSF = null;
+
+ /**
+ * Construct object with a MultiServiceFactory
+ *
+ * @see com.sun.star.lang.MultiServiceFactory
+ */
+ public MyInstanceProvider(XMultiServiceFactory xMSF) {
+ this.xMSF = xMSF;
+ }
+
+ /**
+ * get an instance by name
+ */
+ public Object getInstance(String aInstanceName)
+ throws com.sun.star.container.NoSuchElementException
+ {
+ System.out.println("######## Try to get "+aInstanceName);
+ try {
+ return xMSF.createInstance(aInstanceName);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+ }
+
+ /**
+ * Calls <code>accept()</code> method in a separate thread.
+ * Then stores exception thrown by call if it occured, or
+ * return value.
+ */
+ protected class AcceptorThread extends Thread {
+ /**
+ * If exception occured during method call it is
+ * stored in this field.
+ */
+ public Exception ex = null ;
+ private XAcceptor acc = null ;
+ private XInstanceProvider xInstProv = null ;
+ private XBridgeFactory xBrdgFctr = null;
+ /**
+ * If method call returns some value it stores in this field.
+ */
+ public XConnection acceptedCall = null ;
+
+ /**
+ * Creates object which can call <code>accept</code> method
+ * of the Acceptor object specified.
+ */
+ public AcceptorThread(XAcceptor acc, XInstanceProvider xInstProv,
+ XBridgeFactory xBrdgFctr) {
+ this.acc = acc ;
+ this.xInstProv = xInstProv;
+ this.xBrdgFctr = xBrdgFctr;
+ }
+
+ /**
+ * Call <code>accept()</code> method and establish a bridge with an
+ * instance provider
+ */
+ public void run() {
+ try {
+ acceptedCall = acc.accept(connectString) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ ex = e ;
+ } catch (com.sun.star.connection.ConnectionSetupException e) {
+ ex = e ;
+ } catch (com.sun.star.connection.AlreadyAcceptingException e) {
+ ex = e ;
+ }
+ }
+ }
+
+ private final boolean[] bridgeDisposed = new boolean[1] ;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.bridge.Bridge</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XInitialization.args'</code> for
+ * {@link ifc.lang._XInitialization} and
+ * {@link ifc.bridge._XBridge} : contains arguments
+ * for <code>initialize()</code> method test.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.Bridge");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+ // creating arguments for XInitialization
+ // first, creating a connection
+ // connection string
+ String cncstr = (String) tParam.get("CNCSTR") ;
+ int idx = cncstr.indexOf("host=") + 5 ;
+
+ // select the port
+// curPort; //utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ connectString = "socket,host=" +
+ cncstr.substring(idx, cncstr.indexOf(",", idx)) +
+ ",port=" + curPort;
+
+ // create acceptor
+ XInterface oAcctr = (XInterface)xMSF.createInstance(
+ "com.sun.star.connection.Acceptor") ;
+
+ xAcctr = (XAcceptor)UnoRuntime.queryInterface(
+ XAcceptor.class, oAcctr);
+ // create connector
+ XInterface oCntr = (XInterface)xMSF.createInstance(
+ "com.sun.star.connection.Connector") ;
+ xCntr = (XConnector)UnoRuntime.queryInterface(
+ XConnector.class, oCntr);
+
+ // create bridge factory
+ XInterface oBrdg = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.BridgeFactory") ;
+ xBrdgFctr = (XBridgeFactory)
+ UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg);
+
+ // create own implementation of XInstanceProvider
+ XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
+ // create waiting acceptor thread
+ accThread = new AcceptorThread(xAcctr, xInstProv, xBrdgFctr);
+ accThread.start();
+ // let the thread sleep
+ try {
+ Thread.sleep(500);
+ }
+ catch (java.lang.InterruptedException e) {}
+
+ // establish the connection
+ XConnection xConnection = xCntr.connect(connectString);
+
+ String protocol = "urp";
+ String bridgeName = protocol + ":" + connectString;
+
+/* bridgeDisposed[0] = false ;
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xInt);
+ final PrintWriter logF = log;
+ xComp.addEventListener(new XEventListener() {
+ public void disposing(EventObject ev) {
+ bridgeDisposed[0] = true ;
+ logF.println("The bridge Disposed.");
+ }
+ });
+*/
+ tEnv.addObjRelation("XInitialization.args", new Object[] {
+ bridgeName, protocol, xConnection, null});
+
+ bridge = tEnv.getTestObject();
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+
+ /**
+ * Stop the acceptor thread and dispose the bridge
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+
+ System.out.println("++++++++ cleanup");
+ xAcctr.stopAccepting();
+ if (accThread.isAlive()) {
+ accThread.interrupt();
+ }
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xAcctr);
+ if (xComp != null)
+ xComp.dispose();
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xCntr);
+ if (xComp != null)
+ xComp.dispose();
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xBrdgFctr);
+ if (xComp != null)
+ xComp.dispose();
+
+ xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, bridge);
+ if (xComp != null) {
+ System.out.println("######## Dispose bridge");
+ bridgeDisposed[0] = true;
+ xComp.dispose();
+ // wait for dispose
+ try {
+ Thread.sleep(5000);
+ }
+ catch(java.lang.InterruptedException e) {
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java
new file mode 100644
index 000000000000..4d9f25301219
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+
+public class AccessibleEditableTextPara_HeaderFooter extends TestCase {
+ protected static XComponent xCalcDoc = null;
+ protected static XMultiServiceFactory msf = null;
+ protected static XAccessibleAction action = null;
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XAccessibleContext oObj = null;
+ Object toolkit = null;
+
+ try {
+ toolkit = msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ DiagThread psDiag = new DiagThread(xCalcDoc, msf);
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait")*5);
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext ok_button = AccessibilityTools.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PARAGRAPH);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + oObj.getAccessibleName());
+ log.println("ParentDescription " +
+ oObj.getAccessibleParent().getAccessibleContext()
+ .getAccessibleDescription());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, ok_button);
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ XAccessibleEditableText eText = (XAccessibleEditableText) UnoRuntime.queryInterface(
+ XAccessibleEditableText.class,
+ oObj);
+
+ eText.setText("LEFT");
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("Destroy", "AccessibleEditableTextPara_PreviewCell");
+
+ final XAccessibleEditableText editText = eText;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ editText.setText("LEFT_EVENT");
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'OK' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" disposing xCalcDoc ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xCalcDoc);
+ }
+
+ /**
+ * Opens new writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xCalcDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ SOF.createCalcDoc(
+ null));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+
+ /**
+ * Thread for opening modal dialog 'Print Settings'.
+ */
+ public class DiagThread extends Thread {
+ public XComponent xCalcDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XComponent xCalcDoc, XMultiServiceFactory msf) {
+ this.xCalcDoc = xCalcDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xCalcDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening HeaderFooterDialog
+ try {
+ String aSlotID = ".uno:EditHeaderAndFooter";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter
+ // we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java
new file mode 100644
index 000000000000..cda222edc858
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+
+public class AccessibleEditableTextPara_PreviewCell extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the accessible object for a one of cell in preview mode.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XAccessibleContext oObj = null;
+ XCell xCell = null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet") ;
+ xCell = oSheet.getCellByPosition(0, 0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ xCell.setFormula("Value");
+
+ XModel xModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+
+ XController xController = xModel.getCurrentController();
+
+ //switch to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+
+ XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), xModel);
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+ //AccessibilityTools.printAccessibleTree(log,xRoot);
+ AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL,true);
+
+ xRoot = AccessibilityTools.SearchedAccessible;
+
+ //AccessibilityTools.printAccessibleTree(log,xRoot);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot,AccessibleRole.PARAGRAPH);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + oObj.getAccessibleName());
+ log.println("Parent " + utils.getImplName(oObj.getAccessibleParent()));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EditOnly", "AccessibleEditableTextPara_PreviewCell");
+ tEnv.addObjRelation("Destroy", "AccessibleEditableTextPara_PreviewCell");
+
+ final XCell cell_to_change = xCell;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ cell_to_change.setFormula("NewString");
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
new file mode 100644
index 000000000000..9c648edc8ace
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by accessible component of
+ * a cell in the spreadsheet. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleTable</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleTable
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleSelection
+ * @see ifc.n.star.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleTable
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessibleCell extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE_CELL, "B1");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // relation for XAccessibleEventBroadcaster
+ XCell xCell = null;
+ final String text = "XAccessibleText";
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't get sheet",iae);
+ }
+ xCell = oSheet.getCellByPosition(1, 0) ;
+ xCell.setFormula(text);
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, oSheet);
+ XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oColumns);
+ XPropertySet column = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class,oIndexAccess.getByIndex(1));
+ column.setPropertyValue("OptimalWidth", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ }
+
+ tEnv.addObjRelation("EditOnly",
+ "This method is only supported if the Cell is in edit mode");
+
+ final XCell fCell = xCell ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ fCell.setFormula("firing event");
+ fCell.setFormula(text);
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", text);
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java
new file mode 100644
index 000000000000..b52891687452
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScAccessibleCsvCell extends TestCase {
+
+ Thread lThread = null;
+ static XAccessibleAction accAction = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XInterface oObj = null;
+
+ shortWait();
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class,oObj);
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ AccessibilityTools.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel");
+
+ accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE, true);
+
+ //util.dbg.printInterfaces(oObj);
+
+ XAccessibleContext cont = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+
+ String name = "";
+ try {
+ XAccessible acc = cont.getAccessibleChild(3);
+ name = acc.getAccessibleContext().getAccessibleName();
+ log.println("Child: "+ name);
+ log.println("ImplementationName " + utils.getImplName(acc));
+ oObj = acc;
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {}
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+ tEnv.addObjRelation("XAccessibleText.Text", name);
+
+ return tEnv;
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " closing Dialog " );
+ try {
+ accAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iae) {
+ log.println("Couldn't close dialog");
+ }
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ log.println("opening dialog");
+
+ PropertyValue[] args = new PropertyValue[1];
+ try {
+ args[0] = new PropertyValue();
+ args[0].Name = "InteractionHandler";
+ args[0].Value = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.uui.UUIInteractionHandler");
+ } catch(com.sun.star.uno.Exception e) {
+ }
+
+ lThread = new loadThread(SOF, args);
+ lThread.start();
+ shortWait();
+ }
+
+ /**
+ * Sleeps for 2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ public class loadThread extends Thread {
+
+ private SOfficeFactory SOF = null ;
+ private PropertyValue[] args = null;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF, PropertyValue[] Args) {
+ this.SOF = SOF;
+ this.args = Args;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ SOF.loadDocument(url,args);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+ }
+
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java
new file mode 100644
index 000000000000..2a7737d53743
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScAccessibleCsvGrid extends TestCase {
+
+ Thread lThread = null;
+ static XAccessibleAction accAction = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ shortWait();
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class,oObj);
+
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel");
+
+ accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ /*int count = accAction.getAccessibleActionCount();
+
+ for (int i = 0; i<count; i++) {
+ try {
+ System.out.println(i+": "+accAction.getAccessibleActionDescription(i));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iae) {}
+ }*/
+
+ //util.dbg.printInterfaces(oObj);
+
+ //AccessibilityTools.printAccessibleTree(log, xRoot);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE, true);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " closing Dialog " );
+ try {
+ accAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iae) {
+ log.println("Couldn't close dialog");
+ }
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ log.println("opening dialog");
+
+ PropertyValue[] args = new PropertyValue[1];
+ try {
+ args[0] = new PropertyValue();
+ args[0].Name = "InteractionHandler";
+ args[0].Value = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.uui.UUIInteractionHandler");
+ } catch(com.sun.star.uno.Exception e) {
+ }
+
+ lThread = new loadThread(SOF, args);
+ lThread.start();
+ shortWait();
+
+ }
+
+ /**
+ * Sleeps for 2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ public class loadThread extends Thread {
+
+ private SOfficeFactory SOF = null ;
+ private PropertyValue[] args = null;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF, PropertyValue[] Args) {
+ this.SOF = SOF;
+ this.args = Args;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ SOF.loadDocument(url,args);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java
new file mode 100644
index 000000000000..84553b082622
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScAccessibleCsvRuler extends TestCase {
+
+ Thread lThread = null;
+ static XAccessibleAction accAction = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ shortWait();
+
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ accAction = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ XAccessibleContext acc = AccessibilityTools.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIO_BUTTON);
+
+ log.println("Click on: " + acc.getAccessibleName());
+
+ XAccessibleAction accAction2 = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, acc);
+
+ try {
+ accAction2.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iae) {
+ }
+
+
+ //util.dbg.printInterfaces(oObj);
+ AccessibilityTools.printAccessibleTree(log, xRoot);
+ oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT,
+ "Ruler", true);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ int lastone = 100;
+
+ for (int i = 0; i < 1000; i++) {
+ try {
+ text.getCharacterBounds(i);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ lastone = i - 1;
+
+ break;
+ }
+ }
+
+ tEnv.addObjRelation("LimitedBounds", new Integer(lastone));
+ tEnv.addObjRelation("PreviousUsed",new int[]{11,22,33,44,55,66,77,88,99});
+
+ return tEnv;
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+/* log.println( " closing Dialog " );
+ try {
+ accAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iae) {
+ log.println("Couldn't close dialog");
+ } */
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ log.println("opening dialog");
+
+ PropertyValue[] args = new PropertyValue[1];
+ try {
+ args[0] = new PropertyValue();
+ args[0].Name = "InteractionHandler";
+ args[0].Value = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.comp.uui.UUIInteractionHandler");
+ } catch(com.sun.star.uno.Exception e) {
+ }
+
+ lThread = new loadThread(SOF, args);
+ lThread.start();
+ shortWait();
+
+ }
+
+ /**
+ * Sleeps for 2 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ public class loadThread extends Thread {
+
+ private SOfficeFactory SOF = null ;
+ private PropertyValue[] args = null;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF, PropertyValue[] Args) {
+ this.SOF = SOF;
+ this.args = Args;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ SOF.loadDocument(url,args);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java
new file mode 100644
index 000000000000..cbb3917b2e03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for object which is represented by accessible component of
+ * a spreadsheet document.
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleEventBroadcaster
+ * @see ifc.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class ScAccessibleDocument extends TestCase {
+
+ static XComponent xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Obtains accissible object for the spreadsheet document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpages" );
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT, "");
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XWindow xDocWin = xWindow;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle rect = xDocWin.getPosSize();
+ xDocWin.setPosSize(rect.X,rect.Y,rect.Height,rect.Width-10,com.sun.star.awt.PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ util.DesktopTools.closeDoc(xSpreadsheetDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ String url = utils.getFullTestURL("calcshapes.sxc");
+ log.println("loading document "+url);
+ xSpreadsheetDoc = SOF.loadDocument(url);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
new file mode 100644
index 000000000000..3835f1a876d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+/**
+ * Test for object which is represented by accessible component of
+ * a spreadsheet page in 'Page Preview' mode.
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessibleDocumentPagePreview extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // inserting some content to have non-empty page preview
+ XCell xCell = null;
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(1));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't get sheet",iae);
+ }
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessibleDocumentPagePreview - Page 2");
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(2));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't get sheet",iae);
+ }
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessibleDocumentPagePreview - Page 3");
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't get sheet",iae);
+ }
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessibleDocumentPagePreview");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.DOCUMENT, "");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XDesktop desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class,util.DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()));
+ final XWindow win = desk.getCurrentFrame().getComponentWindow();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle rec = win.getPosSize();
+ win.setPosSize(rec.X,rec.Y,rec.Height-10,rec.Width, com.sun.star.awt.PosSize.POSSIZE);
+ win.setPosSize(rec.X,rec.Y,rec.Height,rec.Width,com.sun.star.awt.PosSize.POSSIZE );
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ String url = utils.getFullTestURL("calcshapes.sxc");
+ log.println("loading document "+url);
+ xSpreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+ XSpreadsheetDocument.class,SOF.loadDocument(url));
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
new file mode 100644
index 000000000000..d77ca0f674b1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+import com.sun.star.util.XURLTransformer;
+
+/**
+ * Test for object which is represented by accessible component of
+ * a printed header in 'Page Preview' mode.
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessiblePageHeader extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // inserting some content to have non-empty page preview
+ XCell xCell = null;
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("couldn't get sheet",iae);
+ }
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessiblePageHeader");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ XStyle StdStyle = null;
+
+ try{
+ XNameAccess PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),
+ StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class), PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ throw new StatusException("Couldn't convert any", iae);
+ }
+
+ //get the property-set
+ final XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ final XHeaderFooterContent RPHC2 = RPHC;
+
+ final XText center = RPHC2.getCenterText();
+ final XText left = RPHC2.getLeftText();
+ final XText right = RPHC2.getRightText();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ center.setString("CENTER");
+ left.setString("LEFT");
+ right.setString("RIGHT");
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent",RPHC2);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {}
+ }
+ });
+
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ try {
+ XCloseable oComp = (XCloseable)
+ UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ;
+ oComp.close(true);
+ } catch(com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document: "+e.getMessage());
+ }
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
new file mode 100644
index 000000000000..f0157633ccc4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleStateSet;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+import com.sun.star.util.XURLTransformer;
+
+/**
+ * Test for object which is represented by accessible component of
+ * a printed header in 'Page Preview' mode.
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessiblePageHeaderArea extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // inserting some content to have non-empty page preview
+ XCell xCell = null;
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessiblePageHeaderArea");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ try {
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
+ XAccessibleContext cont = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ XAccessibleStateSet StateSet = cont.getAccessibleStateSet();
+ if (StateSet.contains((short)27)) {
+ log.println("Object is transient");
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ throw new StatusException("Couldn't find needed Child",iabe);
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XAccessibleContext zoomIn =
+ at.getAccessibleObjectForRole(xRoot,AccessibleRole.PUSH_BUTTON, "Zoom In");
+
+ final XAccessibleAction pressZoom = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ pressZoom.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ibe) {}
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes calc document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ try {
+ XCloseable oComp = (XCloseable)
+ UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ;
+ oComp.close(true);
+ }catch(com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document: "+e.getMessage());
+ }
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
new file mode 100644
index 000000000000..13f8aeeeb52f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleValue</code>
+ * </li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleTable
+ */
+public class ScAccessiblePreviewCell extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the accessible object for a one of cell in preview mode.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XCell xCell = null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet") ;
+ xCell = oSheet.getCellByPosition(0, 0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ xCell.setFormula("Value");
+
+ XModel xModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+
+ XController xController = xModel.getCurrentController();
+
+ //switch to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL, true);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ System.out.println("Fire Event");
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java
new file mode 100644
index 000000000000..5662ee0addc9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+import com.sun.star.util.XURLTransformer;
+
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleValue</code>
+ * </li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleTable
+ */
+public class ScAccessiblePreviewHeaderCell extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ if (xSheetDoc != null) {
+ try {
+ XCloseable oComp = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xSheetDoc);
+ oComp.close(true);
+ xSheetDoc = null;
+ } catch (com.sun.star.util.CloseVetoException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("document already disposed");
+ xSheetDoc = null;
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Sets a value of the cell 'A1'. Sets the property 'PrintHeaders'
+ * of the style 'Default' of the family 'PageStyles' to true.
+ * Switchs the document to preview mode and then obtains the
+ * accessible object for the header cell.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ if (xSheetDoc != null) {
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xSheetDoc);
+
+ XController xController = xModel.getCurrentController();
+
+ //setting value of cell A1
+ XCell xCell = null;
+
+ try {
+ log.println("Getting spreadsheet");
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets();
+ XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet");
+ xCell = oSheet.getCellByPosition(0, 0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ xCell.setFormula("Value");
+
+ //setting property 'PrintHeaders' of the style 'Default'
+ XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSheetDoc);
+ XNameAccess xNA = xSFS.getStyleFamilies();
+ XPropertySet xPropSet = null;
+
+ try {
+ Object oPageStyles = xNA.getByName("PageStyles");
+ xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
+ oPageStyles);
+
+ Object oDefStyle = xNA.getByName("Default");
+ xPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDefStyle);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't get element"));
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't get element"));
+ }
+
+ try {
+ xPropSet.setPropertyValue("PrintHeaders", new Boolean(true));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property 'PrintHeaders'"));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property 'PrintHeaders'"));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property 'PrintHeaders'"));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't set property 'PrintHeaders'"));
+ }
+
+ //switching to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ ( (XMultiServiceFactory) Param.getMSF())
+ .createInstance("com.sun.star.util.URLTransformer"));
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE, "A");
+
+ if (oObj == null) {
+ log.println("Version with a fixed #103863#");
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.TABLE_CELL,
+ true);
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(500);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
new file mode 100644
index 000000000000..b12c7c55e362
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import util.PropertyName;
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleTable</code>
+ * </li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleTable
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleTable
+ */
+public class ScAccessiblePreviewTable extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the accessible object for a table in preview mode.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XCell xCell = null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet") ;
+ xCell = oSheet.getCellByPosition(0, 0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ xCell.setFormula("Value");
+
+ XModel xModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+
+ XController xController = xModel.getCurrentController();
+
+ //switch to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow((XMultiServiceFactory)Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log,xRoot, Param.getBool(PropertyName.DEBUG_IS_ACTIVE));
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XAccessibleContext zoomIn =
+ at.getAccessibleObjectForRole(xRoot,AccessibleRole.PUSH_BUTTON, "Zoom In");
+
+ log.println("Getting "+ zoomIn.getAccessibleName());
+
+ final XAccessibleAction pressZoom = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ pressZoom.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ibe) {}
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
new file mode 100644
index 000000000000..3f80a7e5ac24
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for accessible object of spreadsheet document.<p>
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleTable</code>
+ * </li>
+ * </ul>
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleTable
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleTable
+ */
+public class ScAccessibleSpreadsheet extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the accessible object for the spreadsheet.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ XModel xModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE );
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // relation for XAccessibleEventBroadcaster
+ XCell xCell = null;
+ final String text = "Text for testing of the interface XAccessibleText";
+ try {
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ xCell = oSheet.getCellByPosition(5, 5) ;
+ xCell.setFormula(text);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception ceating relation :");
+ e.printStackTrace(log);
+ }
+
+ final XCell fCell = xCell ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ fCell.setFormula("firing event");
+ fCell.setFormula(text);
+ }
+ });
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java
new file mode 100644
index 000000000000..d2a1a2ef23ce
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.sheet.XSheetAnnotationAnchor;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which represents some text annotation
+* anchored to some cell in spreadsheet (implement
+* <code>com.sun.star.sheet.CellAnnotation</code>).<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XSimpleText</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::sheet::XSheetAnnotation</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.sheet.CellAnnotation
+* @see com.sun.star.text.XSimpleText
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.sheet.XSheetAnnotation
+* @see ifc.text._XSimpleText
+* @see ifc.text._XTextRange
+* @see ifc.sheet._XSheetAnnotation
+*/
+public class ScAnnotationObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one them. Then a single cell is retrieved, and
+ * using its <code>com.sun.star.sheet.XSheetAnnotationAnchor</code>
+ * interface an annotation is got.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CELLPOS'</code> for
+ * {@link ifc.sheet._XSheetAnnotation} (of <code>
+ * com.sun.star.table.CellAddress</code> type) which
+ * contains the annotation cell address.</li>
+ * </ul>
+ */
+ public synchronized 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" );
+
+ CellAddress cellPos = new CellAddress((short)0, 1, 2);
+
+ log.println("Getting test object ") ;
+
+ XSpreadsheetDocument xArea = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+ XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets();
+
+ XIndexAccess XAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XCell oCell = null;
+ try {
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),XAccess.getByIndex(cellPos.Sheet));
+ XCellRange oCRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ }
+
+ XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor)
+ UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell);
+ XSheetAnnotation oAnno = oAnnoA.getAnnotation();
+
+ oObj = oAnno;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("CELLPOS", cellPos);
+
+ // Other parameters required for interface tests
+
+ return tEnv;
+ }
+
+} // finish class ScAnnotationObj
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java
new file mode 100644
index 000000000000..ab06d2977b96
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.sheet.XSheetAnnotationAnchor;
+import com.sun.star.sheet.XSheetAnnotationShapeSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+import util.utils;
+
+import java.io.PrintWriter;
+import util.DefaultDsc;
+import util.InstCreator;
+
+
+/**
+* Test for object which represents some text annotation
+* anchored to some cell in spreadsheet (implement
+* <code>com.sun.star.sheet.CellAnnotation</code>).<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XSimpleText</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::sheet::XSheetAnnotation</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.sheet.CellAnnotation
+* @see com.sun.star.text.XSimpleText
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.sheet.XSheetAnnotation
+* @see ifc.text._XSimpleText
+* @see ifc.text._XTextRange
+* @see ifc.sheet._XSheetAnnotation
+*/
+public class ScAnnotationShapeObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF =
+ SOfficeFactory.getFactory((XMultiServiceFactory) tParam
+ .getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ log.println("Loading: "+utils.getFullTestURL(
+ "ScAnnotationShapeObj.sxc"));
+ xSheetDoc =
+ (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class,
+ SOF.loadDocument(utils.getFullTestURL(
+ "ScAnnotationShapeObj.sxc")));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes a spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp =
+ (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one them. Then a single cell is retrieved, and
+ * using its <code>com.sun.star.sheet.XSheetAnnotationAnchor</code>
+ * interface an annotation is got.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CELLPOS'</code> for
+ * {@link ifc.sheet._XSheetAnnotation} (of <code>
+ * com.sun.star.table.CellAddress</code> type) which
+ * contains the annotation cell address.</li>
+ * </ul>
+ */
+ public synchronized 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");
+
+ CellAddress cellPos = new CellAddress((short) 0, 1, 2);
+
+ log.println("Getting test object ");
+
+ XSpreadsheetDocument xArea =
+ (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class,
+ xSheetDoc);
+ XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets();
+
+ XIndexAccess XAccess =
+ (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class,
+ oSheets);
+ XCell oCell = null;
+
+ try {
+ XSpreadsheet oSheet =
+ (XSpreadsheet) AnyConverter.toObject(new Type(
+ XSpreadsheet.class),
+ XAccess.getByIndex(cellPos.Sheet));
+ XCellRange oCRange =
+ (XCellRange) UnoRuntime.queryInterface(XCellRange.class,
+ oSheet);
+ oCell =
+ oCRange.getCellByPosition(cellPos.Column, cellPos.Row);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting test object from spreadsheet document",
+ e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting test object from spreadsheet document",
+ e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting test object from spreadsheet document",
+ e);
+ }
+
+ XSheetAnnotationAnchor oAnnoA =
+ (XSheetAnnotationAnchor) UnoRuntime.queryInterface(XSheetAnnotationAnchor.class,
+ oCell);
+ XSheetAnnotation oAnno = oAnnoA.getAnnotation();
+
+ XSimpleText xAnnoText =
+ (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class,
+ oAnno);
+ xAnnoText.setString("ScAnnotationShapeObj");
+
+ XSheetAnnotationShapeSupplier xSheetAnnotationShapeSupplier =
+ (XSheetAnnotationShapeSupplier) UnoRuntime.queryInterface(XSheetAnnotationShapeSupplier.class,
+ oAnno);
+
+ oObj = xSheetAnnotationShapeSupplier.getAnnotationShape();
+
+ log.println("ImplementationName: "
+ + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //adding ObjRelation for RotationDescriptor
+ tEnv.addObjRelation("NoShear", Boolean.TRUE);
+
+ //adding ObjRelation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.DateTime");
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation(
+ "XTEXTINFO", new InstCreator( xSheetDoc, tDsc ) );
+
+ return tEnv;
+ }
+}
+ // finish class ScAnnotationShapeObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java
new file mode 100644
index 000000000000..662f509696a7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.sheet.XSheetAnnotationAnchor;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.document.XDocumentInsertable
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XParagraphCursor
+ * @see com.sun.star.text.XSentenceCursor
+ * @see com.sun.star.text.XTextCursor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XWordCursor
+ * @see com.sun.star.util.XSortable
+ *
+ */
+public class ScAnnotationTextCursor extends TestCase {
+
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized 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" );
+
+ CellAddress cellPos = new CellAddress((short)0, 1, 2);
+
+ try {
+ log.println("Getting test object ") ;
+
+ XSpreadsheetDocument xArea = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+
+ XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets();
+
+ XIndexAccess XAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+
+ XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet);
+
+ XCellRange oCRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+
+ XCell oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row);
+
+ XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor)
+ UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell);
+
+ XSheetAnnotation oAnno = oAnnoA.getAnnotation();
+ XSimpleText aText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class,oAnno);
+ aText.setString("A nice little Test");
+ oObj = aText.createTextCursor();
+
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+
+ return tEnv;
+ }
+
+} // finish class ScAnnotationTextCursor
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java
new file mode 100644
index 000000000000..1ff4a3f91d11
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.sheet.XSheetAnnotationAnchor;
+import com.sun.star.sheet.XSheetAnnotationsSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which represents a collection of annotations
+* for a spreadsheet document (implements
+* <code>com.sun.star.sheet.CellAnnotations</code>). <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::sheet::XSheetAnnotations</code></li>
+* </ul> <p>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.sheet.CellAnnotations
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.sheet.XSheetAnnotations
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.sheet._XSheetAnnotations
+*/
+public class ScAnnotationsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * From a document collection of spreadsheets a single one is
+ * retrieved and one annotation is added to it. Then a collection
+ * of annotations is retrieved using spreadsheet's
+ * <code>com.sun.star.sheet.XSheetAnnotationsSupplier</code> interface.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 ") ;
+
+ XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+ XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets();
+
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, sheets );
+ XCell oCell = null;
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ // adding an annotation...
+ XCellRange oCRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ oCell = oCRange.getCellByPosition(10,10);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ }
+
+ XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor)
+ UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell);
+ XSheetAnnotation oAnno = oAnnoA.getAnnotation();
+ XSimpleText sText = ((XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, oAnno));
+ sText.setString("ScAnnotationsObj");
+
+ XSheetAnnotationsSupplier supp = (XSheetAnnotationsSupplier)
+ UnoRuntime.queryInterface(
+ XSheetAnnotationsSupplier.class, oSheet);
+ oObj = supp.getAnnotations();
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+
+} // finish class ScAnnotationsObj
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java
new file mode 100644
index 000000000000..0054823cf1bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.CellAreaLink</code>.
+* This object reflects some cell range (this range
+* can also be from another saved document) in
+* any range (of the same size) of the current
+* document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XAreaLink</code></li>
+* <li> <code>com::sun::star::util::XRefreshable</code></li>
+* <li> <code>com::sun::star::sheet::CellAreaLink</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.sheet.XAreaLink
+* @see com.sun.star.util.XRefreshable
+* @see com.sun.star.sheet.CellAreaLink
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._XAreaLink
+* @see ifc.util._XRefreshable
+* @see ifc.sheet._CellAreaLink
+* @see ifc.beans._XPropertySet
+*/
+public class ScAreaLinkObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of Area Links using the 'AreaLinks'
+ * property of the Spreadsheet document. Adds a new link to this
+ * collection, which has a source in the same document. This
+ * link is passed as a tested object.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+
+ // creation of testobject here
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xSheetDoc);
+ XAreaLinks links = (XAreaLinks) AnyConverter.toObject(
+ new Type(XAreaLinks.class),props.getPropertyValue("AreaLinks")) ;
+ CellAddress addr = new CellAddress ((short) 1,2,3) ;
+ String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
+ links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ;
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), links.getByIndex(0)) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java
new file mode 100644
index 000000000000..edb102225e2b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.CellAreaLinks</code>.
+* This is a collection aff all links present
+* in a Spreadsheet document.
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::sheet::XAreaLinks</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.sheet.XAreaLinks
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.sheet._XAreaLinks
+* @see com.sun.star.sheet.CellAreaLinks
+*/
+public class ScAreaLinksObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of Area Links using the 'AreaLinks'
+ * property of the Spreadsheet document. Adds a new link to this
+ * collection, which has a source in the same document. The
+ * link collection is passed as a tested object.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log){
+
+ XInterface oObj = null;
+ TestEnvironment tEnv = null ;
+
+ try {
+
+ // creation of testobject here
+ XPropertySet props = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, xSheetDoc);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ;
+ XAreaLinks links = null ;
+
+ // adding one link into collection (for best testing)
+ links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ;
+ CellAddress addr = new CellAddress ((short) 1,2,3) ;
+ String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
+ links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ;
+
+ // creating test environment
+ tEnv = new TestEnvironment(oObj);
+
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ return tEnv ;
+ }
+
+} // finish class ScAreaLinksObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java
new file mode 100644
index 000000000000..9fd4c73109b5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.TableAutoFormatField</code>.
+* In StarCalc application there is a collection of autoformats
+* for tables (you can select a predefined format for a
+* table or create your own). Each autoformat has a number
+* of fields with definitions of font parameters, number
+* formats etc. for different parts of a table (column and
+* row names, footers, data). This object represents the
+* field of the same kind. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::TableAutoFormatField</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.sheet.TableAutoFormatField
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._TableAutoFormatField
+* @see ifc.beans._XPropertySet
+*/
+public class ScAutoFormatFieldObj extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Using SOffice ServiceManager an instance of
+ * <code>com.sun.star.sheet.TableAutoFormatField</code> service
+ * is created. From this collection one Format is retrieved
+ * and then from this format one of its compound fields is
+ * retrieved.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+
+ log.println ("create Object ...") ;
+ // creation of testobject here
+ XInterface formats = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sheet.TableAutoFormats");
+ XIndexAccess formatsIndex = (XIndexAccess)UnoRuntime.queryInterface
+ (XIndexAccess.class, formats);
+ XInterface format = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),formatsIndex.getByIndex(0));
+ XIndexAccess formatIndex = (XIndexAccess) UnoRuntime.queryInterface
+ (XIndexAccess.class, format);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),formatIndex.getByIndex(0));
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ return tEnv;
+ }
+
+} // finish class ScAutoFormatFieldObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java
new file mode 100644
index 000000000000..4731dac7e335
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.TableAutoFormat</code>. <p>
+* In StarCalc application there is a collection of autoformats
+* for tables (you can select a predefined format for a
+* table or create your own). This object represents
+* one of these autoformats. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::sheet::TableAutoFormat</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.sheet.TableAutoFormat
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.sheet._TableAutoFormat
+* @see ifc.beans._XPropertySet
+*/
+public class ScAutoFormatObj extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Using SOffice ServiceManager an instance of
+ * <code>com.sun.star.sheet.TableAutoFormatField</code> service
+ * is created. From this collection one Format is retrieved as
+ * object tested.
+ */
+ public TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+
+ XInterface oObj = null;
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)(XMultiServiceFactory)tParam.getMSF();
+ try {
+ XInterface formats = (XInterface)oMSF.createInstance
+ ("com.sun.star.sheet.TableAutoFormats");
+ XIndexAccess formatsIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, formats);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),formatsIndex.getByIndex
+ (formatsIndex.getCount() - 1));
+
+ XNamed objNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, oObj) ;
+ log.println("AutoFormat name is '" + objNamed.getName() + "'") ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
new file mode 100644
index 000000000000..70f051f8f0d6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.TableAutoFormats</code>. <p>
+* In StarCalc application there is a collection of autoformats
+* for tables (you can select a predefined format for a
+* table or create your own). The object represents
+* this collection. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.container.XNameContainer
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XNameReplace
+* @see ifc.container._XNameContainer
+*/
+public class ScAutoFormatsObj extends TestCase{
+ static XSpreadsheetDocument xSheetDoc = null;
+ static SOfficeFactory SOF = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sheet.TableAutoFormats</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XNameContainer},
+ * {@link ifc.container._XNameReplace} N relations
+ * which represents objects to be inserted - one
+ * object for each interface thread. </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ // creation of testobject here
+ // get AutoFormats
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sheet.TableAutoFormats"));
+ Object secondInstance = SOF.createInstance
+ (xComp, "com.sun.star.sheet.TableAutoFormat");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ //adding ObjRelation for XNameContainer
+ tEnv.addObjRelation("SecondInstance",secondInstance);
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+ int THRCNT = 1;
+ if ((String)Param.get("THRCNT") != null) {
+ Integer.parseInt((String)Param.get("THRCNT"));
+ }
+ for (int n = 1; n < (THRCNT+1) ;n++ ) {
+ log.println( "adding INSTANCE" + n
+ +" as mod relation to environment" );
+ tEnv.addObjRelation("INSTANCE" + n, SOF.createInstance(xComp,
+ "com.sun.star.sheet.TableAutoFormat"));
+ }
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+ }
+
+} // finish class ScAutoFormatsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java
new file mode 100644
index 000000000000..1baa4c21d8a0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java
@@ -0,0 +1,326 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetCellRange;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.sheet._XCellRangesQuery;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.SheetCellCursor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::sheet::XUsedAreaCursor</code></li>
+* <li> <code>com::sun::star::table::CellProperties</code></li>
+* <li> <code>com::sun::star::table::XCellRange</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeAddressable</code></li>
+* <li> <code>com::sun::star::table::XCellCursor</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCellCursor</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::sheet::XSheetOperation</code></li>
+* <li> <code>com::sun::star::sheet::XArrayFormulaRange</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCellRange</code></li>
+* <li> <code>com::sun::star::sheet::SheetCellRange</code></li>
+* <li> <code>com::sun::star::chart::XChartData</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::util::XMergeable</code></li>
+* <li> <code>com::sun::star::table::XColumnRowRange</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetCellCursor
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.sheet.XUsedAreaCursor
+* @see com.sun.star.table.CellProperties
+* @see com.sun.star.table.XCellRange
+* @see com.sun.star.sheet.XCellRangeAddressable
+* @see com.sun.star.table.XCellCursor
+* @see com.sun.star.sheet.XSheetCellCursor
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.sheet.XSheetOperation
+* @see com.sun.star.sheet.XArrayFormulaRange
+* @see com.sun.star.sheet.XSheetCellRange
+* @see com.sun.star.sheet.SheetCellRange
+* @see com.sun.star.chart.XChartData
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.util.XMergeable
+* @see com.sun.star.table.XColumnRowRange
+* @see ifc.style._ParagraphProperties
+* @see ifc.sheet._XUsedAreaCursor
+* @see ifc.table._CellProperties
+* @see ifc.table._XCellRange
+* @see ifc.sheet._XCellRangeAddressable
+* @see ifc.table._XCellCursor
+* @see ifc.sheet._XSheetCellCursor
+* @see ifc.style._CharacterProperties
+* @see ifc.sheet._XSheetOperation
+* @see ifc.sheet._XArrayFormulaRange
+* @see ifc.sheet._XSheetCellRange
+* @see ifc.sheet._SheetCellRange
+* @see ifc.chart._XChartData
+* @see ifc.beans._XPropertySet
+* @see ifc.util._XMergeable
+* @see ifc.table._XColumnRowRange
+*/
+public class ScCellCursorObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them, retrieves some cell range and creates cursor range
+ * that is instance of the service
+ * <code>com.sun.star.sheet.SheetCellCursor</code>,
+ * fills some cells in the cell range.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SHEET'</code> for
+ * {@link ifc.table._XCellCursor},
+ * {@link ifc.sheet._XArrayFormulaRange} (the spreadsheet that was
+ * retieved from collection)</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ TestEnvironment tEnv = null;
+ XSpreadsheet oSheet = null;
+ XCellRange testRange = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("Creating a test environment");
+
+ XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface(
+ XSpreadsheetDocument.class,
+ xSheetDoc)).getSheets();
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oSpreadsheets.getByName(
+ oSpreadsheets.getElementNames()[0]));
+
+ testRange = oSheet.getCellRangeByName("$A$1:$D$4");
+
+ XSheetCellRange testSheetRange = (XSheetCellRange) UnoRuntime.queryInterface(
+ XSheetCellRange.class,
+ testRange);
+ oObj = oSheet.createCursorByRange(testSheetRange);
+ oSheet.getCellByPosition(1, 1).setValue(1);
+ oSheet.getCellByPosition(4, 5).setValue(1);
+ oSheet.getCellByPosition(3, 2).setFormula("xTextDoc");
+ oSheet.getCellByPosition(3, 3).setFormula("xTextDoc");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while creating test object:");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Exception occured while creating test object:");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while creating test object:");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while creating test object:");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ log.println("Test object successfully created.");
+
+ tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("CRDESC",
+ "Column and RowDescriptions can't be changed for this Object");
+
+ tEnv.addObjRelation("SHEET", oSheet);
+ // add expected results for the XCellRangesQuery interface test
+ String[]expectedResults = new String[7];
+ expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.B1";
+ expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "Sheet1.B2";
+ expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "Sheet1.A1 ... Sheet1.B1 ... Sheet1.B3 ... Sheet1.C1 ... Sheet1.D1";
+ expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "Sheet1.D4";
+ expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.A2;Sheet1.C2";
+ expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.A2";
+ tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults);
+
+ tEnv.addObjRelation("NewData",
+ new Object[][]
+ {
+ { "", "", "", "" },
+ { "", "2", "3", "4" },
+ { "", "2", "3", "4" },
+ { "", "2", "3", "4" }
+ });
+
+ XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet", PropSet);
+
+ //Adding relation for util.XSortable
+ final PrintWriter finalLog = log;
+ final XCellRange oTable = testRange;
+ tEnv.addObjRelation("SORTCHECKER",
+ new ifc.util._XSortable.XSortChecker() {
+ PrintWriter out = finalLog;
+
+ public void setPrintWriter(PrintWriter log) {
+ out = log;
+ }
+
+ public void prepareToSort() {
+ try {
+ oTable.getCellByPosition(0, 0).setValue(4);
+ oTable.getCellByPosition(0, 1).setFormula("b");
+ oTable.getCellByPosition(0, 2).setValue(3);
+ oTable.getCellByPosition(0, 3).setValue(23);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending) {
+ out.println("Sort checking...");
+
+ boolean res = false;
+ String[] value = new String[4];
+
+ for (int i = 0; i < 4; i++) {
+ try {
+ XCell cell = oTable.getCellByPosition(0, i);
+ value[i] = cell.getFormula();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ out.println("Sorting ascending");
+
+ String[] rightVal = { "3", "4", "23", "b" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ } else {
+ if (isSortAscending) {
+ String[] rightVal = { "3", "4", "23", "b" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ }
+
+ if (res) {
+ out.println("Sorted correctly");
+ } else {
+ out.println("Sorted uncorrectly");
+ }
+
+ return res;
+ }
+ });
+
+ return tEnv;
+ }
+} // finish class ScCellCursorObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java
new file mode 100644
index 000000000000..1b39d32a3c2d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object that represents a text field (implements
+* <code>com.sun.star.text.TextField</code>) which inserted in a cell of
+* the spreadsheet. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::text::XTextField</code></li>
+* <li> <code>com::sun::star::text::XTextContent</code></li>
+* <li> <code>com::sun::star::text::TextContent</code></li>
+* </ul>
+* @see com.sun.star.text.TextField
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.text.XTextField
+* @see com.sun.star.text.XTextContent
+* @see com.sun.star.text.TextContent
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.text._XTextField
+* @see ifc.text._XTextContent
+* @see ifc.text._TextContent
+*/
+public class ScCellFieldObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.TextField.URL</code>, inserts it to the content
+ * of the cell in the spreadsheet, retrieves a text content
+ * <code>com.sun.star.text.XTextContent</code> from the cell.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TRO'</code> for
+ * {@link ifc.text._TextContent} </li>
+ * <li> <code>'CONTENT'</code> for
+ * {@link ifc.text._XTextContent} (type of
+ * <code>com.sun.star.text.XTextContent</code> that was queried from
+ * the newly created service <code>com.sun.star.text.TextField.URL</code>)</li>
+ * <li> <code>'TEXT'</code> for
+ * {@link ifc.text._XTextContent} (the text of the cell)</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XText oText = null;
+ XTextContent oContent = null;
+ XInterface aField = null;
+
+ try {
+ // we want to create an instance of ScCellFieldObj.
+ // to do this we must get an MultiServiceFactory.
+
+ XMultiServiceFactory _oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc);
+
+ // Now create the instance of com.sun.star.text.TextField.
+ // This object has type ScCellFieldObj.
+
+ oObj = (XInterface)
+ _oMSF.createInstance("com.sun.star.text.TextField.URL");
+
+ aField = (XInterface)
+ _oMSF.createInstance("com.sun.star.text.TextField.URL");
+ oContent = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, aField);
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ XCell oCell = oSheet.getCellByPosition(2,3);
+ oText = (XText)UnoRuntime.queryInterface(XText.class, oCell);
+
+ XTextContent oTextContent = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oObj);
+
+ oText.insertTextContent(
+ oText.createTextCursor(), oTextContent, true);
+
+ oCell = oSheet.getCellByPosition(1,4);
+ oText = (XText)UnoRuntime.queryInterface(XText.class, oCell);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ log.println ("Object created.") ;
+ tEnv.addObjRelation("TRO", new Boolean(true));
+
+ tEnv.addObjRelation("CONTENT",oContent);
+ tEnv.addObjRelation("TEXT",oText);
+
+ return tEnv;
+ }
+
+} // finish class ScCellFieldObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java
new file mode 100644
index 000000000000..b410257f7ba9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object that represents a colection of text fields
+ * in a cell of a spreadsheet. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::util::XRefreshable</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.util.XRefreshable
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.util._XRefreshable
+ * @see ifc.container._XElementAccess
+ */
+public class ScCellFieldsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.TextField.URL</code>, inserts it to the content
+ * of the cell in the spreadsheet. Then the component is obtained
+ * by <code>XTextFieldsSupplier</code> interface of a cell.<p>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XText oText = null;
+ XTextContent oContent = null;
+ XInterface aField = null;
+
+ try {
+ // we want to create an instance of ScCellFieldObj.
+ // to do this we must get an MultiServiceFactory.
+
+ XMultiServiceFactory _oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc);
+
+ aField = (XInterface)
+ _oMSF.createInstance("com.sun.star.text.TextField.URL");
+ oContent = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, aField);
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ XCell oCell = oSheet.getCellByPosition(2,3);
+ oText = (XText)UnoRuntime.queryInterface(XText.class, oCell);
+
+ oText.insertTextContent(
+ oText.createTextCursor(), oContent, true);
+
+ XTextFieldsSupplier xTextFieldsSupp = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell);
+
+ oObj = xTextFieldsSupp.getTextFields();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java
new file mode 100644
index 000000000000..a920559dbc7c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellFormatRangesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.CellFormatRangesEnumeration</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XEnumeration</code></li>
+* </ul>
+* @see com.sun.star.sheet.CellFormatRangesEnumeration
+* @see com.sun.star.container.XEnumeration
+* @see ifc.container._XEnumeration
+*/
+public class ScCellFormatsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Then retrieves a collection of cell format range
+ * using the interface <code>XCellFormatRangesSupplier</code>, creates the
+ * enumeration of this collection using interface <code>XEnumerationAccess</code>.
+ * This enumeration is the instance of the service
+ * <code>com.sun.star.sheet.CellFormatRangesEnumeration</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ENUM'</code> for
+ * {@link ifc.container._XEnumeration} (type of
+ * <code>XEnumerationAccess</code> that was queried from the collection
+ * of cell format range)</li>
+ * </ul>
+ * @see com.sun.star.sheet.CellFormatRangesEnumeration
+ * @see com.sun.star.sheet.XCellFormatRangesSupplier
+ * @see com.sun.star.container.XEnumerationAccess
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("getting CellFormats");
+
+ XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier)
+ UnoRuntime.queryInterface(XCellFormatRangesSupplier.class,oSheet);
+ XIndexAccess formats = xCFRS.getCellFormatRanges();
+
+ log.println("getting Enumeration");
+ XEnumerationAccess oEnum = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,formats);
+ oObj = oEnum.createEnumeration();
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("ENUM", oEnum);
+
+ return tEnv;
+ }
+
+} // finish class ScCellFormatsEnumeration
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java
new file mode 100644
index 000000000000..915891919bc0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellFormatRangesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.CellFormatRanges</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.CellFormatRanges
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XEnumerationAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScCellFormatsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Then retrieves a collection of format cell
+ * range using the interface <code>XCellFormatRangesSupplier</code> that is
+ * instance of service <code>com.sun.star.sheet.CellFormatRanges</code>.
+ * @see com.sun.star.sheet.CellFormatRanges
+ * @see com.sun.star.sheet.XCellFormatRangesSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("getting CellFormats");
+ XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier)
+ UnoRuntime.queryInterface(XCellFormatRangesSupplier.class, oSheet);
+ XIndexAccess formats = xCFRS.getCellFormatRanges();
+
+ oObj = formats;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+} // finish class ScCellFormatsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellObj.java b/qadevOOo/tests/java/mod/_sc/ScCellObj.java
new file mode 100644
index 000000000000..bd19c78a3da8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.sheet._XCellRangesQuery;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.SheetCell</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::table::CellProperties</code></li>
+* <li> <code>com::sun::star::text::XSimpleText</code></li>
+* <li> <code>com::sun::star::table::XCell</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::document::XActionLockable</code></li>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::text::XText</code></li>
+* <li> <code>com::sun::star::sheet::XCellAddressable</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetCell
+* @see com.sun.star.table.CellProperties
+* @see com.sun.star.text.XSimpleText
+* @see com.sun.star.table.XCell
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.document.XActionLockable
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.text.XText
+* @see com.sun.star.sheet.XCellAddressable
+* @see ifc.table._CellProperties
+* @see ifc.text._XSimpleText
+* @see ifc.table._XCell
+* @see ifc.text._XTextRange
+* @see ifc.beans._XPropertySet
+* @see ifc.style._CharacterProperties
+* @see ifc.document._XActionLockable
+* @see ifc.style._ParagraphProperties
+* @see ifc.text._XText
+* @see ifc.sheet._XCellAddressable
+*/
+public class ScCellObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "Creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Retrieves some cell from the spreadsheet
+ * that is instance of the service <code>com.sun.star.sheet.SheetCell</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XTEXTINFO',</code> for
+ * {@link ifc.text._XText} </li>
+ * </ul>
+ * @see com.sun.star.sheet.SheetCell
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ XSpreadsheet oSheet = null;
+ XCell cell = null;
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet") ;
+ oObj = oSheet.getCellByPosition(2, 3) ;
+ cell = (XCell)UnoRuntime.queryInterface(XCell.class, oObj);
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ log.println( "creating a new environment for ScCellObj object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Object relations for interface tests
+ DefaultDsc tDsc = new DefaultDsc(
+ "com.sun.star.text.XTextContent", "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xSheetDoc, tDsc ) );
+ // add the sheet
+ tEnv.addObjRelation("SHEET", oSheet);
+ // add expected results for the XCellRangesQuery interface test
+ String[]expectedResults = new String[7];
+
+ expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.C4";
+ expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "Sheet1.C4";
+ expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "";
+ expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.C4";
+ expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.C4";
+ tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults);
+ tEnv.addObjRelation("XCellRangesQuery.CREATEENTRIES", Boolean.TRUE);
+
+ // make entries in this cell at the interface test
+ tEnv.addObjRelation("XTextFieldsSupplier.MAKEENTRY", Boolean.TRUE);
+ tEnv.addObjRelation("MAKEENTRYINCELL", cell);
+
+ // for XSearchable amd XReplaceable interface test
+ tEnv.addObjRelation("XSearchable.MAKEENTRYINCELL", cell);
+ tEnv.addObjRelation("EXCLUDEFINDNEXT", Boolean.TRUE);
+
+ // for XFormulaQuery interface test
+ tEnv.addObjRelation("EXPECTEDDEPENDENTVALUES", new int[]{2,2,3,3});
+ tEnv.addObjRelation("EXPECTEDPRECEDENTVALUES", new int[]{0,3,0,0});
+ tEnv.addObjRelation("RANGEINDICES", new int[]{0,0});
+
+ // XTextFieldsSupplier
+ tEnv.addObjRelation("SPREADSHEET", xSheetDoc);
+
+ XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet",PropSet);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScCellObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java
new file mode 100644
index 000000000000..b7b119c3b3b3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java
@@ -0,0 +1,312 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.sheet._XCellRangesQuery;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.SheetCellRange</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::table::CellProperties</code></li>
+* <li> <code>com::sun::star::util::XMergeable</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeAddressable</code></li>
+* <li> <code>com::sun::star::sheet::XArrayFormulaRange</code></li>
+* <li> <code>com::sun::star::chart::XChartData</code></li>
+* <li> <code>com::sun::star::table::XColumnRowRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::sheet::XSheetOperation</code></li>
+* <li> <code>com::sun::star::table::XCellRange</code></li>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::sheet::SheetCellRange</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetCellRange
+* @see com.sun.star.table.CellProperties
+* @see com.sun.star.util.XMergeable
+* @see com.sun.star.sheet.XCellRangeAddressable
+* @see com.sun.star.sheet.XArrayFormulaRange
+* @see com.sun.star.chart.XChartData
+* @see com.sun.star.table.XColumnRowRange
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.sheet.XSheetOperation
+* @see com.sun.star.table.XCellRange
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.sheet.SheetCellRange
+* @see ifc.table._CellProperties
+* @see ifc.util._XMergeable
+* @see ifc.sheet._XCellRangeAddressable
+* @see ifc.sheet._XArrayFormulaRange
+* @see ifc.chart._XChartData
+* @see ifc.table._XColumnRowRange
+* @see ifc.beans._XPropertySet
+* @see ifc.style._CharacterProperties
+* @see ifc.sheet._XSheetOperation
+* @see ifc.table._XCellRange
+* @see ifc.style._ParagraphProperties
+* @see ifc.sheet._SheetCellRange
+*/
+public class ScCellRangeObj extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Retrieves some cell range from the spreadsheet.
+ * The retrieved cell range is instance of the service
+ * <code>com.sun.star.sheet.SheetCellRange</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SHEET'</code> for
+ * {@link ifc.sheet._XArrayFormulaRange} (the spreadsheet which the cell
+ * range was retrieved from)</li>
+ * </ul>
+ * @see com.sun.star.sheet.XSpreadsheet
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XCellRange testRange;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("Creating a test environment");
+
+ XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface(
+ XSpreadsheetDocument.class,
+ xSheetDoc)).getSheets();
+ XNameAccess oNames = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class, oSpreadsheets);
+
+ XSpreadsheet oSheet = null;
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+
+ oObj = oSheet.getCellRangeByPosition(0, 0, 3, 4);
+ testRange = (XCellRange) UnoRuntime.queryInterface(
+ XCellRange.class, oObj);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("SHEET", oSheet);
+ // add expected results for the XCellRangesQuery interface test
+ String[]expectedResults = new String[7];
+ expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.B1:C1;Sheet1.B3";
+ expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "Sheet1.B2:B3";
+ expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "Sheet1.A1 ... Sheet1.B1 ... Sheet1.B5 ... Sheet1.C3 ... Sheet1.D1";
+ expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "Sheet1.C2";
+ expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "Sheet1.D4";
+ expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.A2:A4;Sheet1.C2:D4";
+ expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.A2";
+ tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults);
+ tEnv.addObjRelation("XCellRangesQuery.CREATEENTRIES", Boolean.TRUE);
+
+ XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet", PropSet);
+
+ // XSearchable: Add a cell to make a seacrchable entry
+ try {
+ tEnv.addObjRelation("XSearchable.MAKEENTRYINCELL", new XCell[] {
+ testRange.getCellByPosition(0,0), testRange.getCellByPosition(0,1)});
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e){
+ e.printStackTrace((PrintWriter)log);
+ log.println("Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'.");
+ }
+
+ // XCellRangeData
+/* Object[][] newData = new Object[5][4];
+ for (int i=0; i<newData.length; i++) {
+ for (int j=0; j<newData[i].length; j++) {
+ newData[i][j] = new Double(i*10+j);
+ }
+ }
+ tEnv.addObjRelation("NewData", newData); */
+
+ //Adding relation for util.XSortable
+ final PrintWriter finalLog = log;
+ final XCellRange oTable = testRange;
+ tEnv.addObjRelation("SORTCHECKER",
+ new ifc.util._XSortable.XSortChecker() {
+ PrintWriter out = finalLog;
+
+ public void setPrintWriter(PrintWriter log) {
+ out = log;
+ }
+
+ public void prepareToSort() {
+ try {
+ oTable.getCellByPosition(0, 0).setValue(4);
+ oTable.getCellByPosition(0, 1).setFormula("b");
+ oTable.getCellByPosition(0, 2).setValue(3);
+ oTable.getCellByPosition(0, 3).setValue(23);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending) {
+ out.println("Sort checking...");
+
+ boolean res = false;
+ String[] value = new String[4];
+
+ for (int i = 0; i < 4; i++) {
+ try {
+ XCell cell = oTable.getCellByPosition(0, i);
+ value[i] = cell.getFormula();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ out.println("Sorting ascending");
+
+ String[] rightVal = { "3", "4", "23", "b" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ } else {
+ if (isSortAscending) {
+ String[] rightVal = { "3", "4", "23", "b" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ }
+
+ if (res) {
+ out.println("Sorted correctly");
+ } else {
+ out.println("Sorted uncorrectly");
+ }
+
+ return res;
+ }
+ });
+
+ return tEnv;
+ }
+} // finish class ScCellRangeObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java
new file mode 100644
index 000000000000..9d4216a0132c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.sheet._XCellRangesQuery;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.SheetCellRanges</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::table::CellProperties</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCellRangeContainer</code></li>
+* <li> <code>com::sun::star::sheet::XSheetOperation</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCellRanges</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetCellRanges
+* @see com.sun.star.table.CellProperties
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.container.XNameContainer
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.sheet.XSheetCellRangeContainer
+* @see com.sun.star.sheet.XSheetOperation
+* @see com.sun.star.sheet.XSheetCellRanges
+* @see com.sun.star.container.XNameAccess
+* @see ifc.table._CellProperties
+* @see ifc.container._XNameReplace
+* @see ifc.container._XNameContainer
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XEnumerationAccess
+* @see ifc.sheet._XSheetCellRangeContainer
+* @see ifc.sheet._XSheetOperation
+* @see ifc.sheet._XSheetCellRanges
+* @see ifc.container._XNameAccess
+*/
+public class ScCellRangesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp =
+ (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sheet.SheetCellRanges</code> and fills some cells.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XNameReplace},
+ * {@link ifc.container._XNameContainer} (type of
+ * <code>XCellRange</code>)</li>
+ * <li> <code>'THRCNT'</code> for
+ * {@link ifc.container._XNameReplace}(the number of the running threads
+ * that was retrieved from the method parameter <code>Param</code>)</li>
+ * <li> <code>'NameReplaceIndex'</code> for
+ * {@link ifc.container._XNameReplace} </li>
+ * </ul>
+ * @see com.sun.star.table.XCellRange
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oRange = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+
+ log.println("Getting test object ");
+
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+
+ oObj = (XInterface)
+ SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges");
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndSheets = (XIndexAccess)
+ UnoRuntime.queryInterface (XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class), oIndSheets.getByIndex(0));
+ XNameContainer oRanges = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj);
+
+ oRange = oSheet.getCellRangeByName("C1:D4");
+ oRanges.insertByName("Range1", oRange);
+ oRange = oSheet.getCellRangeByName("E2:F5");
+ oRanges.insertByName("Range2", oRange);
+ oRange = oSheet.getCellRangeByName("G2:H3");
+ oRanges.insertByName("Range3", oRange);
+ oRange = oSheet.getCellRangeByName("I7:J8");
+ oRanges.insertByName("Range4", oRange);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 5; j++) {
+ oSheet.getCellByPosition(i, j).setFormula("a");
+ }
+ }
+ for (int i = 0; i < 10; i++) {
+ for (int j = 5; j < 10; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i + j);
+ }
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException (
+ "Exception occurred while filling cells", e);
+ }
+
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // NameReplaceIndex : _XNameReplace
+ log.println( "adding NameReplaceIndex as mod relation to environment" );
+ tEnv.addObjRelation("NameReplaceIndex", "0");
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+
+ int THRCNT = 1;
+ if ((String)Param.get("THRCNT") != null) {
+ THRCNT= Integer.parseInt((String)Param.get("THRCNT"));
+ }
+ int a = 0;
+ int b = 0;
+ for (int n = 1; n < (THRCNT + 1) ; n++) {
+ a = n * 2;
+ b = a + 1;
+ oRange = oSheet.getCellRangeByName("A" + a + ":B" + b);
+ log.println(
+ "adding INSTANCE" + n + " as mod relation to environment" );
+
+ tEnv.addObjRelation("INSTANCE" + n, oRange);
+ }
+
+ XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet",PropSet);
+ tEnv.addObjRelation("SHEET", oSheet);
+ // add expected results for the XCellRangesQuery interface test
+ String[]expectedResults = new String[7];
+ expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.I7:J8";
+ expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "";
+ expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "Sheet1.D4";
+ expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.I7:J8";
+ expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.C2:D4"; // first range, first line invisible
+ tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS", expectedResults);
+
+ // for XSearchable and XReplaceable interface test
+ tEnv.addObjRelation("SEARCHSTRING", "15");
+
+ // for XFormulaQuery interface test
+ tEnv.addObjRelation("EXPECTEDDEPENDENTVALUES", new int[]{4,5,1,4});
+ tEnv.addObjRelation("EXPECTEDPRECEDENTVALUES", new int[]{4,5,1,4});
+ return tEnv ;
+ }
+
+} // finish class ScCellRangesObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java
new file mode 100644
index 000000000000..60d9cc9f38b2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XSearchable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.util.SearchDescriptor</code> that was implemented by
+* a spreadsheet. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::util::XSearchDescriptor</code></li>
+* <li> <code>com::sun::star::util::SearchDescriptor</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::util::XReplaceDescriptor</code></li>
+* </ul>
+* @see com.sun.star.util.SearchDescriptor
+* @see com.sun.star.util.XSearchDescriptor
+* @see com.sun.star.util.SearchDescriptor
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.util.XReplaceDescriptor
+* @see ifc.util._XSearchDescriptor
+* @see ifc.util._SearchDescriptor
+* @see ifc.beans._XPropertySet
+* @see ifc.util._XReplaceDescriptor
+*/
+public class ScCellSearchObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Creates search descriptor using the interface
+ * <code>XSearchable</code>. The created search descriptor is instance of
+ * the service <code>com.sun.star.util.SearchDescriptor</code> that
+ * implemented by a spreasheet.
+ * @see com.sun.star.util.XSearchable
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ 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 sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ XSearchable xSearch = (XSearchable)
+ UnoRuntime.queryInterface(XSearchable.class,oSheet);
+
+ oObj = xSearch.createSearchDescriptor();
+ // create testobject here
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ScCellSearchObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java
new file mode 100644
index 000000000000..56a79463d0aa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.TextCursor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XTextCursor</code></li>
+* <li> <code>com::sun::star::text::XWordCursor</code></li>
+* <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XContentEnumerationAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::text::XSentenceCursor</code></li>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::text::XParagraphCursor</code></li>
+* <li> <code>com::sun::star::document::XDocumentInsertable</code></li>
+* <li> <code>com::sun::star::util::XSortable</code></li>
+* <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
+* </ul>
+* @see com.sun.star.text.TextCursor
+* @see com.sun.star.text.XTextCursor
+* @see com.sun.star.text.XWordCursor
+* @see com.sun.star.style.CharacterPropertiesComplex
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XContentEnumerationAccess
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.text.XSentenceCursor
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.text.XParagraphCursor
+* @see com.sun.star.document.XDocumentInsertable
+* @see com.sun.star.util.XSortable
+* @see com.sun.star.style.CharacterPropertiesAsian
+* @see ifc.text._XTextCursor
+* @see ifc.text._XWordCursor
+* @see ifc.style._CharacterPropertiesComplex
+* @see ifc.text._XTextRange
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XContentEnumerationAccess
+* @see ifc.beans._XPropertyState
+* @see ifc.style._CharacterProperties
+* @see ifc.text._XSentenceCursor
+* @see ifc.style._ParagraphProperties
+* @see ifc.text._XParagraphCursor
+* @see ifc.document._XDocumentInsertable
+* @see ifc.util._XSortable
+* @see ifc.style._CharacterPropertiesAsian
+*/
+public class ScCellTextCursor extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Retrieves the cell from the spreadsheet
+ * and creates text cursor of the cell using the interface
+ * <code>XText</code>. This text cursor is the instance of
+ * the service <code>com.sun.star.text.TextCursor</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XTEXT'</code> for
+ * {@link ifc.text._XTextRange} (type of
+ * <code>XEnumerationAccess</code> that was retrieved from the
+ * collection of visible cells)</li>
+ * </ul>
+ * @see com.sun.star.text.XText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XCell aCell = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ // get a soffice factory object
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet") ;
+ aCell = oSheet.getCellByPosition(1,1) ;
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document",e) ;
+ }
+
+ XText aText = (XText) UnoRuntime.queryInterface(XText.class, aCell);
+ aText.setString("ScCellTextCursor");
+ oObj = aText.createTextCursor();
+
+ log.println( "creating a new environment for ScCellTextCursor object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Object relations for interface tests
+ tEnv.addObjRelation("XTEXT", aText);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScCellTextCursor
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java
new file mode 100644
index 000000000000..f394e1dd9dbb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangesQuery;
+import com.sun.star.sheet.XSheetCellRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.CellsEnumeration</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XEnumeration</code></li>
+* </ul>
+* @see com.sun.star.sheet.CellsEnumeration
+* @see com.sun.star.container.XEnumeration
+* @see ifc.container._XEnumeration
+*/
+public class ScCellsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Replaces text of some cells.
+ * Retrives a cell range of the visible cells using the interface
+ * <code>XCellRangesQuery</code>. Retrieves a collection of cells from
+ * this cell range and creates it's enumeration using the interface
+ * <code>XEnumerationAccess</code>.The created enumeration is the instance
+ * of the service <code>com.sun.star.sheet.CellsEnumeration</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ENUM'</code> for
+ * {@link ifc.container._XEnumeration} (type of
+ * <code>XEnumerationAccess</code> that was retrieved from the
+ * collection of visible cells)</li>
+ * </ul>
+ * @see com.sun.star.sheet.XCellRangesQuery
+ * @see com.sun.star.container.XEnumerationAccess
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object cellArr[] = new Object[3] ;
+ XEnumerationAccess oEnum = null;
+
+ // creation of testobject here
+ XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XCellRange oSheet = null;
+ try {
+ oSheet = (XCellRange) AnyConverter.toObject(
+ new Type(XCellRange.class),oIndexAccess.getByIndex(0));
+
+ XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0);
+ XTextRange oTextRange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, oCell_1);
+ oTextRange.setString("Test string 1");
+
+ XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1);
+ oCell_2.setValue(15);
+
+ XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9);
+ oTextRange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, oCell_3);
+ oTextRange.setString("test 2");
+ cellArr[0] = oCell_1;
+ cellArr[1] = oCell_2;
+ cellArr[2] = oCell_3;
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ XCellRangesQuery oCellRangesQuery = (XCellRangesQuery)
+ UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet);
+ XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells();
+ oEnum = (XEnumerationAccess) oSheetCellRanges.getCells();
+ oObj = oSheetCellRanges.getCells().createEnumeration();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // ENUM: XEnumeration
+ tEnv.addObjRelation("ENUM", oEnum);
+
+ return tEnv;
+ }
+
+} // finish class ScCellsEnumeration
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java
new file mode 100644
index 000000000000..dfaf72aa525f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangesQuery;
+import com.sun.star.sheet.XSheetCellRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.Cells</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.Cells
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XEnumerationAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScCellsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document,
+ * and takes one of them. Replaces text of some cells.
+ * Retrives a cell range of the visible cells using the interface
+ * <code>XCellRangesQuery</code>. Retrieves a collection of cells from
+ * this cell range, this collection is instance of the service
+ * <code>com.sun.star.sheet.Cells</code>.
+ * @see com.sun.star.sheet.XCellRangesQuery
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object cellArr[] = new Object[3];
+
+ // creation of testobject here
+ XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XCellRange oSheet = null;
+ try {
+ oSheet = (XCellRange) AnyConverter.toObject(
+ new Type(XCellRange.class),oIndexAccess.getByIndex(0));
+
+ XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0);
+ XTextRange oTextRange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, oCell_1);
+
+ oTextRange.setString("ScCellsObj test 1");
+
+ XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1);
+ oCell_2.setValue(15);
+
+ XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9);
+ oTextRange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, oCell_3);
+
+ oTextRange.setString("ScCellsObj test 2");
+
+ cellArr[0] = oCell_1;
+ cellArr[2] = oCell_2;
+ cellArr[1] = oCell_3;
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ XCellRangesQuery oCellRangesQuery = (XCellRangesQuery)
+ UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet);
+ XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells();
+
+ oObj = oSheetCellRanges.getCells();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+ log.println ("Object created.") ;
+
+ return tEnv;
+ }
+
+} // finish class ScCellsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java b/qadevOOo/tests/java/mod/_sc/ScChartObj.java
new file mode 100644
index 000000000000..ae94cf3358bb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java
@@ -0,0 +1,289 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.awt.Rectangle;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XTableChart;
+import com.sun.star.table.XTableCharts;
+import com.sun.star.table.XTableChartsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableChart</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::table::XTableChart</code></li>
+* <li> <code>com::sun::star::document::XEmbeddedObjectSupplier</code></li>
+* </ul>
+* @see com.sun.star.table.TableChart
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.table.XTableChart
+* @see com.sun.star.document.XEmbeddedObjectSupplier
+* @see ifc.container._XNamed
+* @see ifc.table._XTableChart
+* @see ifc.document._XEmbeddedObjectSupplier
+*/
+public class ScChartObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Inserts some values into the cells of the some cell
+ * range address. Adds the chart that using the data from the cells of this
+ * cell range address. New chart is the instance of
+ * the service <code>com.sun.star.table.TableChart</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'setName'</code> for
+ * {@link ifc.container._XNamed}(the method <code>setName</code> must
+ * not be tested)</li>
+ * </ul>
+ * @see com.sun.star.container.XNamed
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XSpreadsheet oSheet=null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ }
+
+ log.println("Creating the Header") ;
+
+ insertIntoCell(1,0,"JAN",oSheet,"");
+ insertIntoCell(2,0,"FEB",oSheet,"");
+ insertIntoCell(3,0,"MAR",oSheet,"");
+ insertIntoCell(4,0,"APR",oSheet,"");
+ insertIntoCell(5,0,"MAI",oSheet,"");
+ insertIntoCell(6,0,"JUN",oSheet,"");
+ insertIntoCell(7,0,"JUL",oSheet,"");
+ insertIntoCell(8,0,"AUG",oSheet,"");
+ insertIntoCell(9,0,"SEP",oSheet,"");
+ insertIntoCell(10,0,"OCT",oSheet,"");
+ insertIntoCell(11,0,"NOV",oSheet,"");
+ insertIntoCell(12,0,"DEC",oSheet,"");
+ insertIntoCell(13,0,"SUM",oSheet,"");
+
+ log.println("Fill the lines");
+
+ insertIntoCell(0,1,"Smith",oSheet,"");
+ insertIntoCell(1,1,"42",oSheet,"V");
+ insertIntoCell(2,1,"58.9",oSheet,"V");
+ insertIntoCell(3,1,"-66.5",oSheet,"V");
+ insertIntoCell(4,1,"43.4",oSheet,"V");
+ insertIntoCell(5,1,"44.5",oSheet,"V");
+ insertIntoCell(6,1,"45.3",oSheet,"V");
+ insertIntoCell(7,1,"-67.3",oSheet,"V");
+ insertIntoCell(8,1,"30.5",oSheet,"V");
+ insertIntoCell(9,1,"23.2",oSheet,"V");
+ insertIntoCell(10,1,"-97.3",oSheet,"V");
+ insertIntoCell(11,1,"22.4",oSheet,"V");
+ insertIntoCell(12,1,"23.5",oSheet,"V");
+ insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");
+
+ insertIntoCell(0,2,"Jones",oSheet,"");
+ insertIntoCell(1,2,"21",oSheet,"V");
+ insertIntoCell(2,2,"40.9",oSheet,"V");
+ insertIntoCell(3,2,"-57.5",oSheet,"V");
+ insertIntoCell(4,2,"-23.4",oSheet,"V");
+ insertIntoCell(5,2,"34.5",oSheet,"V");
+ insertIntoCell(6,2,"59.3",oSheet,"V");
+ insertIntoCell(7,2,"27.3",oSheet,"V");
+ insertIntoCell(8,2,"-38.5",oSheet,"V");
+ insertIntoCell(9,2,"43.2",oSheet,"V");
+ insertIntoCell(10,2,"57.3",oSheet,"V");
+ insertIntoCell(11,2,"25.4",oSheet,"V");
+ insertIntoCell(12,2,"28.5",oSheet,"V");
+ insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");
+
+ insertIntoCell(0,3,"Brown",oSheet,"");
+ insertIntoCell(1,3,"31.45",oSheet,"V");
+ insertIntoCell(2,3,"-20.9",oSheet,"V");
+ insertIntoCell(3,3,"-117.5",oSheet,"V");
+ insertIntoCell(4,3,"23.4",oSheet,"V");
+ insertIntoCell(5,3,"-114.5",oSheet,"V");
+ insertIntoCell(6,3,"115.3",oSheet,"V");
+ insertIntoCell(7,3,"-171.3",oSheet,"V");
+ insertIntoCell(8,3,"89.5",oSheet,"V");
+ insertIntoCell(9,3,"41.2",oSheet,"V");
+ insertIntoCell(10,3,"71.3",oSheet,"V");
+ insertIntoCell(11,3,"25.4",oSheet,"V");
+ insertIntoCell(12,3,"38.5",oSheet,"V");
+ insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");
+
+ // insert a chart
+
+ Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);
+
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+ XTableChartsSupplier oSupp = (XTableChartsSupplier)
+ UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);
+
+ log.println("Insert Chart");
+
+ XTableCharts oCharts = oSupp.getCharts();
+ oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true);
+
+ // get the TableChart
+ XTableChart oChart = null;
+ try {
+ XNameAccess names = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),UnoRuntime.queryInterface(
+ XNameAccess.class, oCharts));
+
+ oChart = (XTableChart) AnyConverter.toObject(
+ new Type(XTableChart.class),names.getByName("ScChartObj"));
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get TableChart");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get TableChart");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get TableChart");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oChart);
+
+ //adding ObjRelation 'setName' for 'XNamed'
+ tEnv.addObjRelation("setName", new Boolean(true));
+
+ return tEnv;
+ }
+
+ /**
+ * Inserts a value or a formula in the cell of the spreasheet.
+ * @param CellX is the column index of the cell
+ * @param CellY is the row index of the cell
+ * @param theValue string representation of the value
+ * @param TT1 specify the spreadsheet, the interface
+ * <code>com.sun.star.sheet.XSpreadsheet</code>
+ * @param flag if it's equal to <code>'V'</code> then the method inserts
+ * a double-value in the cell else it inserts a formula in the cell
+ */
+ public static void insertIntoCell(
+ int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag)
+ {
+ XCell oCell = null;
+
+ try {
+ oCell = TT1.getCellByPosition(CellX, CellY);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ System.out.println("Could not get Cell");
+ }
+
+ if (flag.equals("V")) {
+ oCell.setValue(new Float(theValue).floatValue());
+ } else {
+ oCell.setFormula(theValue);
+ }
+ } // end of insertIntoCell
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java
new file mode 100644
index 000000000000..4541e30cafa3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java
@@ -0,0 +1,273 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.awt.Rectangle;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XTableCharts;
+import com.sun.star.table.XTableChartsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableCharts</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::table::XTableCharts</code></li>
+* </ul>
+* @see com.sun.star.table.TableCharts
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.table.XTableCharts
+* @see ifc.container._XNameAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.table._XTableCharts
+*/
+public class ScChartsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Inserts some values into the cells of the some cell
+ * range address. Obtains the collection of the charts using the interface
+ * <code>XTableChartsSupplier</code>. Creates and adds the chart that using
+ * the data from the cells of this cell range address. Collection of
+ * the charts is the instance of the service
+ * <code>com.sun.star.table.TableCharts</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'RECT'</code> for
+ * {@link ifc.table._XTableCharts}(of type <code>Rectangle</code>
+ * the position of the chart)</li>
+ * <li> <code>'ADDR'</code> for
+ * {@link ifc.table._XTableCharts}(of type
+ * <code>com.sun.star.table.CellRangeAddress[]</code> data source ranges
+ * for chart creating)</li>
+ * </ul>
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.table.XTableChartsSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XSpreadsheet oSheet=null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ }
+
+ log.println("Creating the Header") ;
+
+ insertIntoCell(1,0,"JAN",oSheet,"");
+ insertIntoCell(2,0,"FEB",oSheet,"");
+ insertIntoCell(3,0,"MAR",oSheet,"");
+ insertIntoCell(4,0,"APR",oSheet,"");
+ insertIntoCell(5,0,"MAI",oSheet,"");
+ insertIntoCell(6,0,"JUN",oSheet,"");
+ insertIntoCell(7,0,"JUL",oSheet,"");
+ insertIntoCell(8,0,"AUG",oSheet,"");
+ insertIntoCell(9,0,"SEP",oSheet,"");
+ insertIntoCell(10,0,"OCT",oSheet,"");
+ insertIntoCell(11,0,"NOV",oSheet,"");
+ insertIntoCell(12,0,"DEC",oSheet,"");
+ insertIntoCell(13,0,"SUM",oSheet,"");
+
+ log.println("Fill the lines");
+
+ insertIntoCell(0,1,"Smith",oSheet,"");
+ insertIntoCell(1,1,"42",oSheet,"V");
+ insertIntoCell(2,1,"58.9",oSheet,"V");
+ insertIntoCell(3,1,"-66.5",oSheet,"V");
+ insertIntoCell(4,1,"43.4",oSheet,"V");
+ insertIntoCell(5,1,"44.5",oSheet,"V");
+ insertIntoCell(6,1,"45.3",oSheet,"V");
+ insertIntoCell(7,1,"-67.3",oSheet,"V");
+ insertIntoCell(8,1,"30.5",oSheet,"V");
+ insertIntoCell(9,1,"23.2",oSheet,"V");
+ insertIntoCell(10,1,"-97.3",oSheet,"V");
+ insertIntoCell(11,1,"22.4",oSheet,"V");
+ insertIntoCell(12,1,"23.5",oSheet,"V");
+ insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");
+
+ insertIntoCell(0,2,"Jones",oSheet,"");
+ insertIntoCell(1,2,"21",oSheet,"V");
+ insertIntoCell(2,2,"40.9",oSheet,"V");
+ insertIntoCell(3,2,"-57.5",oSheet,"V");
+ insertIntoCell(4,2,"-23.4",oSheet,"V");
+ insertIntoCell(5,2,"34.5",oSheet,"V");
+ insertIntoCell(6,2,"59.3",oSheet,"V");
+ insertIntoCell(7,2,"27.3",oSheet,"V");
+ insertIntoCell(8,2,"-38.5",oSheet,"V");
+ insertIntoCell(9,2,"43.2",oSheet,"V");
+ insertIntoCell(10,2,"57.3",oSheet,"V");
+ insertIntoCell(11,2,"25.4",oSheet,"V");
+ insertIntoCell(12,2,"28.5",oSheet,"V");
+ insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");
+
+ insertIntoCell(0,3,"Brown",oSheet,"");
+ insertIntoCell(1,3,"31.45",oSheet,"V");
+ insertIntoCell(2,3,"-20.9",oSheet,"V");
+ insertIntoCell(3,3,"-117.5",oSheet,"V");
+ insertIntoCell(4,3,"23.4",oSheet,"V");
+ insertIntoCell(5,3,"-114.5",oSheet,"V");
+ insertIntoCell(6,3,"115.3",oSheet,"V");
+ insertIntoCell(7,3,"-171.3",oSheet,"V");
+ insertIntoCell(8,3,"89.5",oSheet,"V");
+ insertIntoCell(9,3,"41.2",oSheet,"V");
+ insertIntoCell(10,3,"71.3",oSheet,"V");
+ insertIntoCell(11,3,"25.4",oSheet,"V");
+ insertIntoCell(12,3,"38.5",oSheet,"V");
+ insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");
+
+ // insert a chart
+ Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);
+
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+ XTableChartsSupplier oSupp = (XTableChartsSupplier)
+ UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);
+
+
+ log.println("Insert Chart");
+ XTableCharts oCharts = oSupp.getCharts();
+ oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oCharts);
+
+ tEnv.addObjRelation("RECT", oRect);
+ tEnv.addObjRelation("ADDR", oAddr);
+
+ return tEnv;
+ }
+
+ /**
+ * Inserts a value or a formula in the cell of the spreasheet.
+ * @param CellX is the column index of the cell
+ * @param CellY is the row index of the cell
+ * @param theValue string representation of the value
+ * @param TT1 specify the spreadsheet, the interface
+ * <code>com.sun.star.sheet.XSpreadsheet</code>
+ * @param flag if it's equal to <code>'V'</code> then the method inserts
+ * a double-value in the cell else it inserts a formula in the cell
+ */
+ public static void insertIntoCell(
+ int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) {
+
+ XCell oCell = null;
+
+ try {
+ oCell = TT1.getCellByPosition(CellX, CellY);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ System.out.println("Could not get Cell");
+ }
+
+ if (flag.equals("V")) {
+ oCell.setValue(new Float(theValue).floatValue());
+ } else {
+ oCell.setFormula(theValue);
+ }
+
+ } // end of insertIntoCell
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java
new file mode 100644
index 000000000000..d0338dc75653
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XConsolidatable;
+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.ConsolidationDescriptor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XConsolidationDescriptor</code></li>
+* </ul>
+* @see com.sun.star.sheet.ConsolidationDescriptor
+* @see com.sun.star.sheet.XConsolidationDescriptor
+* @see ifc.sheet._XConsolidationDescriptor
+*/
+public class ScConsolidationDescriptor extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Creates consolidation description using
+ * the interface <code>XConsolidatable</code>.
+ * This description is the instance of the service
+ * <code>com.sun.star.sheet.ConsolidationDescriptor</code>.
+ * @see com.sun.star.sheet.ConsolidationDescriptor
+ * @see com.sun.star.sheet.XConsolidatable
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ XConsolidatable xConsolidate = (XConsolidatable)
+ UnoRuntime.queryInterface(XConsolidatable.class, xSheetDoc);
+
+ oObj = xConsolidate.createConsolidationDescriptor(true);
+ // create testobject here
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScConsolidationDescriptor
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java
new file mode 100644
index 000000000000..4b080bee0a75
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DDELink</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::util::XRefreshable</code></li>
+* <li> <code>com::sun::star::sheet::XDDELink</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> ScDDELinksObj.sdc </b> : the predefined testdocument </li>
+* </ul> <p>
+* @see com.sun.star.sheet.DDELink
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.util.XRefreshable
+* @see com.sun.star.sheet.XDDELink
+* @see ifc.container._XNamed
+* @see ifc.util._XRefreshable
+* @see ifc.sheet._XDDELink
+*/
+public class ScDDELinkObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+ static XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document and testdocument if it was loaded already.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ if (oDoc != null) {
+ util.DesktopTools.closeDoc(oDoc);
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Disposes the testdocument if it was loaded already.
+ * Creates an instance of the <code>com.sun.star.frame.Desktop</code>
+ * and loads the predefined testdocument. Retrieves a collection of
+ * spreadsheets from a document and takes one of them. Sets specific formula
+ * to some cells in the spreadsheet(the formula specify DDE links to the
+ * testdocument). Retrieves the collection of DDE links in the document and
+ * retrives first DDE link from the collection.
+ * The retrived DDE link is the instance of the service
+ * <code>com.sun.star.sheet.DDELink</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'setName'</code> for
+ * {@link ifc.container._XNamed}(specify that the method
+ * <code>setName</code> must not be tested)</li>
+ * <li> <code>'APPLICATION'</code> for
+ * {@link ifc.sheet._XDDELink}(the name of the current application)</li>
+ * <li> <code>'ITEM'</code> for
+ * {@link ifc.sheet._XDDELink}(the DDE item that was set in the formula)</li>
+ * <li> <code>'TOPIC'</code> for
+ * {@link ifc.sheet._XDDELink}(the full testdocument name)</li>
+ * </ul>
+ * @see com.sun.star.frame.Desktop
+ * @see com.sun.star.sheet.DDELink
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ if (oDoc != null) {
+ util.DesktopTools.closeDoc(oDoc);
+ }
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ // create testobject here
+
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)Param.getMSF();
+
+ // load the predefined testdocument
+ String testdoc = util.utils.getFullTestURL("ScDDELinksObj.sdc");
+ try {
+ oDoc = SOfficeFactory.getFactory(oMSF).loadDocument(testdoc);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ }
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ String sAppl = "soffice";
+ String sItem = "Sheet1.A1";
+ testdoc = util.utils.getFullTestDocName("ScDDELinksObj.sdc");
+ try {
+ oSheet.getCellByPosition(5, 5).setFormula(
+ "=DDE(\""+ sAppl +"\";\""+testdoc+"\";\""+ sItem +"\"");
+ oSheet.getCellByPosition(1, 4).setFormula(
+ "=DDE(\""+ sAppl +"\";\""+testdoc+"\";\""+ sItem +"\"");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ try {
+ log.println("Getting test object ") ;
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ XNameAccess links = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class), UnoRuntime.queryInterface(
+ XNameAccess.class, docProps.getPropertyValue("DDELinks")));
+
+ String[] linkNames = links.getElementNames();
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),links.getByName(linkNames[0]));
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("APPLICATION", sAppl);
+ tEnv.addObjRelation("ITEM", sItem);
+ tEnv.addObjRelation("TOPIC", testdoc);
+ tEnv.addObjRelation("setName", new Boolean(true));
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java
new file mode 100644
index 000000000000..42d8f75dc78e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DDELinks</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> ScDDELinksObj.sdc </b> : the predefined testdocument </li>
+* </ul> <p>
+* @see com.sun.star.sheet.DDELinks
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScDDELinksObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+ static XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document and testdocument.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.
+ queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ util.DesktopTools.closeDoc(oDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Disposes the testdocument if it was loaded already.
+ * Creates an instance of the <code>com.sun.star.frame.Desktop</code>
+ * and loads the predefined testdocument. Retrieves a collection of
+ * spreadsheets from a document and takes one of them. Sets specific formula
+ * to some cells in the spreadsheet(the formula specify DDE links to the
+ * testdocument). Retrieves the collection of DDE links in the document.
+ * The retrived collection of DDE link is the instance of the service
+ * <code>com.sun.star.sheet.DDELinks</code>.
+ * @see com.sun.star.frame.Desktop
+ * @see com.sun.star.sheet.DDELinks
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)Param.getMSF();
+
+ // load the predefined testdocument
+ String testdoc = utils.getFullTestURL("ScDDELinksObj.sdc");
+ try {
+ oDoc = SOfficeFactory.getFactory(oMSF).loadDocument(testdoc);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ }
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ testdoc = utils.getFullTestDocName("ScDDELinksObj.sdc");
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ oSheet.getCellByPosition(1, 4).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ oSheet.getCellByPosition(2, 0).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ try {
+ log.println("Getting test object ") ;
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ oObj = (XInterface)AnyConverter.toObject(
+ new Type(XInterface.class),docProps.getPropertyValue("DDELinks"));
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java
new file mode 100644
index 000000000000..c011619a0687
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java
@@ -0,0 +1,371 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldGroupInfo;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotFieldGrouping;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+
+public class ScDataPilotFieldGroupItemObj extends TestCase
+{
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize (TestParameters tParam, PrintWriter log)
+ {
+ SOfficeFactory SOF = SOfficeFactory.getFactory (
+ (XMultiServiceFactory) tParam.getMSF ());
+
+ try
+ {
+ log.println ("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc (null);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ // Some exception occures.FAILED
+ e.printStackTrace (log);
+ throw new StatusException ("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup (TestParameters tParam, PrintWriter log)
+ {
+ log.println (" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface (
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc (oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment (TestParameters Param,
+ PrintWriter log)
+ {
+ XInterface oObj = null;
+ XInterface datapilotfield = null;
+ XInterface groups = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println ("Creating a test environment");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress ();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress ();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println ("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets ();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface (
+ XIndexAccess.class, xSpreadsheets);
+
+ try
+ {
+ oSheet = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (1));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+
+ try
+ {
+ log.println ("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ oSheet.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet.getCellByPosition (0, i).setFormula ("Row" + i);
+ oSheet2.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet2.getCellByPosition (0, i).setFormula ("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ for (int j = 1; j < mMaxFieldIndex; j++)
+ {
+ oSheet.getCellByPosition (i, j).setValue (i * (j + 1));
+ oSheet2.getCellByPosition (i, j).setValue (i * (j + 2));
+ }
+ }
+
+ oSheet.getCellByPosition (1, 1).setFormula ("aName");
+ oSheet.getCellByPosition (1, 2).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 3).setFormula ("una");
+ oSheet.getCellByPosition (1, 4).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 5).setFormula ("somethingelse");
+
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try
+ {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition (1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition (x, y);
+ aChangeValue = new Integer (27);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println ("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface (
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables ();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor ();
+ DPDsc.setSourceRange (sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try
+ {
+ Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.ROW);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.COLUMN);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+
+ log.println ("Insert the DataPilotTable");
+
+ if (DPT.hasByName ("DataPilotTable"))
+ {
+ DPT.removeByName ("DataPilotTable");
+ }
+
+ DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc);
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ XIndexAccess IA = null;
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ //getSRange(IA);
+ System.out.println ("COUNT: "+IA.getCount ());
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (0));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+
+ try
+ {
+ XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield);
+ String[] elements = new String[]{"aName","otherName"};
+ dpfg.createNameGroup (elements);
+ DataPilotFieldGroupInfo dpgi=null;
+ xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ for (int i=0;i<IA.getCount ();i++)
+ {
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (i));
+ XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i));
+ if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ())
+ {
+ xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield);
+ XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i));
+ System.out.println ("name: "+xNamed.getName ());
+ dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo");
+ }
+ }
+ groups = dpgi.Groups;
+ XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups);
+ XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0));
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName"));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace ();
+ }
+
+ log.println ("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment (oObj);
+
+ log.println ("Implementationname: " + util.utils.getImplName (oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java
new file mode 100644
index 000000000000..fab644979093
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java
@@ -0,0 +1,369 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldGroupInfo;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotFieldGrouping;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+
+public class ScDataPilotFieldGroupObj extends TestCase
+{
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize (TestParameters tParam, PrintWriter log)
+ {
+ SOfficeFactory SOF = SOfficeFactory.getFactory (
+ (XMultiServiceFactory) tParam.getMSF ());
+
+ try
+ {
+ log.println ("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc (null);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ // Some exception occures.FAILED
+ e.printStackTrace (log);
+ throw new StatusException ("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup (TestParameters tParam, PrintWriter log)
+ {
+ log.println (" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface (
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc (oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment (TestParameters Param,
+ PrintWriter log)
+ {
+ XInterface oObj = null;
+ XInterface datapilotfield = null;
+ XInterface groups = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println ("Creating a test environment");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress ();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress ();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println ("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets ();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface (
+ XIndexAccess.class, xSpreadsheets);
+
+ try
+ {
+ oSheet = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (1));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+
+ try
+ {
+ log.println ("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ oSheet.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet.getCellByPosition (0, i).setFormula ("Row" + i);
+ oSheet2.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet2.getCellByPosition (0, i).setFormula ("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ for (int j = 1; j < mMaxFieldIndex; j++)
+ {
+ oSheet.getCellByPosition (i, j).setValue (i * (j + 1));
+ oSheet2.getCellByPosition (i, j).setValue (i * (j + 2));
+ }
+ }
+
+ oSheet.getCellByPosition (1, 1).setFormula ("aName");
+ oSheet.getCellByPosition (1, 2).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 3).setFormula ("una");
+ oSheet.getCellByPosition (1, 4).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 5).setFormula ("somethingelse");
+
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try
+ {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition (1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition (x, y);
+ aChangeValue = new Integer (27);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println ("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface (
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables ();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor ();
+ DPDsc.setSourceRange (sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try
+ {
+ Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.ROW);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.COLUMN);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+
+ log.println ("Insert the DataPilotTable");
+
+ if (DPT.hasByName ("DataPilotTable"))
+ {
+ DPT.removeByName ("DataPilotTable");
+ }
+
+ DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc);
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ XIndexAccess IA = null;
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ //getSRange(IA);
+ System.out.println ("COUNT: "+IA.getCount ());
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (0));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+
+ try
+ {
+ XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield);
+ String[] elements = new String[]{"aName","otherName"};
+ dpfg.createNameGroup (elements);
+ DataPilotFieldGroupInfo dpgi=null;
+ xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ for (int i=0;i<IA.getCount ();i++)
+ {
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (i));
+ XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i));
+ if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ())
+ {
+ xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield);
+ XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i));
+ System.out.println ("name: "+xNamed.getName ());
+ dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo");
+ }
+ }
+ groups = dpgi.Groups;
+ XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups);
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace ();
+ }
+
+ log.println ("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment (oObj);
+
+ log.println ("Implementationname: " + util.utils.getImplName (oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java
new file mode 100644
index 000000000000..5045ed93647a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java
@@ -0,0 +1,367 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldGroupInfo;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotFieldGrouping;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+
+public class ScDataPilotFieldGroupsObj extends TestCase
+{
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize (TestParameters tParam, PrintWriter log)
+ {
+ SOfficeFactory SOF = SOfficeFactory.getFactory (
+ (XMultiServiceFactory) tParam.getMSF ());
+
+ try
+ {
+ log.println ("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc (null);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ // Some exception occures.FAILED
+ e.printStackTrace (log);
+ throw new StatusException ("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup (TestParameters tParam, PrintWriter log)
+ {
+ log.println (" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface (
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc (oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment (TestParameters Param,
+ PrintWriter log)
+ {
+ XInterface oObj = null;
+ XInterface datapilotfield = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println ("Creating a test environment");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress ();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress ();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println ("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets ();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface (
+ XIndexAccess.class, xSpreadsheets);
+
+ try
+ {
+ oSheet = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject (
+ new Type (XSpreadsheet.class),
+ oIndexAccess.getByIndex (1));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get a spreadsheet", e);
+ }
+
+ try
+ {
+ log.println ("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ oSheet.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet.getCellByPosition (0, i).setFormula ("Row" + i);
+ oSheet2.getCellByPosition (i, 0).setFormula ("Col" + i);
+ oSheet2.getCellByPosition (0, i).setFormula ("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ {
+ for (int j = 1; j < mMaxFieldIndex; j++)
+ {
+ oSheet.getCellByPosition (i, j).setValue (i * (j + 1));
+ oSheet2.getCellByPosition (i, j).setValue (i * (j + 2));
+ }
+ }
+
+ oSheet.getCellByPosition (1, 1).setFormula ("aName");
+ oSheet.getCellByPosition (1, 2).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 3).setFormula ("una");
+ oSheet.getCellByPosition (1, 4).setFormula ("otherName");
+ oSheet.getCellByPosition (1, 5).setFormula ("somethingelse");
+
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try
+ {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition (1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition (x, y);
+ aChangeValue = new Integer (27);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println ("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface (
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables ();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor ();
+ DPDsc.setSourceRange (sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try
+ {
+ Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.ROW);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (1);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (2);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface (
+ XPropertySet.class, oDataPilotField);
+ fieldPropSet.setPropertyValue ("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.COLUMN);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't create a test environment", e);
+ }
+
+ log.println ("Insert the DataPilotTable");
+
+ if (DPT.hasByName ("DataPilotTable"))
+ {
+ DPT.removeByName ("DataPilotTable");
+ }
+
+ DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc);
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ XIndexAccess IA = null;
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ //getSRange(IA);
+ System.out.println ("COUNT: "+IA.getCount ());
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (0));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+
+ try
+ {
+ XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield);
+ String[] elements = new String[]{"aName","otherName"};
+ dpfg.createNameGroup (elements);
+ DataPilotFieldGroupInfo dpgi=null;
+ xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ());
+ try
+ {
+ XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0));
+ IA = xDPT.getRowFields ();
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ catch (com.sun.star.lang.IndexOutOfBoundsException e)
+ {
+ e.printStackTrace ();
+ throw new StatusException ("Couldn't get data pilot field", e);
+ }
+ for (int i=0;i<IA.getCount ();i++)
+ {
+ datapilotfield = (XInterface) AnyConverter.toObject (
+ new Type (XInterface.class), IA.getByIndex (i));
+ XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i));
+ if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ())
+ {
+ xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield);
+ XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i));
+ System.out.println ("name: "+xNamed.getName ());
+ dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo");
+ }
+ }
+ oObj = dpgi.Groups;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace ();
+ }
+
+ log.println ("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment (oObj);
+
+ log.println ("Implementationname: " + util.utils.getImplName (oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java
new file mode 100644
index 000000000000..27f2da2a8a6b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java
@@ -0,0 +1,396 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.DataPilotField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::DataPilotField</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.sheet._DataPilotField
+* @see ifc.beans._XPropertySet
+*/
+public class ScDataPilotFieldObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. Retrieves from
+ * the collection the data pilot field with index 0. This data pilot field
+ * is the instance of the service <code>com.sun.star.sheet.DataPilotField</code>.
+ * @see com.sun.star.sheet.DataPilotField
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ oSheet2.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet2.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ for (int j = 1; j < mMaxFieldIndex; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ oSheet2.getCellByPosition(i, j).setValue(i * (j + 2));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition(1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition(x, y);
+ aChangeValue = new Integer(27);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface(
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ log.println("Insert the DataPilotTable");
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ getSRange(IA);
+
+ DPT.insertNewByName("DataPilotTable", sCellAdress, DPDsc);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), IA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+ private void getSRange(XIndexAccess IA) {
+ int fieldsAmount = IA.getCount() + 1;
+
+ String[] fieldsNames = new String[fieldsAmount];
+
+ int i = -1;
+ int cnt = 0;
+
+ while ((++i) < fieldsAmount) {
+ Object field;
+
+ try {
+ field = IA.getByIndex(i);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ field);
+ String name = named.getName();
+
+ log.println("**Field : '" + name + "' ... ");
+
+ if (!name.equals("Data")) {
+ fieldsNames[cnt] = name;
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, field);
+
+ try {
+ switch (cnt % 5) {
+ case 0:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.COLUMN);
+ log.println(" Column");
+
+ break;
+
+ case 1:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.ROW);
+ log.println(" Row");
+
+ break;
+
+ case 2:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.DATA);
+ log.println(" Data");
+
+ break;
+
+ case 3:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.HIDDEN);
+ log.println(" Hidden");
+
+ break;
+
+ case 4:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.PAGE);
+ log.println(" Page");
+
+ break;
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ if ((++cnt) > 4) {
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java
new file mode 100644
index 000000000000..8ef56fbc041d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DataPilotFields</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotFields
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScDataPilotFieldsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. This collection
+ * is the instance of the service <code>com.sun.star.sheet.DataPilotFields</code>.
+ * @see com.sun.star.sheet.DataPilotFields
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filing a table");
+ for (int i = 1; i < 4; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < 4; i++)
+ for (int j = 1; j < 4; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+
+ log.println("Getting test object ") ;
+
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(new CellRangeAddress((short)0, 0, 0, 4, 4));
+ DPT.insertNewByName(
+ "DataPilotTable",
+ new CellAddress((short)0, 5, 5),
+ DPDsc);
+
+ oObj = DPDsc.getDataPilotFields();
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java
new file mode 100644
index 000000000000..b2c0b6c4bff9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java
@@ -0,0 +1,414 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotField;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.DataPilotField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::DataPilotField</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.sheet._DataPilotField
+* @see ifc.beans._XPropertySet
+*/
+public class ScDataPilotItemObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. Retrieves from
+ * the collection the data pilot field with index 0. This data pilot field
+ * is the instance of the service <code>com.sun.star.sheet.DataPilotField</code>.
+ * @see com.sun.star.sheet.DataPilotField
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ oSheet2.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet2.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ for (int j = 1; j < mMaxFieldIndex; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ oSheet2.getCellByPosition(i, j).setValue(i * (j + 2));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition(1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition(x, y);
+ aChangeValue = new Integer(27);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface(
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ log.println("Insert the DataPilotTable");
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ getSRange(IA);
+
+ DPT.insertNewByName("DataPilotTable", sCellAdress, DPDsc);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), IA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface(
+ XDataPilotField.class, oObj);
+
+ XIndexAccess xIA = xDataPilotField.getItems();
+
+ try {
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,
+ xIA.getByIndex(0));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get DataPilotItemObj");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get DataPilotItemObj");
+ e.printStackTrace(log);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("NoSetName", "ScDataPilotItemObj");
+ return tEnv;
+ }
+
+ private void getSRange(XIndexAccess IA) {
+ int fieldsAmount = IA.getCount() + 1;
+
+ String[] fieldsNames = new String[fieldsAmount];
+
+ int i = -1;
+ int cnt = 0;
+
+ while ((++i) < fieldsAmount) {
+ Object field;
+
+ try {
+ field = IA.getByIndex(i);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ field);
+ String name = named.getName();
+
+ log.println("**Field : '" + name + "' ... ");
+
+ if (!name.equals("Data")) {
+ fieldsNames[cnt] = name;
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, field);
+
+ try {
+ switch (cnt % 5) {
+ case 0:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.COLUMN);
+ log.println(" Column");
+
+ break;
+
+ case 1:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.ROW);
+ log.println(" Row");
+
+ break;
+
+ case 2:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.DATA);
+ log.println(" Data");
+
+ break;
+
+ case 3:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.HIDDEN);
+ log.println(" Hidden");
+
+ break;
+
+ case 4:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.PAGE);
+ log.println(" Page");
+
+ break;
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ if ((++cnt) > 4) {
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java
new file mode 100644
index 000000000000..c3d0df45cbe2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java
@@ -0,0 +1,402 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotField;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.DataPilotField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::DataPilotField</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.sheet._DataPilotField
+* @see ifc.beans._XPropertySet
+*/
+public class ScDataPilotItemsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. Retrieves from
+ * the collection the data pilot field with index 0. This data pilot field
+ * is the instance of the service <code>com.sun.star.sheet.DataPilotField</code>.
+ * @see com.sun.star.sheet.DataPilotField
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ oSheet2.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet2.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ for (int j = 1; j < mMaxFieldIndex; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ oSheet2.getCellByPosition(i, j).setValue(i * (j + 2));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition(1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition(x, y);
+ aChangeValue = new Integer(27);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface(
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ log.println("Insert the DataPilotTable");
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ getSRange(IA);
+
+ DPT.insertNewByName("DataPilotTable", sCellAdress, DPDsc);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), IA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface(
+ XDataPilotField.class, oObj);
+
+ oObj = xDataPilotField.getItems();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+ private void getSRange(XIndexAccess IA) {
+ int fieldsAmount = IA.getCount() + 1;
+
+ String[] fieldsNames = new String[fieldsAmount];
+
+ int i = -1;
+ int cnt = 0;
+
+ while ((++i) < fieldsAmount) {
+ Object field;
+
+ try {
+ field = IA.getByIndex(i);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ field);
+ String name = named.getName();
+
+ log.println("**Field : '" + name + "' ... ");
+
+ if (!name.equals("Data")) {
+ fieldsNames[cnt] = name;
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, field);
+
+ try {
+ switch (cnt % 5) {
+ case 0:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.COLUMN);
+ log.println(" Column");
+
+ break;
+
+ case 1:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.ROW);
+ log.println(" Row");
+
+ break;
+
+ case 2:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.DATA);
+ log.println(" Data");
+
+ break;
+
+ case 3:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.HIDDEN);
+ log.println(" Hidden");
+
+ break;
+
+ case 4:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.PAGE);
+ log.println(" Page");
+
+ break;
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ if ((++cnt) > 4) {
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
new file mode 100644
index 000000000000..015b94b7f31f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
@@ -0,0 +1,355 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.TableFilterField;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSheetFilterDescriptor;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DataPilotTable</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::XDataPilotTable</code></li>
+* <li> <code>com::sun::star::sheet::XDataPilotDescriptor</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotTable
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.XDataPilotTable
+* @see com.sun.star.sheet.XDataPilotDescriptor
+* @see ifc.container._XNamed
+* @see ifc.sheet._XDataPilotTable
+* @see ifc.sheet._XDataPilotDescriptor
+*/
+public class ScDataPilotTableObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. Sets field
+ * orientation for every of the data pilot fields. Sets the definitions of
+ * the filter fields for the created description. Inserts new data pilot
+ * table with this descriptor to the collection.
+ * This new data pilot table is the instance of the service
+ * <code>com.sun.star.sheet.DataPilotTable</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OUTPUTRANGE'</code> for
+ * {@link ifc.sheet._XDataPilotTable}(the cell range address of the
+ * created data pilot table) </li>
+ * <li> <code>'FIELDSAMOUNT'</code> for
+ * {@link ifc.sheet._XDataPilotDescriptor}(the number of filled fields
+ * which descriptor was created for) </li>
+ * <li> <code>'CELLFORCHANGE'</code> for
+ * {@link ifc.sheet._XDataPilotTable}(value of this cell will be changed)</li>
+ * <li> <code>'CELLFORCHECK'</code> for
+ * {@link ifc.sheet._XDataPilotTable}(value of this cell must be changed
+ * after refresh call)</li>
+ * </ul>
+ * @see com.sun.star.sheet.DataPilotTable
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ CellAddress sCellAddress = new CellAddress();
+ sCellAddress.Sheet = 0;
+ sCellAddress.Column = 7;
+ sCellAddress.Row = 8;
+
+ // 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 sheets");
+ XSpreadsheets xSpreadsheets = xSheetDoc.getSheets();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet oSheet = null;
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ oChangeCell = oSheet.getCellByPosition(1, 5);
+ oCheckCell = oSheet.getCellByPosition(
+ sCellAddress.Column, sCellAddress.Row + 3);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+ log.println("Getting sheet - " + (oSheet == null ? "FAILED" : "OK"));
+ try {
+ log.println("Filing a table");
+ for (int i = 1; i < 6; i++) {
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ }
+
+ for (int i = 1; i < 6; i++)
+ for (int j = 1; j < 6; j++) {
+ oSheet.getCellByPosition(i, j).setValue(2.5 * j + i);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ CellRangeAddress sCellRangeAddress = new CellRangeAddress();
+ sCellRangeAddress.Sheet = 0;
+ sCellRangeAddress.StartColumn = 1;
+ sCellRangeAddress.StartRow = 0;
+ sCellRangeAddress.EndColumn = 5;
+ sCellRangeAddress.EndRow = 5;
+
+ TableFilterField[] filterFields = new TableFilterField[2];
+ filterFields[0] = new TableFilterField();
+ filterFields[0].Connection = com.sun.star.sheet.FilterConnection.AND;
+ filterFields[0].Field = 1;
+ filterFields[0].IsNumeric = true;
+ filterFields[0].NumericValue = 4;
+ filterFields[0].Operator = com.sun.star.sheet.FilterOperator.GREATER;
+ filterFields[1] = new TableFilterField();
+ filterFields[1].Connection = com.sun.star.sheet.FilterConnection.AND;
+ filterFields[1].Field = 1;
+ filterFields[1].IsNumeric = true;
+ filterFields[1].NumericValue = 12;
+ filterFields[1].Operator = com.sun.star.sheet.FilterOperator.LESS_EQUAL;
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+ log.println("Getting test object");
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(sCellRangeAddress);
+
+ XSheetFilterDescriptor SFD = DPDsc.getFilterDescriptor();
+ SFD.setFilterFields(filterFields);
+
+ XPropertySet fieldPropSet = null;
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+ DPT.insertNewByName("DataPilotTable", sCellAddress, DPDsc);
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),DPT.getByName(DPT.getElementNames()[0]));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("OUTPUTRANGE", sCellAddress);
+ tEnv.addObjRelation("CELLFORCHANGE", oChangeCell);
+ tEnv.addObjRelation("CELLFORCHECK", oCheckCell);
+ tEnv.addObjRelation("FIELDSAMOUNT", new Integer(5));
+ tEnv.addObjRelation("SHEETDOCUMENT", xSheetDoc);
+
+ createTable2(oSheet, sCellRangeAddress, tEnv);
+
+ return tEnv;
+ }
+
+ /**
+ * Create a new DataPilot table output for use with testing XDataPilotTable2
+ * interface.
+ *
+ * @param oSheet current sheet instance
+ * @param srcRange source range
+ * @param tEnv test environment instance
+ */
+ private void createTable2(XSpreadsheet oSheet, CellRangeAddress srcRange, TestEnvironment tEnv)
+ {
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+ log.println("Creating test table object");
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(srcRange);
+
+ XIndexAccess xIA = DPDsc.getDataPilotFields();
+ int fieldCount = xIA.getCount() - 1; // skip the last field because it's always hidden.
+ try
+ {
+ for (int i = 0; i < fieldCount; ++i)
+ {
+ Object o = xIA.getByIndex(i);
+ XPropertySet fieldPropSet = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, o);
+
+ if (i == fieldCount - 1)
+ {
+ // last field
+ fieldPropSet.setPropertyValue(
+ "Function", com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue(
+ "Orientation", com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ }
+ else if (i%2 == 0)
+ {
+ // even number fields
+ fieldPropSet.setPropertyValue(
+ "Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN);
+ }
+ else if (i%2 == 1)
+ {
+ // odd number fields
+ fieldPropSet.setPropertyValue(
+ "Orientation", com.sun.star.sheet.DataPilotFieldOrientation.ROW);
+ }
+ }
+
+ if (DPT.hasByName("DataPilotTable2"))
+ DPT.removeByName("DataPilotTable2");
+
+ CellAddress destAddr = new CellAddress();
+ destAddr.Sheet = 0;
+ destAddr.Column = 0;
+ destAddr.Row = 14;
+ DPT.insertNewByName("DataPilotTable2", destAddr, DPDsc);
+
+ Object o = DPT.getByName("DataPilotTable2");
+ tEnv.addObjRelation("DATAPILOTTABLE2", o);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
new file mode 100644
index 000000000000..73a174902fb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DataPilotTables</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XDataPilotTables</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotTables
+* @see com.sun.star.sheet.XDataPilotTables
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.sheet._XDataPilotTables
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScDataPilotTablesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. The collection of data pilot tables is the instance of
+ * the service <code>com.sun.star.sheet.DataPilotTables</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SHEET'</code> for
+ * {@link ifc.sheet._XDataPilotTables}(the spreadsheet which
+ * the collection of data pilot tables was retrieved from) </li>
+ * </ul>
+ * @see com.sun.star.sheet.DataPilotTable
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+
+ try {
+ log.println("Filing a table");
+ for (int i = 1; i < 4; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < 4; i++)
+ for (int j = 1; j < 4; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+
+ log.println("Getting test object ") ;
+
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(new CellRangeAddress((short)0, 0, 0, 4, 4));
+ DPT.insertNewByName(
+ "DataPilotTable",
+ new CellAddress((short)0, 5, 5),
+ DPDsc );
+
+ oObj = DPT;
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("SHEET", oSheet);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
new file mode 100644
index 000000000000..d10a1a792340
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
@@ -0,0 +1,258 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XCellRangeReferrer;
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XImportable;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.DatabaseRange</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::DatabaseRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::sheet::XDatabaseRange</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeReferrer</code></li>
+* </ul>
+* @see com.sun.star.sheet.DatabaseRange
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.DatabaseRange
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.sheet.XDatabaseRange
+* @see com.sun.star.sheet.XCellRangeReferrer
+* @see ifc.container._XNamed
+* @see ifc.sheet._DatabaseRange
+* @see ifc.beans._XPropertySet
+* @see ifc.sheet._XDatabaseRange
+* @see ifc.sheet._XCellRangeReferrer
+*/
+public class ScDatabaseRangeObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of database ranges in the document.
+ * If the database range with name <code>'dbRange'</code> exists
+ * in the collection then removes it from the collection.
+ * Creates new database range and adds it to the collection with the name
+ * <code>'dbRange'</code>.The database range that was added to the collection
+ * is the instance of the service <code>com.sun.star.sheet.DatabaseRange</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DATAAREA'</code> for
+ * {@link ifc.sheet._XCellRangeReferrer}(of type
+ * <code>CellRangeAddress</code>)</li>
+ * <li> <code>'XCELLRANGE'</code> (of type <code>XCellRange</code>):
+ * cell range of the spreadsheet with database range</li>
+ * </ul>
+ * @see com.sun.star.sheet.DatabaseRange
+ * @see com.sun.star.table.CellRangeAddress
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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 ");
+
+ XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, xSheetDoc);
+
+ XSpreadsheets sheets = xSheetDoc.getSheets();
+ String[] names = sheets.getElementNames();
+ XDatabaseRanges dbRanges = null;
+ XImportable xImp = null;
+
+ try {
+ Object sheet = sheets.getByName(names[0]);
+ xImp = (XImportable) UnoRuntime.queryInterface(XImportable.class,
+ sheet);
+ dbRanges = (XDatabaseRanges) AnyConverter.toObject(
+ new Type(XDatabaseRanges.class),
+ docProps.getPropertyValue("DatabaseRanges"));
+ _doImport(xImp);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a property", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a property", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a property", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ }
+
+ if (dbRanges.hasByName("dbRange")) {
+ dbRanges.removeByName("dbRange");
+ }
+
+ //CellRangeAddress aRange = new CellRangeAddress((short)0, 0, 0, 0, 13);
+ CellRangeAddress aRange = null;
+
+ //dbRanges.addNewByName("dbRange", aRange);
+ XNameAccess dbrNA = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class, dbRanges);
+ XNamed xNamed = null;
+
+ try {
+ String[] dbNames = dbrNA.getElementNames();
+ xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ dbrNA.getByName(
+ dbNames[0]));
+ xNamed.setName("dbRange");
+
+ XCellRangeReferrer aReferrer = (XCellRangeReferrer) UnoRuntime.queryInterface(
+ XCellRangeReferrer.class,
+ dbrNA.getByName("dbRange"));
+ XCellRangeAddressable aRangeA = (XCellRangeAddressable) UnoRuntime.queryInterface(
+ XCellRangeAddressable.class,
+ aReferrer.getReferredCells());
+ aRange = aRangeA.getRangeAddress();
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),
+ dbrNA.getByName("dbRange"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("DATAAREA", aRange);
+
+ XCellRange xCellRange = null;
+
+ try {
+ Object sheet = sheets.getByName(names[0]);
+ xCellRange = (XCellRange) UnoRuntime.queryInterface(
+ XCellRange.class, sheet);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting of first spreadsheet from spreadsheet" +
+ " document", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting of first spreadsheet from spreadsheet" +
+ " document", e);
+ }
+
+ tEnv.addObjRelation("XCELLRANGE", xCellRange);
+
+ return tEnv;
+ }
+
+ public void _doImport(XImportable imp) {
+ PropertyValue[] descriptor = imp.createImportDescriptor(false);
+
+ log.print("Setting the ImportDescriptor (Bibliograpy, SQL, select Identifier from biblio) -- ");
+ descriptor[0].Value = "Bibliography";
+ descriptor[1].Value = com.sun.star.sheet.DataImportMode.SQL;
+ descriptor[2].Value = "select Identifier from biblio";
+ log.println("done");
+
+ log.print("Importing data (Bibliograpy, Table, biblio) -- ");
+ imp.doImport(descriptor);
+ log.println("done");
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java
new file mode 100644
index 000000000000..06b8d3e17c74
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.DatabaseRanges</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XDatabaseRanges</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.DatabaseRanges
+* @see com.sun.star.sheet.XDatabaseRanges
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.sheet._XDatabaseRanges
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScDatabaseRangesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of database ranges in the document.
+ * If the database range with name <code>'dbRange'</code> doesn't exist
+ * in the collection then creates new database range and adds it to the
+ * collection with the name <code>'dbRange'</code> to have one element
+ * for the test of the interface <code>ElementAccess</code> at least.
+ * The collection of database ranges is the instance of the service
+ * <code>com.sun.star.sheet.DatabaseRanges</code>.
+ * @see com.sun.star.sheet.DatabaseRanges
+ * @see com.sun.star.container.XElementAccess
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 ") ;
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+
+ XDatabaseRanges dbRanges = null;
+ try {
+ dbRanges = (XDatabaseRanges) AnyConverter.toObject(
+ new Type(XDatabaseRanges.class),
+ docProps.getPropertyValue("DatabaseRanges"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ }
+
+ log.println("Adding at least one element for ElementAccess interface");
+ CellRangeAddress aRange = new CellRangeAddress((short)0, 2, 4, 5, 6);
+ if (!dbRanges.hasByName("dbRange")) {
+ dbRanges.addNewByName("dbRange", aRange);
+ }
+
+ oObj = dbRanges;
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java
new file mode 100644
index 000000000000..f15d109ce413
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+public class ScDocumentConfiguration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+ DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xSheetDoc);
+ Object oObj = null;
+
+ try {
+ oObj = docMSF.createInstance("com.sun.star.sheet.DocumentSettings");
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Couldn't create document settings", e);
+ }
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment((XInterface) oObj);
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
new file mode 100644
index 000000000000..4a6e1eaea16c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScDrawPageObj extends TestCase {
+
+ static XSpreadsheetDocument xDoc = null;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent xComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xDoc);
+ util.DesktopTools.closeDoc(xComp);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * From the Calc document created a collection of its draw
+ * pages is obtained. Two new pages are inserted. And one
+ * page is obtained as a testing component. A shape is added
+ * to this page. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeGrouper} :
+ * the draw page tested. </li>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes} :
+ * the creator which can create instances of
+ * <code>com.sun.star.drawing.Line</code> service </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null ;
+ XDrawPages oDP = null;
+
+ XComponent xComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xDoc);
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ log.println( "getting Drawpages" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc);
+ oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDP.getByIndex(0));
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ oShape = SOF.createShape(xComp,5000,3500,7500,5000,"Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape);
+ XShape oShape1 = SOF.createShape(xComp,
+ 5000,5500,5000,5000,"Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape1);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e) ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // relation for XShapes interface
+ ShapeDsc sDsc = new ShapeDsc(5000,3500,7500,10000,"Line");
+ tEnv.addObjRelation("Shape", new InstCreator(xDoc, sDsc)) ;
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ // adding relation for XShapeGrouper
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java
new file mode 100644
index 000000000000..ec1ccf069fc5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+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;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawPages</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::XDrawPageExpander</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::drawing::XDrawPageSummarizer</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XDrawPages</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawPages
+* @see com.sun.star.drawing.XDrawPageExpander
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.drawing.XDrawPageSummarizer
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XDrawPages
+* @see ifc.drawing._XDrawPageExpander
+* @see ifc.container._XIndexAccess
+* @see ifc.drawing._XDrawPageSummarizer
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XDrawPages
+*/
+public class ScDrawPagesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of all drawpages in the document using the
+ * interface <code>XDrawPagesSupplier</code>. Creates and inserts two new
+ * drawPages into this collection. The retrieved collection is the instance
+ * of the service <code>com.sun.star.drawing.DrawPages</code>.
+ * @see com.sun.star.drawing.XDrawPagesSupplier
+ * @see com.sun.star.drawing.DrawPages
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XDrawPages oDP = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpages" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc);
+ oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oObj = oDP;
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScDrawPagesObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java
new file mode 100644
index 000000000000..abcdb81ab116
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetFilterable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SheetFilterDescriptor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSheetFilterDescriptor</code></li>
+* <li> <code>com::sun::star::sheet::SheetFilterDescriptor</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetFilterDescriptor
+* @see com.sun.star.sheet.XSheetFilterDescriptor
+* @see com.sun.star.sheet.SheetFilterDescriptor
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._XSheetFilterDescriptor
+* @see ifc.sheet._SheetFilterDescriptor
+* @see ifc.beans._XPropertySet
+*/
+public class ScFilterDescriptorBase extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some cells in the spreadsheet.
+ * Creates the filter descriptor using the interface
+ * <code>XSheetFilterable</code>. This filter descriptor is the instance
+ * of the service <code>com.sun.star.sheet.SheetFilterDescriptor</code>.
+ * @see com.sun.star.sheet.XSheetFilterable
+ * @see com.sun.star.sheet.SheetFilterDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XSheetFilterable SF = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ SF = (XSheetFilterable)
+ UnoRuntime.queryInterface(XSheetFilterable.class, oSheet);
+
+ oObj = SF.createFilterDescriptor(true);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScFilterDescriptorBase
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java
new file mode 100644
index 000000000000..719a55ded4f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+import java.util.Random;
+
+import lib.StatusException;
+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 {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.
+ queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized 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" );
+
+ try {
+ log.println("Getting test object ") ;
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory) Param.getMSF();
+
+ XInterface FDs = (XInterface)oDocMSF.
+ createInstance("com.sun.star.sheet.FunctionDescriptions");
+ XNameAccess NA = (XNameAccess)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"));
+
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException
+ ("Error getting test object from spreadsheet document",e) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java
new file mode 100644
index 000000000000..3b171bde6432
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.lang.XMultiServiceFactory;
+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.FunctionDescriptions</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::sheet::XFunctionDescriptions</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.FunctionDescriptions
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.sheet.XFunctionDescriptions
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.sheet._XFunctionDescriptions
+* @see ifc.container._XElementAccess
+*/
+public class ScFunctionListObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sheet.FunctionDescriptions</code>.
+ * @see com.sun.star.sheet.FunctionDescriptions
+ */
+ public synchronized 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" );
+
+ log.println("Getting test object ") ;
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)Param.getMSF();
+ try {
+ oObj = (XInterface)oDocMSF.createInstance(
+ "com.sun.star.sheet.FunctionDescriptions");
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java
new file mode 100644
index 000000000000..5f3ce09f8f61
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.TextField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::text::XTextField</code></li>
+* <li> <code>com::sun::star::text::XTextContent</code></li>
+* <li> <code>com::sun::star::text::TextContent</code></li>
+* </ul>
+* @see com.sun.star.text.TextField
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.text.XTextField
+* @see com.sun.star.text.XTextContent
+* @see com.sun.star.text.TextContent
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.text._XTextField
+* @see ifc.text._XTextContent
+* @see ifc.text._TextContent
+*/
+public class ScHeaderFieldObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families available in the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains default style from the style family <code>'PageStyles'</code>.
+ * Retrieves the interface <code>XHeaderFooterContent</code> from the style
+ * using the property <code>'RightPageHeaderContent'</code>. Creates the
+ * instance of the service <code>com.sun.star.text.TextField.Time</code> and
+ * the instance of the service <code>com.sun.star.text.TextField.Date</code>
+ * Obtains the text (the interface <code>XText</code>) which is printed in
+ * the left part of the header or footer and inserts in it's content
+ * the second created instance.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CONTENT'</code> for
+ * {@link ifc.text._XTextContent}(the interface <code>XTextContent</code>
+ * that was queried from the second created instance) </li>
+ * <li> <code>'TEXT'</code> for
+ * {@link ifc.text._XTextContent}(the the text which is printed in the
+ * right part of the header or footer) </li>
+ * </ul>
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ * @see com.sun.star.sheet.XHeaderFooterContent
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.text.XTextContent
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+ XTextContent oContent = null;
+ XInterface aField = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ //get the property-set
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ XText left = RPHC.getLeftText();
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xSpreadsheetDoc );
+
+ XTextContent the_Field = null;
+ try {
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.TextField.Time" );
+
+ the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+ aField = (XInterface)
+ oDocMSF.createInstance("com.sun.star.text.TextField.Date");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ oContent = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, aField);
+
+ XTextCursor the_Cursor = left.createTextCursor();
+
+ try {
+ left.insertTextContent(the_Cursor,the_Field, false);
+ PropSet.setPropertyValue("RightPageHeaderContent", RPHC);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("CONTENT",oContent);
+ tEnv.addObjRelation("TEXT", RPHC.getRightText());
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScHeaderFieldObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java
new file mode 100644
index 000000000000..97fcf84ad8d2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by collection of
+ * text fields conained in the text of a page header. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::util::XRefreshable</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.util.XRefreshable
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.util._XRefreshable
+ * @see ifc.container._XElementAccess
+ */
+public class ScHeaderFieldsObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families available in the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains default style from the style family <code>'PageStyles'</code>.
+ * Retrieves the interface <code>XHeaderFooterContent</code> from the style
+ * using the property <code>'RightPageHeaderContent'</code>. Creates the
+ * instance of the service <code>com.sun.star.text.TextField.Time</code> .
+ * Obtains the text (the interface <code>XText</code>) which is printed in
+ * the left part of the header or footer and inserts in it's content
+ * the created field instance. Then the tested component is obtained
+ * through <code>XTextFieldsSupplier</code> interface of a text.
+ *
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ * @see com.sun.star.sheet.XHeaderFooterContent
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.text.XTextContent
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ //get the property-set
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ XText left = RPHC.getLeftText();
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xSpreadsheetDoc );
+
+ XTextContent the_Field = null;
+ try {
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.TextField.Time" );
+
+ the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XTextCursor the_Cursor = left.createTextCursor();
+
+ try {
+ left.insertTextContent(the_Cursor,the_Field, false);
+ PropSet.setPropertyValue("RightPageHeaderContent", RPHC);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ XTextFieldsSupplier xTFSupp = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface(XTextFieldsSupplier.class, left);
+
+ oObj = xTFSupp.getTextFields();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java
new file mode 100644
index 000000000000..a71077cd26d6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.HeaderFooterContent</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XHeaderFooterContent</code></li>
+* </ul>
+* @see com.sun.star.sheet.HeaderFooterContent
+* @see com.sun.star.sheet.XHeaderFooterContent
+* @see ifc.sheet._XHeaderFooterContent
+*/
+public class ScHeaderFooterContentObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families available in the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains default style from the style family <code>'PageStyles'</code>.
+ * Retrieves value of the property <code>'RightPageHeaderContent'</code>.
+ * Sets some text for every part of header or footer using the interface
+ * <code>XHeaderFooterContent</code> and sets new value of the property
+ * <code>'RightPageHeaderContent'</code>. The value of this property is the
+ * instance of the service <code>com.sun.star.sheet.HeaderFooterContent</code>.
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ * @see com.sun.star.sheet.XHeaderFooterContent
+ * @see com.sun.star.sheet.HeaderFooterContent
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ //get the property-set
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ XText center = RPHC.getCenterText();
+ XText left = RPHC.getLeftText();
+ XText right = RPHC.getRightText();
+
+ center.setString("CENTER");
+ left.setString("LEFT");
+ right.setString("RIGHT");
+
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent", RPHC);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ }
+
+ // create testobject here
+ oObj = RPHC;
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScHeaderFooterContentObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java
new file mode 100644
index 000000000000..13083444297e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.TextCursor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XTextCursor</code></li>
+* <li> <code>com::sun::star::text::XWordCursor</code></li>
+* <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XContentEnumerationAccess</code></li>
+* <li> <code>com::sun::star::beans::XPropertyState</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::text::XSentenceCursor</code></li>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::text::XParagraphCursor</code></li>
+* <li> <code>com::sun::star::document::XDocumentInsertable</code></li>
+* <li> <code>com::sun::star::util::XSortable</code></li>
+* <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
+* </ul>
+* @see com.sun.star.text.TextCursor
+* @see com.sun.star.text.XTextCursor
+* @see com.sun.star.text.XWordCursor
+* @see com.sun.star.style.CharacterPropertiesComplex
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XContentEnumerationAccess
+* @see com.sun.star.beans.XPropertyState
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.text.XSentenceCursor
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.text.XParagraphCursor
+* @see com.sun.star.document.XDocumentInsertable
+* @see com.sun.star.util.XSortable
+* @see com.sun.star.style.CharacterPropertiesAsian
+* @see ifc.text._XTextCursor
+* @see ifc.text._XWordCursor
+* @see ifc.style._CharacterPropertiesComplex
+* @see ifc.text._XTextRange
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XContentEnumerationAccess
+* @see ifc.beans._XPropertyState
+* @see ifc.style._CharacterProperties
+* @see ifc.text._XSentenceCursor
+* @see ifc.style._ParagraphProperties
+* @see ifc.text._XParagraphCursor
+* @see ifc.document._XDocumentInsertable
+* @see ifc.util._XSortable
+* @see ifc.style._CharacterPropertiesAsian
+*/
+public class ScHeaderFooterTextCursor extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families available in the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains default style from the style family <code>'PageStyles'</code>.
+ * Retrieves value of the property <code>'RightPageHeaderContent'</code>.
+ * Sets some string for the text which is printed in the center part of the
+ * header or footer using the interface <code>XHeaderFooterContent</code>
+ * and sets new value of the property <code>'RightPageHeaderContent'</code>.
+ * Creates text cursor for the text which is printed in the center part of
+ * the header or footer. This text cursor is the instance of the service
+ * <code>com.sun.star.text.TextCursor</code>.
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ //get the property-set
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ XText center = RPHC.getCenterText();
+ center.setString("CENTER");
+
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent",RPHC);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ }
+
+ // create testobject here
+ oObj = center.createTextCursor();
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // add relation for XTextRange
+ tEnv.addObjRelation("XTEXT",
+ UnoRuntime.queryInterface(XText.class,center));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScHeaderFooterTextCursor
diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java
new file mode 100644
index 000000000000..a70cef7b7304
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.Text</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XTextRangeMover</code></li>
+* <li> <code>com::sun::star::text::XSimpleText</code></li>
+* <li> <code>com::sun::star::text::XTextRange</code></li>
+* <li> <code>com::sun::star::text::XRelativeTextContentInsert</code></li>
+* <li> <code>com::sun::star::text::XTextRangeCompare</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+* <li> <code>com::sun::star::text::XText</code></li>
+* </ul>
+* @see com.sun.star.text.Text
+* @see com.sun.star.text.XTextRangeMover
+* @see com.sun.star.text.XSimpleText
+* @see com.sun.star.text.XTextRange
+* @see com.sun.star.text.XRelativeTextContentInsert
+* @see com.sun.star.text.XTextRangeCompare
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XEnumerationAccess
+* @see com.sun.star.text.XText
+* @see ifc.text._XTextRangeMover
+* @see ifc.text._XSimpleText
+* @see ifc.text._XTextRange
+* @see ifc.text._XRelativeTextContentInsert
+* @see ifc.text._XTextRangeCompare
+* @see ifc.container._XElementAccess
+* @see ifc.container._XEnumerationAccess
+* @see ifc.text._XText
+*/
+public class ScHeaderFooterTextObj extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families available in the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains default style from the style family <code>'PageStyles'</code>.
+ * Retrieves value of the property <code>'RightPageHeaderContent'</code>.
+ * Creates text cursor for the text which is printed in the center part of
+ * the header or footer using the interface <code>XHeaderFooterContent</code>.
+ * Insert some lines using the created cursor and sets new value of the
+ * property <code>'RightPageHeaderContent'</code>. The value of the property
+ * <code>'RightPageHeaderContent'</code> is the instance of the service
+ * <code>com.sun.star.text.Text</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'RangeForMove'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range to be moved)</li>
+ * <li> <code>'XTextRange'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range that includes moving
+ * range)</li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert}(the instance creator
+ * which can create instances of some text content service)</li>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert}(the instance creator
+ * which can create instances of <code>com.sun.star.text.Paragraph</code>
+ * service)</li>
+ * </ul>
+ * @see com.sun.star.text.Text
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Default"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ //get the property-set
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHC = null;
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ RPHC = (XHeaderFooterContent) AnyConverter.toObject(
+ new Type(XHeaderFooterContent.class),
+ PropSet.getPropertyValue("RightPageHeaderContent"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get HeaderContent", e);
+ }
+
+ XText center = RPHC.getCenterText();
+
+ XTextRange text_to_move = null;
+
+ log.println( "inserting some lines" );
+ try {
+ XTextCursor oCursor = center.createTextCursor();
+ center.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ center.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ center.insertString(oCursor,"Paragraph 1", false);
+ center.insertString(oCursor,": ScHeaderFooterTextObj", false);
+ center.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ center.insertString(oCursor, "THE QUICK BROWN FOX JUMPS OVER THE" +
+ " LAZY DOG: ScHeaderFooterTextObj", false );
+ center.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ center.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ oCursor.setString("TextForMove");
+ text_to_move = oCursor;
+
+ XTextCursor oCursor1 = center.createTextCursorByRange(center.getEnd());
+ center.insertString(oCursor1,"Paragraph 2", false);
+ center.insertString(oCursor1,": ScHeaderFooterTextObj", false);
+ center.insertControlCharacter(
+ oCursor1, ControlCharacter.PARAGRAPH_BREAK, false );
+ center.insertString( oCursor1, "THE QUICK BROWN FOX JUMPS OVER THE" +
+ " LAZY DOG: ScHeaderFooterTextObj", false);
+ center.insertControlCharacter(
+ oCursor1, ControlCharacter.PARAGRAPH_BREAK, false );
+ center.insertControlCharacter(
+ oCursor1, ControlCharacter.LINE_BREAK, false );
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert Text ", e);
+ }
+
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent", RPHC);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set HeaderContent", e);
+ }
+
+ // create testobject here
+ oObj = center;
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ DefaultDsc tDsc = new DefaultDsc(
+ "com.sun.star.text.XTextContent","com.sun.star.text.TextField.Time");
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation(
+ "XTEXTINFO", new InstCreator( xSpreadsheetDoc, tDsc ) );
+
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator(xSpreadsheetDoc, pDsc) );
+
+ log.println("adding TextRange for XTextRangeMover" );
+ tEnv.addObjRelation("RangeForMove", text_to_move);
+ tEnv.addObjRelation("XTextRange", RPHC.getCenterText());
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+} // finish class ScHeaderFooterTextObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java
new file mode 100644
index 000000000000..ef70232f14a9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XImportable;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.sheet.DatabaseImportDescriptor
+ *
+ */
+public class ScImportDescriptorBase extends TestCase {
+
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ XImportable xIMP = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+ if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK");
+
+ log.println("getting a sheet");
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0));
+ } catch (Exception e) {
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ xIMP = (XImportable) UnoRuntime.queryInterface(XImportable.class,oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("xIMP",xIMP);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScImportDescriptorBase
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java
new file mode 100644
index 000000000000..1224cc0cbb8c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetAnnotations;
+import com.sun.star.sheet.XSheetAnnotationsSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ XSheetAnnotationsSupplier sas = (XSheetAnnotationsSupplier)
+ UnoRuntime.queryInterface(XSheetAnnotationsSupplier.class, oSheet);
+
+ XSheetAnnotations anno = sas.getAnnotations();
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, anno);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java
new file mode 100644
index 000000000000..1f98b8e902c8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log){
+
+ XInterface oObj = null;
+ TestEnvironment tEnv = null ;
+
+ try {
+
+ // creation of testobject here
+ XPropertySet props = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, xSheetDoc);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),props.getPropertyValue("AreaLinks")) ;
+ XAreaLinks links = null ;
+
+ // adding one link into collection (for best testing)
+ links = (XAreaLinks) UnoRuntime.queryInterface(XAreaLinks.class, oObj) ;
+ CellAddress addr = new CellAddress ((short) 1,2,3) ;
+ String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
+ links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ;
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println ("Exception occured while creating test Object.") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ return tEnv ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java
new file mode 100644
index 000000000000..9034de739054
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_DDELinksEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+ static XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document and testdocument.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.
+ queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ util.DesktopTools.closeDoc(oDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)Param.getMSF();
+
+ // load the predefined testdocument
+ String testdoc = utils.getFullTestURL("ScDDELinksObj.sdc");
+ try {
+ oDoc = SOfficeFactory.getFactory(oMSF).loadDocument(testdoc);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't load test document", e);
+ }
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ testdoc = utils.getFullTestDocName("ScDDELinksObj.sdc");
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ oSheet.getCellByPosition(1, 4).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ oSheet.getCellByPosition(2, 0).setFormula(
+ "=DDE(\"soffice\";\""+testdoc+"\";\"Sheet1.A1\"");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ try {
+ log.println("Getting test object ") ;
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ oObj = (XInterface)AnyConverter.toObject(
+ new Type(XInterface.class),docProps.getPropertyValue("DDELinks"));
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e) ;
+ }
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java
new file mode 100644
index 000000000000..3b1d914205f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filing a table");
+ for (int i = 1; i < 4; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < 4; i++)
+ for (int j = 1; j < 4; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+
+ log.println("Getting test object ") ;
+
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(new CellRangeAddress((short)0, 0, 0, 4, 4));
+ DPT.insertNewByName(
+ "DataPilotTable",
+ new CellAddress((short)0, 5, 5),
+ DPDsc);
+
+ oObj = DPDsc.getDataPilotFields();
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java
new file mode 100644
index 000000000000..3474f22f84f4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java
@@ -0,0 +1,408 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotField;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.DataPilotField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::DataPilotField</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.DataPilotField
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.sheet._DataPilotField
+* @see ifc.beans._XPropertySet
+*/
+public class ScIndexEnumeration_DataPilotItemsEnumeration
+ extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a Spreadsheet document");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some table in the spreadsheet.
+ * Obtains the collection of data pilot tables using the interface
+ * <code>XDataPilotTablesSupplier</code>. Creates a data pilot descriptor
+ * for the filled table and inserts new data pilot table with this descriptor
+ * to the collection. Obtains the collection of all the data pilot fields
+ * using the interface <code>XDataPilotDescriptor</code>. Retrieves from
+ * the collection the data pilot field with index 0. This data pilot field
+ * is the instance of the service <code>com.sun.star.sheet.DataPilotField</code>.
+ * @see com.sun.star.sheet.DataPilotField
+ * @see com.sun.star.sheet.XDataPilotTablesSupplier
+ * @see com.sun.star.sheet.XDataPilotDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ 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");
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ sCellRangeAdress.StartRow = 0;
+ sCellRangeAdress.EndColumn = mMaxFieldIndex - 1;
+ sCellRangeAdress.EndRow = mMaxFieldIndex - 1;
+
+ // position of the data pilot table
+ CellAddress sCellAdress = new CellAddress();
+ sCellAdress.Sheet = 0;
+ sCellAdress.Column = 7;
+ sCellAdress.Row = 8;
+
+ log.println("Getting a sheet");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+ XSpreadsheet oSheet = null;
+ XSpreadsheet oSheet2 = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filling a table");
+
+ for (int i = 1; i < mMaxFieldIndex; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ oSheet2.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet2.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < mMaxFieldIndex; i++)
+ for (int j = 1; j < mMaxFieldIndex; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ oSheet2.getCellByPosition(i, j).setValue(i * (j + 2));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ // change a value of a cell and check the change in the data pilot
+ // (for the XDataPilotTable.refresh() test)
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ Integer aChangeValue = null;
+
+ try {
+ // cell of data
+ oChangeCell = oSheet.getCellByPosition(1, 5);
+
+ int x = sCellAdress.Column;
+ int y = sCellAdress.Row + 3;
+
+
+ // cell of the data pilot output
+ oCheckCell = oSheet.getCellByPosition(x, y);
+ aChangeValue = new Integer(27);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get cells for changeing.", e);
+ }
+
+
+ // create the test objects
+ log.println("Getting test objects");
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface(
+ XDataPilotTablesSupplier.class,
+ oSheet);
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(sCellRangeAdress);
+
+ XPropertySet fieldPropSet = null;
+
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ log.println("Insert the DataPilotTable");
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ getSRange(IA);
+
+ DPT.insertNewByName("DataPilotTable", sCellAdress, DPDsc);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), IA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface(
+ XDataPilotField.class, oObj);
+
+ XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface(
+ XEnumerationAccess.class,
+ xDataPilotField.getItems());
+
+ oObj = xEnumerationAccess.createEnumeration();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ // Other parameters required for interface tests
+ return tEnv;
+ }
+
+ private void getSRange(XIndexAccess IA) {
+ int fieldsAmount = IA.getCount() + 1;
+
+ String[] fieldsNames = new String[fieldsAmount];
+
+ int i = -1;
+ int cnt = 0;
+
+ while ((++i) < fieldsAmount) {
+ Object field;
+
+ try {
+ field = IA.getByIndex(i);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ field);
+ String name = named.getName();
+
+ log.println("**Field : '" + name + "' ... ");
+
+ if (!name.equals("Data")) {
+ fieldsNames[cnt] = name;
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, field);
+
+ try {
+ switch (cnt % 5) {
+ case 0:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.COLUMN);
+ log.println(" Column");
+
+ break;
+
+ case 1:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.ROW);
+ log.println(" Row");
+
+ break;
+
+ case 2:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.DATA);
+ log.println(" Data");
+
+ break;
+
+ case 3:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.HIDDEN);
+ log.println(" Hidden");
+
+ break;
+
+ case 4:
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.PAGE);
+ log.println(" Page");
+
+ break;
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+
+ return;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+
+ return;
+ }
+
+ if ((++cnt) > 4) {
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
new file mode 100644
index 000000000000..0b7bdabaf6b7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ try {
+ log.println("Filing a table");
+ for (int i = 1; i < 4; i++) {
+ oSheet.getCellByPosition(i, 0).setFormula("Col" + i);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ }
+
+ for (int i = 1; i < 4; i++)
+ for (int j = 1; j < 4; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cells", e);
+ }
+
+ XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier)
+ UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
+
+ log.println("Getting test object ") ;
+
+ XDataPilotTables DPT = DPTS.getDataPilotTables();
+ XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
+ DPDsc.setSourceRange(new CellRangeAddress((short)0, 0, 0, 4, 4));
+ DPT.insertNewByName(
+ "DataPilotTable",
+ new CellAddress((short)0, 5, 5),
+ DPDsc );
+
+ oObj = DPT;
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java
new file mode 100644
index 000000000000..bf1b874d92ca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 ") ;
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+
+ XDatabaseRanges dbRanges = null;
+ try {
+ dbRanges = (XDatabaseRanges) AnyConverter.toObject(
+ new Type(XDatabaseRanges.class),
+ docProps.getPropertyValue("DatabaseRanges"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ }
+
+ log.println("Adding at least one element for ElementAccess interface");
+ CellRangeAddress aRange = new CellRangeAddress((short)0, 2, 4, 5, 6);
+ if (!dbRanges.hasByName("dbRange")) {
+ dbRanges.addNewByName("dbRange", aRange);
+ }
+
+ oObj = dbRanges;
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java
new file mode 100644
index 000000000000..03f890e1b28b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+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 ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 = (XMultiServiceFactory)Param.getMSF();
+ try {
+ oObj = (XInterface)oDocMSF.createInstance(
+ "com.sun.star.sheet.FunctionDescriptions");
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document", e);
+ }
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java
new file mode 100644
index 000000000000..594868d0e65a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XLabelRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ try {
+ log.println("Getting test object ") ;
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object ranges = docProps.getPropertyValue("ColumnLabelRanges");
+ XLabelRanges lRanges = (XLabelRanges)
+ UnoRuntime.queryInterface(XLabelRanges.class, ranges);
+
+ log.println("Adding at least one element for ElementAccess interface");
+ CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6);
+ CellRangeAddress aRange1 = new CellRangeAddress((short)0, 0, 0, 0, 1);
+ lRanges.addNew(aRange1, aRange2);
+
+ oObj = lRanges;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ }
+
+ log.println("creating a new environment for object");
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java
new file mode 100644
index 000000000000..b66cb993eb97
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XNamedRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 ");
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object ranges = null;
+ try {
+ ranges = docProps.getPropertyValue("NamedRanges");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ }
+
+ XNamedRanges xNamedRanges = (XNamedRanges)
+ UnoRuntime.queryInterface(XNamedRanges.class, ranges);
+
+ CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2);
+ CellAddress base = new CellAddress(DataArea.Sheet,
+ DataArea.StartColumn,
+ DataArea.StartRow);
+
+ xNamedRanges.addNewByName("ANamedRange", "A1:B2", base, 0);
+
+ CellAddress listOutputPosition = new CellAddress((short)0, 1, 1);
+ xNamedRanges.outputList(listOutputPosition);
+
+ oObj = xNamedRanges;
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
new file mode 100644
index 000000000000..3f17dd472e8b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XScenariosSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_ScenariosEnumeration extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cell", e);
+ }
+
+ XScenariosSupplier xSupp = (XScenariosSupplier)
+ UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet);
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+
+ xSupp.getScenarios().addNewByName("ScScenarios", oAddr, "Range");
+
+ XInterface oObj = xSupp.getScenarios();
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
new file mode 100644
index 000000000000..9094469f690d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp =
+ (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oRange = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+
+ log.println("Getting test object ");
+
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+
+ oObj = (XInterface)
+ SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges");
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndSheets = (XIndexAccess)
+ UnoRuntime.queryInterface (XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndSheets.getByIndex(0));
+ XNameContainer oRanges = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj);
+
+ oRange = oSheet.getCellRangeByName("C1:D4");
+ oRanges.insertByName("Range1", oRange);
+ oRange = oSheet.getCellRangeByName("E2:F5");
+ oRanges.insertByName("Range2", oRange);
+ oRange = oSheet.getCellRangeByName("G2:H3");
+ oRanges.insertByName("Range3", oRange);
+ oRange = oSheet.getCellRangeByName("I7:J8");
+ oRanges.insertByName("Range4", oRange);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 5; j++) {
+ oSheet.getCellByPosition(i, j).setFormula("a");
+ }
+ }
+ for (int i = 0; i < 10; i++) {
+ for (int j = 5; j < 10; j++) {
+ oSheet.getCellByPosition(i, j).setValue(i + j);
+ }
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException (
+ "Exception occurred while filling cells", e);
+ }
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java
new file mode 100644
index 000000000000..769f031a53cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetLinkable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+ XSpreadsheet oSheet = null;
+
+ log.println("Getting test object ") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ XSheetLinkable SL = (XSheetLinkable)
+ UnoRuntime.queryInterface(XSheetLinkable.class, oSheet);
+
+ // creating link.
+ String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
+ SL.link(aSourceArea, "Sheet1", "", "",
+ com.sun.star.sheet.SheetLinkMode.VALUE);
+
+ // Getting links.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+
+ Object links = null;
+ try {
+ links = docProps.getPropertyValue("SheetLinks");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ }
+
+ oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links);
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
new file mode 100644
index 000000000000..22779ea482f6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase {
+ private static XSpreadsheetDocument xSpreadsheetDoc;
+ private static SOfficeFactory SOF;
+ private static XInterface oObj;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println("disposing xSpreadsheetDocument");
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XModel xm = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+ XController xc = xm.getCurrentController();
+ XIndexAccess xIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xc);
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xIA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,xIA);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java
new file mode 100644
index 000000000000..439d22b55cc9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase {
+ private static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println("disposing xSpreadsheetDocument");
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ XInterface oObj = (XInterface)
+ UnoRuntime.queryInterface(XInterface.class, xSpreadsheets);
+
+ log.println("creating a new environment for object");
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java
new file mode 100644
index 000000000000..6659a68f8965
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.sheet.XSubTotalCalculatable;
+import com.sun.star.sheet.XSubTotalDescriptor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ XSubTotalCalculatable xSTC = (XSubTotalCalculatable)
+ UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet);
+
+ XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true);
+
+ SubTotalColumn[] columns = new SubTotalColumn[1];
+ SubTotalColumn column = new SubTotalColumn();
+ column.Column = 5;
+ column.Function = GeneralFunction.SUM;
+ columns[0] = column;
+ xSTD.addNew(columns, 1);
+
+ XIndexAccess oDescIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSTD);
+
+ XInterface oObj = null;
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oDescIndex);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java
new file mode 100644
index 000000000000..8212b7828f1a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+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 ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{
+ static XSpreadsheetDocument xSheetDoc = null;
+ static SOfficeFactory SOF = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ // creation of testobject here
+ // get AutoFormats
+ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.sheet.TableAutoFormats");
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println ("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+ }
+
+} // finish class ScAutoFormatsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java
new file mode 100644
index 000000000000..25097fd9d9f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.awt.Rectangle;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XTableCharts;
+import com.sun.star.table.XTableChartsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_TableChartsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XSpreadsheet oSheet=null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get Sheet ");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ }
+
+ log.println("Creating the Header") ;
+
+ insertIntoCell(1,0,"JAN",oSheet,"");
+ insertIntoCell(2,0,"FEB",oSheet,"");
+ insertIntoCell(3,0,"MAR",oSheet,"");
+ insertIntoCell(4,0,"APR",oSheet,"");
+ insertIntoCell(5,0,"MAI",oSheet,"");
+ insertIntoCell(6,0,"JUN",oSheet,"");
+ insertIntoCell(7,0,"JUL",oSheet,"");
+ insertIntoCell(8,0,"AUG",oSheet,"");
+ insertIntoCell(9,0,"SEP",oSheet,"");
+ insertIntoCell(10,0,"OCT",oSheet,"");
+ insertIntoCell(11,0,"NOV",oSheet,"");
+ insertIntoCell(12,0,"DEC",oSheet,"");
+ insertIntoCell(13,0,"SUM",oSheet,"");
+
+ log.println("Fill the lines");
+
+ insertIntoCell(0,1,"Smith",oSheet,"");
+ insertIntoCell(1,1,"42",oSheet,"V");
+ insertIntoCell(2,1,"58.9",oSheet,"V");
+ insertIntoCell(3,1,"-66.5",oSheet,"V");
+ insertIntoCell(4,1,"43.4",oSheet,"V");
+ insertIntoCell(5,1,"44.5",oSheet,"V");
+ insertIntoCell(6,1,"45.3",oSheet,"V");
+ insertIntoCell(7,1,"-67.3",oSheet,"V");
+ insertIntoCell(8,1,"30.5",oSheet,"V");
+ insertIntoCell(9,1,"23.2",oSheet,"V");
+ insertIntoCell(10,1,"-97.3",oSheet,"V");
+ insertIntoCell(11,1,"22.4",oSheet,"V");
+ insertIntoCell(12,1,"23.5",oSheet,"V");
+ insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");
+
+ insertIntoCell(0,2,"Jones",oSheet,"");
+ insertIntoCell(1,2,"21",oSheet,"V");
+ insertIntoCell(2,2,"40.9",oSheet,"V");
+ insertIntoCell(3,2,"-57.5",oSheet,"V");
+ insertIntoCell(4,2,"-23.4",oSheet,"V");
+ insertIntoCell(5,2,"34.5",oSheet,"V");
+ insertIntoCell(6,2,"59.3",oSheet,"V");
+ insertIntoCell(7,2,"27.3",oSheet,"V");
+ insertIntoCell(8,2,"-38.5",oSheet,"V");
+ insertIntoCell(9,2,"43.2",oSheet,"V");
+ insertIntoCell(10,2,"57.3",oSheet,"V");
+ insertIntoCell(11,2,"25.4",oSheet,"V");
+ insertIntoCell(12,2,"28.5",oSheet,"V");
+ insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");
+
+ insertIntoCell(0,3,"Brown",oSheet,"");
+ insertIntoCell(1,3,"31.45",oSheet,"V");
+ insertIntoCell(2,3,"-20.9",oSheet,"V");
+ insertIntoCell(3,3,"-117.5",oSheet,"V");
+ insertIntoCell(4,3,"23.4",oSheet,"V");
+ insertIntoCell(5,3,"-114.5",oSheet,"V");
+ insertIntoCell(6,3,"115.3",oSheet,"V");
+ insertIntoCell(7,3,"-171.3",oSheet,"V");
+ insertIntoCell(8,3,"89.5",oSheet,"V");
+ insertIntoCell(9,3,"41.2",oSheet,"V");
+ insertIntoCell(10,3,"71.3",oSheet,"V");
+ insertIntoCell(11,3,"25.4",oSheet,"V");
+ insertIntoCell(12,3,"38.5",oSheet,"V");
+ insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");
+
+ // insert a chart
+ Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);
+
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+ XTableChartsSupplier oSupp = (XTableChartsSupplier)
+ UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);
+
+
+ log.println("Insert Chart");
+ XTableCharts oCharts = oSupp.getCharts();
+ oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true);
+
+ log.println("creating a new environment for object");
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oCharts);
+
+ XInterface oObj = ea.createEnumeration();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+// tEnv.addObjRelation("RECT", oRect);
+// tEnv.addObjRelation("ADDR", oAddr);
+
+ return tEnv;
+ }
+
+ /**
+ * Inserts a value or a formula in the cell of the spreasheet.
+ * @param CellX is the column index of the cell
+ * @param CellY is the row index of the cell
+ * @param theValue string representation of the value
+ * @param TT1 specify the spreadsheet, the interface
+ * <code>com.sun.star.sheet.XSpreadsheet</code>
+ * @param flag if it's equal to <code>'V'</code> then the method inserts
+ * a double-value in the cell else it inserts a formula in the cell
+ */
+ public static void insertIntoCell(
+ int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) {
+
+ XCell oCell = null;
+
+ try {
+ oCell = TT1.getCellByPosition(CellX, CellY);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ System.out.println("Could not get Cell");
+ }
+
+ if (flag.equals("V")) {
+ oCell.setValue(new Float(theValue).floatValue());
+ } else {
+ oCell.setFormula(theValue);
+ }
+
+ } // end of insertIntoCell
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java
new file mode 100644
index 000000000000..a5a018cea24f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("craeting a test environment");
+
+ log.println("getting column");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ XSpreadsheet xSpreadsheet = null;
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+ XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
+ oObj = oColumns;
+
+ log.println("creating a new environment for object");
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java
new file mode 100644
index 000000000000..9dd0e2f21410
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.ConditionOperator;
+import com.sun.star.sheet.XSheetConditionalEntries;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occurred while filling cells");
+ e.printStackTrace(log);
+ }
+
+ Object CFormat = null;
+ XPropertySet Props = null;
+
+ try {
+ Props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oSheet);
+ CFormat = Props.getPropertyValue("ConditionalFormat");
+ if (utils.isVoid(CFormat)) {
+ log.println("Property 'ConditionalFormat' is void");
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ try {
+ XSheetConditionalEntries xSCE = (XSheetConditionalEntries)
+ UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat);
+ xSCE.addNew(Conditions());
+ Props.setPropertyValue("ConditionalFormat", xSCE);
+ oObj = xSCE;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ }
+
+ log.println("creating a new environment for object");
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Returns the array of the property values that was filled by condition
+ * values.
+ */
+ protected PropertyValue[] Conditions() {
+ PropertyValue[] con = new PropertyValue[5];
+ CellAddress ca = new CellAddress();
+ ca.Column = 1;
+ ca.Row = 5;
+ ca.Sheet = 0;
+ con[0] = new PropertyValue();
+ con[0].Name = "StyleName";
+ con[0].Value = "Result2";
+ con[1] = new PropertyValue();
+ con[1].Name = "Formula1";
+ con[1].Value = "$Sheet1.$B$5";
+ con[2] = new PropertyValue();
+ con[2].Name = "Formula2";
+ con[2].Value = "";
+ con[3] = new PropertyValue();
+ con[3].Name = "Operator";
+ con[3].Value = ConditionOperator.EQUAL;
+ con[4] = new PropertyValue();
+ con[4].Name = "SourcePosition";
+ con[4].Value = ca;
+ return con;
+ }
+
+} // finish class ScTableConditionalEntry
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java
new file mode 100644
index 000000000000..0892f58acc16
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XEnumerationAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableRows;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScIndexEnumeration_TableRowsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting row");
+ XSpreadsheet xSpreadsheet = null;
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+
+ XTableRows oRows = (XTableRows) oColumnRowRange.getRows();
+ oObj = oRows;
+
+ log.println("creating a new environment for object");
+
+ XEnumerationAccess ea = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
+
+ oObj = ea.createEnumeration();
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ // creating test environment
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM",ea);
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java
new file mode 100644
index 000000000000..95065d5d72f4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object that represents enumeration of a colection
+ * of text fields in a cell of a spreadsheet. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XEnumeration</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XEnumeration
+ * @see ifc.container._XEnumeration
+ */
+public class ScIndexEnumeration_TextFieldEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.TextField.URL</code>, inserts it to the content
+ * of the cell in the spreadsheet. Then the component is obtained
+ * by <code>XTextFieldsSupplier</code> interface of a cell
+ * and <code>XEnumerationSupplier</code> interface .<p>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XText oText = null;
+ XTextContent oContent = null;
+ XInterface aField = null;
+ XTextFieldsSupplier xTextFieldsSupp = null;
+
+ try {
+ // we want to create an instance of ScCellFieldObj.
+ // to do this we must get an MultiServiceFactory.
+
+ XMultiServiceFactory _oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc);
+
+ aField = (XInterface)
+ _oMSF.createInstance("com.sun.star.text.TextField.URL");
+ oContent = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, aField);
+
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ XCell oCell = oSheet.getCellByPosition(2,3);
+ oText = (XText)UnoRuntime.queryInterface(XText.class, oCell);
+
+ oText.insertTextContent(
+ oText.createTextCursor(), oContent, true);
+
+ xTextFieldsSupp = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell);
+
+ oObj = xTextFieldsSupp.getTextFields().createEnumeration();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured while creating test Object.");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test object", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ tEnv.addObjRelation("ENUM", xTextFieldsSupp.getTextFields());
+
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java
new file mode 100644
index 000000000000..bafb8cd3d68f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XLabelRange;
+import com.sun.star.sheet.XLabelRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.LabelRange</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XLabelRange</code></li>
+* </ul>
+* @see com.sun.star.sheet.LabelRange
+* @see com.sun.star.sheet.XLabelRange
+* @see ifc.sheet._XLabelRange
+*/
+public class ScLabelRangeObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the value of the property <code>'ColumnLabelRanges'</code>
+ * from the document. The property value is the collection of label ranges.
+ * Adds new label range to the collection using the interface
+ * <code>XLabelRanges</code> that was queried from the property value.
+ * Retrieved from the collection the label range with index 0.
+ * The retrieved label range is the instance of the service
+ * <code>com.sun.star.sheet.LabelRange</code>.
+ * @see com.sun.star.sheet.LabelRange
+ * @see com.sun.star.sheet.XLabelRanges
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ try {
+ log.println("Getting test object ") ;
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object ranges = docProps.getPropertyValue("ColumnLabelRanges");
+ XLabelRanges lRanges = (XLabelRanges)
+ UnoRuntime.queryInterface(XLabelRanges.class, ranges);
+
+ log.println("Adding at least one element for ElementAccess interface");
+ CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6);
+ CellRangeAddress aRange1 = new CellRangeAddress((short)0, 0, 0, 0, 1);
+ lRanges.addNew(aRange1, aRange2);
+
+ oObj = (XLabelRange) AnyConverter.toObject(
+ new Type(XLabelRange.class),lRanges.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e) ;
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("testing...");
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScLabelRangeObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java
new file mode 100644
index 000000000000..6808d2f6401a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XLabelRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+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.LabelRanges</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XLabelRanges</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.LabelRanges
+* @see com.sun.star.sheet.XLabelRanges
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.sheet._XLabelRanges
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScLabelRangesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the value of the property <code>'ColumnLabelRanges'</code>
+ * from the document. The property value is the collection of label ranges.
+ * Adds new label range to the collection using the interface
+ * <code>XLabelRanges</code> that was queried from the property value.
+ * This collection is the instance of the service
+ * <code>com.sun.star.sheet.LabelRanges</code>.
+ * @see com.sun.star.sheet.LabelRanges
+ * @see com.sun.star.sheet.XLabelRanges
+ */
+ public synchronized 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" );
+
+ try {
+ log.println("Getting test object ") ;
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object ranges = docProps.getPropertyValue("ColumnLabelRanges");
+ XLabelRanges lRanges = (XLabelRanges)
+ UnoRuntime.queryInterface(XLabelRanges.class, ranges);
+
+ log.println("Adding at least one element for ElementAccess interface");
+ CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6);
+ CellRangeAddress aRange1 = new CellRangeAddress((short)0, 0, 0, 0, 1);
+ lRanges.addNew(aRange1, aRange2);
+
+ oObj = lRanges;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(
+ "Error getting test object from spreadsheet document",e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("testing...");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScLabelRangesObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScModelObj.java b/qadevOOo/tests/java/mod/_sc/ScModelObj.java
new file mode 100644
index 000000000000..52223953c94a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScModelObj.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XSelectionSupplier;
+import ifc.view._XPrintJobBroadcaster;
+import java.io.File;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.SpreadsheetDocument</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSpreadsheetDocument</code></li>
+* <li> <code>com::sun::star::sheet::SpreadsheetDocumentSettings</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::frame::XModel</code></li>
+* <li> <code>com::sun::star::sheet::SpreadsheetDocument</code></li>
+* <li> <code>com::sun::star::util::XNumberFormatsSupplier</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.SpreadsheetDocument
+* @see com.sun.star.sheet.XSpreadsheetDocument
+* @see com.sun.star.sheet.SpreadsheetDocumentSettings
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.frame.XModel
+* @see com.sun.star.sheet.SpreadsheetDocument
+* @see com.sun.star.util.XNumberFormatsSupplier
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._XSpreadsheetDocument
+* @see ifc.sheet._SpreadsheetDocumentSettings
+* @see ifc.lang._XComponent
+* @see ifc.frame._XModel
+* @see ifc.sheet._SpreadsheetDocument
+* @see ifc.util._XNumberFormatsSupplier
+* @see ifc.beans._XPropertySet
+*/
+public class ScModelObj extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+ public static XSpreadsheetDocument xSecondsheetDoc;
+
+ /**
+ * Disposes Spreadsheet documents.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+
+ oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ xSecondsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Disposes the spreadsheet documents if they was created already.
+ * Creates two spreadsheet documents. Rertieves the current controller for
+ * each of them. Obtains the collection of spreadsheets, takes one of them
+ * and takes some cell from the spreadsheet. The created documents are the instances
+ * of the service <code>com.sun.star.sheet.SpreadsheetDocument</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SELSUPP'</code> for
+ * {@link ifc.frame._XModel}( the interface
+ * <code>XSelectionSupplier</code> that was queried from the current
+ * controller of the spreadsheet)</li>
+ * <li> <code>'TOSELECT'</code> for
+ * {@link ifc.frame._XModel}( the cell that was retrieved from the
+ * spreadsheet)</li>
+ * <li> <code>'CONT2'</code> for
+ * {@link ifc.frame._XModel}( the current controller of the second
+ * spreadsheet)</li>
+ * </ul>
+ * @see
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("craeting a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ if (xSpreadsheetDoc != null) {
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ if (xSecondsheetDoc != null) {
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSecondsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ try {
+ log.println("creating two spreadsheet documents");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ xSecondsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document ", e);
+ }
+
+ XModel model1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xSpreadsheetDoc);
+ XModel model2 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xSecondsheetDoc);
+ XInterface oObj = model1;
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XController cont1 = model1.getCurrentController();
+ XController cont2 = model2.getCurrentController();
+ cont1.getFrame().setName("cont1");
+ cont2.getFrame().setName("cont2");
+
+ XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, cont1);
+
+ XCell toSel = null;
+ XCell[] xCalculatableCells = null;
+ try {
+ log.println("Getting spreadsheet");
+
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets();
+ XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexSheets.getByIndex(0));
+
+ log.println("Getting a cell from sheet");
+ toSel = oSheet.getCellByPosition(2, 3);
+ // create a simple formula for XCalculatable
+ oSheet.getCellByPosition(4, 5).setValue(15);
+ oSheet.getCellByPosition(5, 5).setValue(10);
+ oSheet.getCellByPosition(6, 5).setFormula("= E6 * F6");
+ xCalculatableCells = new XCell[]{
+ oSheet.getCellByPosition(4, 5),
+ oSheet.getCellByPosition(5, 5),
+ oSheet.getCellByPosition(6, 5)
+ };
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Error getting cell object from spreadsheet document", e);
+ }
+
+ log.println("Adding SelectionSupplier and Shape to select for XModel");
+ tEnv.addObjRelation("SELSUPP", sel);
+ tEnv.addObjRelation("TOSELECT", toSel);
+
+ log.println("Adding cells for XCalculatable");
+ tEnv.addObjRelation("XCalculatable.Cells", xCalculatableCells);
+ log.println("adding Controller as ObjRelation for XModel");
+ tEnv.addObjRelation("CONT2", cont2);
+
+ // create object relation for XPrintJobBroadcaster
+ String fileName = utils.getOfficeTempDirSys((XMultiServiceFactory) Param.getMSF())+"printfile.prt" ;
+ File f = new File(fileName);
+ if (f.exists()) {
+ f.delete();
+ }
+ _XPrintJobBroadcaster.MyPrintJobListener listener = new _XPrintJobBroadcaster.MyPrintJobListener(oObj, fileName);
+ tEnv.addObjRelation("XPrintJobBroadcaster.XPrintJobListener", listener);
+
+ return tEnv;
+ }
+
+} // finish class ScModelObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java
new file mode 100644
index 000000000000..2fcac156fca3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XNamedRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.NamedRange</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::XNamedRange</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeReferrer</code></li>
+* </ul>
+* @see com.sun.star.sheet.NamedRange
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.XNamedRange
+* @see com.sun.star.sheet.XCellRangeReferrer
+* @see ifc.container._XNamed
+* @see ifc.sheet._XNamedRange
+* @see ifc.sheet._XCellRangeReferrer
+*/
+public class ScNamedRangeObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Obtains the value of the property
+ * <code>'NamedRanges'</code> that is the collection of named ranges.
+ * Creates and adds new range to the collection. This new range is the instance of the
+ * service <code>com.sun.star.sheet.NamedRange</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DATAAREA'</code> for
+ * {@link ifc.sheet._XCellRangeReferrer} (the cell range address of the
+ * created range) </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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 ") ;
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+
+ Object ranges = null;
+ try {
+ ranges = docProps.getPropertyValue("NamedRanges");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ }
+
+ XNamedRanges xNamedRanges = (XNamedRanges)
+ UnoRuntime.queryInterface(XNamedRanges.class, ranges);
+
+ CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 1, 1);
+ CellAddress base = new CellAddress(DataArea.Sheet,
+ DataArea.StartColumn,
+ DataArea.StartRow);
+
+ if (xNamedRanges.hasByName("ANamedRange")) {
+ xNamedRanges.removeByName("ANamedRange");
+ }
+
+ xNamedRanges.addNewByName("ANamedRange", "A1:B2", base, 0);
+
+ CellAddress listOutputPosition = new CellAddress((short)0, 1, 1);
+ xNamedRanges.outputList(listOutputPosition);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xNamedRanges.getByName("ANamedRange"));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("DATAAREA", DataArea);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java
new file mode 100644
index 000000000000..ef9ad060e0dc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XNamedRanges;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.NamedRanges</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XNamedRanges</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.NamedRanges
+* @see com.sun.star.sheet.XNamedRanges
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.sheet._XNamedRanges
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScNamedRangesObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Obtains the value of the property
+ * <code>'NamedRanges'</code> that is the collection of named ranges.
+ * This collection is the instance of the service
+ * <code>com.sun.star.sheet.NamedRanges</code>. Creates and adds new range to
+ * the collection.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SHEET'</code> for
+ * {@link ifc.sheet._XNamedRanges} (the retrieved spreadsheet) </li>
+ * </ul>
+ * @see com.sun.star.sheet.NamedRanges
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+ XSpreadsheet oSheet = null;
+
+ log.println("Getting test object ");
+ XSpreadsheets oSheets = xSheetDoc.getSheets();
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ // Getting named ranges.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object ranges = null;
+ try {
+ ranges = docProps.getPropertyValue("NamedRanges");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NamedRanges", e);
+ }
+
+ XNamedRanges xNamedRanges = (XNamedRanges)
+ UnoRuntime.queryInterface(XNamedRanges.class, ranges);
+
+ CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2);
+ CellAddress base = new CellAddress(DataArea.Sheet,
+ DataArea.StartColumn,
+ DataArea.StartRow);
+
+ xNamedRanges.addNewByName("ANamedRange", "A1:B2", base, 0);
+
+ CellAddress listOutputPosition = new CellAddress((short)0, 1, 1);
+ xNamedRanges.outputList(listOutputPosition);
+
+ oObj = xNamedRanges;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("SHEET", oSheet);
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java
new file mode 100644
index 000000000000..aeaa0a4eab65
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.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;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.RecentFunctions</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XRecentFunctions</code></li>
+* </ul>
+* @see com.sun.star.sheet.RecentFunctions
+* @see com.sun.star.sheet.XRecentFunctions
+* @see ifc.sheet._XRecentFunctions
+*/
+public class ScRecentFunctionsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sheet.RecentFunctions</code> and an instance of the
+ * service <code>com.sun.star.sheet.FunctionDescriptions</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FUNCTIONLIST'</code> for
+ * {@link ifc.sheet._XRecentFunctions}(the second created instance)</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ XInterface allFunctions = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ try {
+ log.println("Getting test object ") ;
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)Param.getMSF();
+ oObj = (XInterface)oDocMSF.createInstance(
+ "com.sun.star.sheet.RecentFunctions");
+ allFunctions = (XInterface)oDocMSF.createInstance(
+ "com.sun.star.sheet.FunctionDescriptions");
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ XNameAccess NA = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, allFunctions);
+ tEnv.addObjRelation("FUNCTIONLIST", NA);
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java
new file mode 100644
index 000000000000..51f284453e77
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XScenariosSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.Scenarios</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::sheet::XScenarios</code></li>
+* </ul>
+* @see com.sun.star.sheet.Scenarios
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.sheet.XScenarios
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.sheet._XScenarios
+*/
+public class ScScenariosObj extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Fills some cells of the spreadsheet.
+ * Retrieves the collection of all scenarios using the interface
+ * <code>XScenariosSupplier</code>. Creates a new scenario and adds it to the
+ * collection. This collection is the instance of the service
+ * <code>com.sun.star.sheet.Scenarios</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ADDR'</code> for
+ * {@link ifc.sheet._XScenarios}(the array of cell range addresses
+ * of the created scenario)</li>
+ * </ul>
+ * @see com.sun.star.sheet.Scenarios
+ * @see com.sun.star.sheet.XScenariosSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet)AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't fill some cell", e);
+ }
+
+ XScenariosSupplier xSupp = (XScenariosSupplier)
+ UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet);
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+
+ xSupp.getScenarios().addNewByName("ScScenarios", oAddr, "Range");
+
+ XInterface oObj = xSupp.getScenarios();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("adding ObjectRelation for XScenarios");
+ tEnv.addObjRelation("ADDR", oAddr);
+
+ return tEnv;
+ }
+
+
+} // finish class ScScenariosObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java
new file mode 100644
index 000000000000..e8953bb3efdf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ScShapeObj extends TestCase {
+
+ static XComponent xSheetDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a sheetdoc" );
+ xSheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.EllipseShape</code> as tested component
+ * and adds it to the document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xSheetDoc,5000, 3500, 7500, 5000,"Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xSheetDoc,0)).add(oShape);
+ oObj = oShape ;
+
+ for (int i=0; i < 10; i++) {
+ DrawTools.getShapes(DrawTools.getDrawPage(xSheetDoc,0)).add(
+ SOF.createShape(xSheetDoc,
+ 5000, 3500, 7510 + 10 * i, 5010 + 10 * i, "Rectangle"));
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oShape );
+
+ log.println("Implementation name: "+util.utils.getImplName(oObj));
+ tEnv.addObjRelation("DOCUMENT",xSheetDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScShapeObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java
new file mode 100644
index 000000000000..8af7acd39fa6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetLinkable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SheetLink</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::util::XRefreshable</code></li>
+* <li> <code>com::sun::star::sheet::SheetLink</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> ScSheetLinksObj.sdc </b> : for creating link </li>
+* </ul> <p>
+* @see com.sun.star.sheet.SheetLink
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.util.XRefreshable
+* @see com.sun.star.sheet.SheetLink
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.util._XRefreshable
+* @see ifc.sheet._SheetLink
+* @see ifc.beans._XPropertySet
+*/
+public class ScSheetLinkObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Links the sheet to another sheet in another
+ * document using the interface <code>XSheetLinkable</code>. Obtains the
+ * value of the property <code>'SheetLinks'</code> that is the collection of
+ * sheet links. Retrieves from the collection one of the sheet link that
+ * is the instance of the service <code>com.sun.star.sheet.SheetLink</code>.
+ * @see com.sun.star.sheet.SheetLink
+ * @see com.sun.star.sheet.XSheetLinkable
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+ XSpreadsheet oSheet = null;
+
+ log.println("Getting test object ") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ XSheetLinkable SL = (XSheetLinkable)
+ UnoRuntime.queryInterface(XSheetLinkable.class, oSheet);
+
+ // creating link. Doesn't matter that it refers to unexistant object.
+ // this is for proper work of XAccess tests.
+ String sURL = utils.getFullTestDocName("ScSheetLinksObj.sdc");
+ SL.link(sURL, "Sheet1", "", "", com.sun.star.sheet.SheetLinkMode.VALUE);
+
+ // Getting links.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+ Object oLinks = null;
+ try {
+ oLinks = docProps.getPropertyValue("SheetLinks");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ }
+
+ XNameAccess links = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oLinks);
+
+ String[] names = links.getElementNames();
+
+ try {
+ oObj = (XInterface)AnyConverter.toObject(
+ new Type(XInterface.class),links.getByName(names[0]));
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.container.NoSuchElementException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by name", e);
+ }
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java
new file mode 100644
index 000000000000..9f7fb9a2d32f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSheetLinkable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SheetLinks</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.SheetLinks
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class ScSheetLinksObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Links the sheet to another sheet using the
+ * interface <code>XSheetLinkable</code>. Obtains the
+ * value of the property <code>'SheetLinks'</code> that is the collection of
+ * sheet links. This collection is the instance of the service
+ * <code>com.sun.star.sheet.SheetLinks</code>.
+ * @see com.sun.star.sheet.SheetLink
+ * @see com.sun.star.sheet.XSheetLinkable
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ 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" );
+ XSpreadsheet oSheet = null;
+
+ log.println("Getting test object ") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ XSheetLinkable SL = (XSheetLinkable)
+ UnoRuntime.queryInterface(XSheetLinkable.class, oSheet);
+
+ // creating link. Doesn't matter that it refers to unexistant object.
+ // this is for proper work of X*Access tests.
+ String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
+ SL.link(aSourceArea, "Sheet1", "", "",
+ com.sun.star.sheet.SheetLinkMode.VALUE);
+
+ // Getting links.
+ XPropertySet docProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
+
+ Object links = null;
+ try {
+ links = docProps.getPropertyValue("SheetLinks");
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SheetLinks", e);
+ }
+
+ oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links);
+
+ log.println("Creating object - " +
+ ((oObj == null) ? "FAILED" : "OK"));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java
new file mode 100644
index 000000000000..74ffdf1a8928
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XSortable;
+
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.sheet.SheetSortDescriptor
+ *
+ */
+public class ScSortDescriptorBase extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ XSortable xSORT = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+ if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK");
+
+ log.println("getting a sheet");
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0));
+ } catch (Exception e) {
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ xSORT = (XSortable) UnoRuntime.queryInterface(XSortable.class,oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("xSORT",xSORT);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScSortDescriptorBase
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
new file mode 100644
index 000000000000..98a7d7658353
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.GlobalSheetSettings</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::GlobalSheetSettings</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.GlobalSheetSettings
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._GlobalSheetSettings
+* @see ifc.beans._XPropertySet
+*/
+public class ScSpreadsheetSettings extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.sheet.GlobalSheetSettings</code>.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, 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" );
+
+ // create testobject here
+ try {
+ oObj = (XInterface)((XMultiServiceFactory)tParam.getMSF()).
+ createInstance("com.sun.star.sheet.GlobalSheetSettings");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScSpreadsheetSettings
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java
new file mode 100644
index 000000000000..a38071cb4041
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.lang.XMultiServiceFactory;
+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 {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ 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>.
+ */
+ public synchronized 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/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java
new file mode 100644
index 000000000000..fd5d58a5039a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.style.StyleFamilies</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* </ul>
+* @see com.sun.star.style.StyleFamilies
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XIndexAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XIndexAccess
+*/
+public class ScStyleFamiliesObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families from the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * This collection is the instance of the service
+ * <code>com.sun.star.style.StyleFamilies</code>.
+ * @see com.sun.star.style.StyleFamilies
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XNameAccess oStyleFamilies=null;
+ // create testobject here
+ log.println("getting style families");
+ XStyleFamiliesSupplier oStyleFamiliesSupplier =(XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class, xSpreadsheetDoc);
+
+ oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies();
+
+ TestEnvironment tEnv = new TestEnvironment(oStyleFamilies);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+} // finish class ScStyleFamiliesObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java
new file mode 100644
index 000000000000..128acaa84d4c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.style.StyleFamily</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* </ul>
+* @see com.sun.star.style.StyleFamily
+* @see com.sun.star.container.XNameContainer
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XNameReplace
+* @see ifc.container._XNameContainer
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XNameReplace
+*/
+public class ScStyleFamilyObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families from the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains style family with index 0 from the collection.
+ * Creates the two instance of the service <code>com.sun.star.style.CellStyle</code>.
+ * One of the instance uses for inserting of new style to the obtained style
+ * family that is the instance of the service
+ * <code>com.sun.star.style.StyleFamily</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SecondInstance'</code> for
+ * {@link ifc.container._XNameContainer}(the second created instance of
+ * the service <code>com.sun.star.style.CellStyle</code>)</li>
+ * <li> <code>'XNameReplaceINDEX'</code> for
+ * {@link ifc.container._XNameContainer}(the number of the current
+ * running threads multiplied by two)</li>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XNameContainer}(the created instances of
+ * the service <code>com.sun.star.style.CellStyle</code>)</li>
+ * </ul>
+ * @see com.sun.star.style.CellStyle
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XNameAccess oStyleFamilyNameAccess = null;
+ // create testobject here
+ log.println("getting style");
+ XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class, xSpreadsheetDoc);
+
+ XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies();
+ XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies);
+ try {
+ oStyleFamilyNameAccess = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),
+ oStyleFamiliesIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occured while getting StyleFamily", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occured while getting StyleFamily", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occured while getting StyleFamily", e);
+ }
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ XComponent xComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+
+ XInterface oInstance = (XInterface)
+ SOF.createInstance(xComp,"com.sun.star.style.CellStyle");
+
+ // insert a Style which can be replaced by name
+ XNameContainer oContainer = (XNameContainer)
+ UnoRuntime.queryInterface(
+ XNameContainer.class, oStyleFamilyNameAccess);
+ try {
+ oContainer.insertByName("ScStyleFamilyObj", oInstance);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert new style family", e);
+ } catch (com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert new style family", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert new style family", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oStyleFamilyNameAccess);
+
+ oInstance = (XInterface)
+ SOF.createInstance(xComp, "com.sun.star.style.CellStyle");
+
+ //second instance for insertByName in XNameContainer
+ tEnv.addObjRelation("SecondInstance", oInstance);
+
+ int THRCNT = 1;
+ if ((String)tParam.get("THRCNT") != null) {
+ THRCNT = Integer.parseInt((String)tParam.get("THRCNT"));
+ }
+
+ log.println( "adding XNameReplaceINDEX as mod relation to environment" );
+ tEnv.addObjRelation("XNameReplaceINDEX", new Integer(2*THRCNT).toString());
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+ for (int n = 1; n < 2*(THRCNT+1) ;n++ ) {
+ log.println( "adding INSTANCE" + n +
+ " as mod relation to environment" );
+ tEnv.addObjRelation("INSTANCE" + n, SOF.createInstance(
+ xComp,"com.sun.star.style.CellStyle"));
+ }
+ // NAMEREPLACE : _XNameReplace
+ log.println("adding NAMEREPLACE as mod relation to environment");
+ String cName = "ScStyleFamilyObj";
+ tEnv.addObjRelation("NAMEREPLACE", cName);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ScStyleFamilyObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java
new file mode 100644
index 000000000000..7937aebb549f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java
@@ -0,0 +1,270 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.style.Style</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::style::Style</code></li>
+* <li> <code>com::sun::star::style::XStyle</code></li>
+* </ul>
+* @see com.sun.star.style.Style
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.style.Style
+* @see com.sun.star.style.XStyle
+* @see ifc.container._XNamed
+* @see ifc.style._Style
+* @see ifc.style._XStyle
+*/
+public class ScStyleObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of style families from the document
+ * using the interface <code>XStyleFamiliesSupplier</code>.
+ * Obtains style family with index 0 from the collection and obtains
+ * style with index 0 from this style family. Creates the instance of the
+ * service <code>com.sun.star.style.CellStyle</code>. Inserts the created
+ * style to the obtained style family. Retrieves a collection of spreadsheets
+ * from the document and takes one of them. Gets a cell from the spreadsheet
+ * and sets the value of property <code>'CellStyle'</code> to the created
+ * style. The created style is the instance of the service
+ * <code>com.sun.star.style.Style</code> also.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PoolStyle'</code> for
+ * {@link ifc.style._XStyle}(the style with index 0 that was obtained
+ * from the collection)</li>
+ * </ul>
+ * @see com.sun.star.style.CellStyle
+ * @see com.sun.star.style.Style
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+
+ log.println("creating a test environment");
+
+ log.println("getting style");
+ XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class, xSpreadsheetDoc);
+ XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies();
+ XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies);
+ XNameAccess oStyleFamilyNameAccess = null;
+ XStyle oStyle = null;
+ try {
+ oStyleFamilyNameAccess = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),
+ oStyleFamiliesIndexAccess.getByIndex(0));
+
+ XIndexAccess oStyleFamilyIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,
+ oStyleFamilyNameAccess);
+ oStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oStyleFamilyIndexAccess.getByIndex(0));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ log.println("Creating a user-defined style");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, xSpreadsheetDoc);
+
+ XInterface oInt = null;
+ try {
+ oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.CellStyle");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+ XStyle oMyStyle = (XStyle)UnoRuntime.queryInterface(XStyle.class, oInt);
+
+ XNameContainer oStyleFamilyNameContainer = (XNameContainer)UnoRuntime.
+ queryInterface(XNameContainer.class, oStyleFamilyNameAccess);
+
+ try {
+ if (oStyleFamilyNameContainer.hasByName("My Style")) {
+ oStyleFamilyNameContainer.removeByName("My Style");
+ }
+
+ oStyleFamilyNameContainer.insertByName("My Style", oMyStyle);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test environment", e);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test environment", e);
+ } catch(com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test environment", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create test environment", e);
+ }
+
+
+ //using the style
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+
+ XCell aCell = null;
+ try {
+ XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ log.println("Getting a cell from sheet") ;
+ aCell = oSheet.getCellByPosition(2,3) ;
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet by index", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet by index", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet by index", e);
+ }
+
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, aCell);
+
+ try {
+ xProp.setPropertyValue("CellStyle", oMyStyle.getName());
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property CellStyle", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property CellStyle", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property CellStyle", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property CellStyle", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oMyStyle);
+
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ tEnv.addObjRelation("PropertyNames", getPropertyNames
+ ((XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oMyStyle)));
+
+ return tEnv;
+ }
+
+ public String[] getPropertyNames(XPropertySet props) {
+ Property[] the_props = props.getPropertySetInfo().getProperties();
+ Vector names = new Vector() ;
+
+ for (int i=0;i<the_props.length;i++) {
+ boolean isWritable =
+ ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0);
+ if (isWritable) {
+ names.add(the_props[i].Name);
+ }
+ }
+ return (String[]) names.toArray(new String[names.size()]) ;
+ }
+} // finish class ScStyleObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java
new file mode 100644
index 000000000000..eb821d2fabbe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.sheet.XSubTotalCalculatable;
+import com.sun.star.sheet.XSubTotalDescriptor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SubTotalDescriptor</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSubTotalDescriptor</code></li>
+* <li> <code>com::sun::star::sheet::SubTotalDescriptor</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.sheet.XSubTotalDescriptor
+* @see com.sun.star.sheet.SubTotalDescriptor
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.sheet._XSubTotalDescriptor
+* @see ifc.sheet._SubTotalDescriptor
+* @see ifc.beans._XPropertySet
+*/
+public class ScSubTotalDescriptorBase extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Creates a subtotal descriptor using the interface
+ * <code>XSubTotalCalculatable</code>. This descriptor is the instance of the
+ * service <code>com.sun.star.sheet.SubTotalDescriptor</code>.
+ * @see com.sun.star.sheet.XSubTotalCalculatable
+ * @see com.sun.star.sheet.SubTotalDescriptor
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ XSubTotalCalculatable xSTC = (XSubTotalCalculatable)
+ UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet);
+
+ SubTotalColumn[] columns = new SubTotalColumn[1];
+ SubTotalColumn column = new SubTotalColumn();
+ column.Column = 3;
+ column.Function = GeneralFunction.SUM;
+ columns[0] = column;
+
+ XSubTotalDescriptor desc = xSTC.createSubTotalDescriptor(true);
+ desc.addNew(columns, 1);
+
+ XInterface oObj = desc;
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScSubTotalDescriptorBase
diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java
new file mode 100644
index 000000000000..0282e18c11f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.sheet.XSubTotalCalculatable;
+import com.sun.star.sheet.XSubTotalDescriptor;
+import com.sun.star.sheet.XSubTotalField;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SubTotalField</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSubTotalField</code></li>
+* </ul>
+* @see com.sun.star.sheet.SubTotalField
+* @see com.sun.star.sheet.XSubTotalField
+* @see ifc.sheet._XSubTotalField
+*/
+public class ScSubTotalFieldObj extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Creates a subtotal descriptor using the interface
+ * <code>XSubTotalCalculatable</code>. Adds a subtotal field definition to
+ * the descriptor. Obtains the subtotal field with index 0 from the
+ * collection. The obtained subtotal field is the instance of the service
+ * <code>com.sun.star.sheet.SubTotalField</code>.
+ * @see com.sun.star.sheet.XSubTotalCalculatable
+ * @see com.sun.star.sheet.SubTotalField
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type (XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ XSubTotalCalculatable xSTC = (XSubTotalCalculatable)
+ UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet);
+
+ XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true);
+
+ SubTotalColumn[] columns = new SubTotalColumn[1];
+ SubTotalColumn column = new SubTotalColumn();
+ column.Column = 5;
+ column.Function = GeneralFunction.SUM;
+ columns[0] = column;
+ xSTD.addNew(columns, 1);
+
+ XIndexAccess oDescIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSTD);
+
+ XInterface oObj = null;
+
+ try {
+ oObj = ( XSubTotalField ) AnyConverter.toObject(
+ new Type(XSubTotalField.class),oDescIndex.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get XSubTotalField", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get XSubTotalField", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get XSubTotalField", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class ScSubTotalFieldObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java
new file mode 100644
index 000000000000..6431bcaeeb66
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XForm;
+import com.sun.star.lang.WrappedTargetException;
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.SpreadsheetView</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::sheet::XViewSplitable</code></li>
+ * <li> <code>com::sun::star::sheet::XViewFreezable</code></li>
+ * <li> <code>com::sun::star::sheet::SpreadsheetViewSettings</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::sheet::XSpreadsheetView</code></li>
+ * <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+ * </ul>
+ * @see com.sun.star.sheet.XViewSplitable
+ * @see com.sun.star.sheet.XViewFreezable
+ * @see com.sun.star.sheet.SpreadsheetViewSettings
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.sheet.XSpreadsheetView
+ * @see com.sun.star.view.XSelectionSupplier
+ * @see ifc.sheet._XViewSplitable
+ * @see ifc.sheet._XViewFreezable
+ * @see ifc.sheet._SpreadsheetViewSettings
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.sheet._XSpreadsheetView
+ * @see ifc.view._XSelectionSupplier
+ */
+public class ScTabViewObj extends TestCase {
+ public static XSpreadsheetDocument xSpreadsheetDoc;
+ public static XSpreadsheetDocument xSpreadsheetDoc2;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating two spreadsheet documents");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ try {
+ Thread.sleep(1000);
+ } catch (java.lang.InterruptedException e) {}
+ xSpreadsheetDoc2 = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ XComponent oComp2 = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc2) ;
+ util.DesktopTools.closeDoc(oComp2);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retieves the current controller of the spreadsheet document using the
+ * interface <code>XModel</code>. The controller is the instance of the
+ * service <code>com.sun.star.sheet.SpreadsheetView</code>. Retrieves
+ * a collection of spreadsheets from the document and takes one of them.
+ * Fills two cells in the spreadsheet.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Sheet'</code> for
+ * {@link ifc.sheet._XSpreadsheetView}(the retrieved spreadsheet)</li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.sheet.SpreadsheetView
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XDrawPage oDrawPage = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XModel aSecondModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc2);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class), oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XDispatchProvider.URL", ".uno:Copy") ;
+
+ log.println("adding 'Sheet' as ObjRelation");
+ tEnv.addObjRelation("Sheet", oSheet);
+ tEnv.addObjRelation("Frame",aModel.getCurrentController().getFrame());
+ tEnv.addObjRelation("SecondModel",aSecondModel);
+ tEnv.addObjRelation("FirstModel",aModel);
+
+ //Relation for XControlAccess
+ tEnv.addObjRelation("DOCUMENT", UnoRuntime.queryInterface(XComponent.class,xSpreadsheetDoc));
+ tEnv.addObjRelation("XControlAccess.isSheet", Boolean.TRUE);
+ //Relations for XSelectionSupplier
+ XCell cell_1 = null;
+ XCell cell_2 = null;
+ Object cellRange = null;
+ try {
+ cellRange = (Object)oSheet.getCellRangeByPosition(0, 0, 3, 3);
+ cell_1 = oSheet.getCellByPosition(5,5);
+ cell_2 = oSheet.getCellByPosition(7,7);
+ cell_2.setValue(17.5);
+ cell_1.setValue(5.5);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get some cell", e);
+ }
+
+ Object[] selections = {oSheet, cellRange, cell_1, cell_2};
+ tEnv.addObjRelation("Selections", selections);
+
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XCellRangeAddressable adr1 = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, o1);
+ XCellRangeAddressable adr2 = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, o2);
+ if (adr1 == null || adr2 == null) return -1;
+ CellRangeAddress range1 = adr1.getRangeAddress();
+ CellRangeAddress range2 = adr2.getRangeAddress();
+ return ValueComparer.equalValue(range1, range2) ? 0 : 1 ;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ // XForm for com.sun.star.view.XFormLayerAccess
+
+ XForm myForm = null;
+ String kindOfControl="CommandButton";
+ XShape aShape = null;
+ try{
+ log.println("adding contol shape '" + kindOfControl + "'");
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ;
+
+ aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl);
+
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create following control shape : '" +
+ kindOfControl + "': ", e);
+ }
+
+ log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm");
+ try {
+ log.println( "getting Drawpages" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc);
+ XDrawPages oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDP.getByIndex(0));
+ if (oDrawPage == null)
+ log.println("ERROR: could not get DrawPage: null");
+
+ oDrawPage.add(aShape);
+ log.println("getting XForm");
+ XNameContainer xForm = FormTools.getForms(oDrawPage);
+ try {
+ myForm = (XForm) AnyConverter.toObject(new Type(XForm.class),xForm.getByName("Standard"));
+ } catch (WrappedTargetException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ } catch (NoSuchElementException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ }
+ if (myForm == null)
+ log.println("ERROR: could not get XForm: null");
+ tEnv.addObjRelation("XFormLayerAccess.XForm", myForm);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (WrappedTargetException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ }
+ return tEnv;
+ }
+
+} // finish class ScTabViewObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java
new file mode 100644
index 000000000000..541de2ee0c9c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableColumn</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::table::TableColumn</code></li>
+* <li> <code>com::sun::star::table::XCellRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.table.TableColumn
+* @see com.sun.star.table.XCellRange
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.container._XNamed
+* @see ifc.table._TableColumn
+* @see ifc.table._XCellRange
+* @see ifc.beans._XPropertySet
+*/
+public class ScTableColumnObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Obtaines the collection of columns in the range using the interface
+ * <code>XColumnRowRange</code>. Retrieves the column with index 10 that is
+ * the instance of the service <code>com.sun.star.table.TableColumn</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'setName'</code> for
+ * {@link ifc.container._XNamed} </li>
+ * <li> <code>'ValidRange'</code> for
+ * {@link ifc.table._XCellRange} </li>
+ * </ul>
+ * @see com.sun.star.table.XColumnRowRange
+ * @see com.sun.star.table.TableColumn
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ XSpreadsheet xSpreadsheet = null;
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get element by name", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get element by name", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get element by name", e);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+ XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oColumns);
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oIndexAccess.getByIndex(10));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // a valid Range for XCellRange
+ tEnv.addObjRelation("ValidRange","K1:K1");
+
+ //since TableColumnsNames are fixed XNamed::setName() should always be OK
+ tEnv.addObjRelation("setName",new Boolean(true));
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java
new file mode 100644
index 000000000000..c93b5fcf8f51
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableColumns</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::table::XTableColumns</code></li>
+* </ul>
+* @see com.sun.star.table.TableColumns
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.table.XTableColumns
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.table._XTableColumns
+*/
+public class ScTableColumnsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Obtaines the collection of columns in the range using the interface
+ * <code>XColumnRowRange</code>. This collection is the instance of the
+ * service <code>com.sun.star.table.TableColumns</code>.
+ * @see com.sun.star.table.XColumnRowRange
+ * @see com.sun.star.table.TableColumns
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("craeting a test environment");
+
+ log.println("getting column");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ XSpreadsheet xSpreadsheet = null;
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+ XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
+ oObj = oColumns;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // adding relation for XTableColumns
+ tEnv.addObjRelation("XTableColumns.XCellRange",
+ UnoRuntime.queryInterface(XCellRange.class, xSpreadsheet));
+
+ return tEnv;
+ }
+} // finish class ScTableColumnsObj
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java
new file mode 100644
index 000000000000..ad91ad4b5712
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.ConditionOperator;
+import com.sun.star.sheet.XSheetConditionalEntries;
+import com.sun.star.sheet.XSheetConditionalEntry;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.TableConditionalEntry</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSheetConditionalEntry</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCondition</code></li>
+* </ul>
+* @see com.sun.star.sheet.TableConditionalEntry
+* @see com.sun.star.sheet.XSheetConditionalEntry
+* @see com.sun.star.sheet.XSheetCondition
+* @see ifc.sheet._XSheetConditionalEntry
+* @see ifc.sheet._XSheetCondition
+*/
+public class ScTableConditionalEntry extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Fills some cells of the spreadsheet. Retrieves value of the property
+ * <code>'ConditionalFormat'</code> that is the collection of the conditions
+ * of a conditional format. Adds new conditional entry to the collection
+ * using the interface <code>XSheetConditionalEntries</code>. Sets new value
+ * of the property <code>'ConditionalFormat'</code>. Obtains the conditional
+ * entry with index 0 that is the instance of the service
+ * <code>com.sun.star.sheet.TableConditionalEntry</code>.
+ * @see com.sun.star.sheet.XSheetConditionalEntries
+ * @see com.sun.star.sheet.TableConditionalEntry
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occurred while filling cells");
+ e.printStackTrace(log);
+ }
+
+ Object CFormat = null;
+ XPropertySet Props = null;
+
+ try {
+ Props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oSheet);
+ CFormat = Props.getPropertyValue("ConditionalFormat");
+ if (utils.isVoid(CFormat)) {
+ log.println("Property 'ConditionalFormat' is void");
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ try {
+ XSheetConditionalEntries xSCE = (XSheetConditionalEntries)
+ UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat);
+ xSCE.addNew(Conditions());
+ Props.setPropertyValue("ConditionalFormat", xSCE);
+ oObj = (XSheetConditionalEntry) AnyConverter.toObject(
+ new Type(XSheetConditionalEntry.class),xSCE.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while getting Entry", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Returns the array of the property values that was filled by condition
+ * values.
+ */
+ protected PropertyValue[] Conditions() {
+ PropertyValue[] con = new PropertyValue[5];
+ CellAddress ca = new CellAddress();
+ ca.Column = 1;
+ ca.Row = 5;
+ ca.Sheet = 0;
+ con[0] = new PropertyValue();
+ con[0].Name = "StyleName";
+ con[0].Value = "Result2";
+ con[1] = new PropertyValue();
+ con[1].Name = "Formula1";
+ con[1].Value = "$Sheet1.$B$5";
+ con[2] = new PropertyValue();
+ con[2].Name = "Formula2";
+ con[2].Value = "";
+ con[3] = new PropertyValue();
+ con[3].Name = "Operator";
+ con[3].Value = ConditionOperator.EQUAL;
+ con[4] = new PropertyValue();
+ con[4].Name = "SourcePosition";
+ con[4].Value = ca;
+ return con;
+ }
+
+} // finish class ScTableConditionalEntry
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java
new file mode 100644
index 000000000000..9dc73573ef9d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.ConditionOperator;
+import com.sun.star.sheet.XSheetConditionalEntries;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.TableConditionalFormat</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::sheet::XSheetConditionalEntries</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.sheet.TableConditionalFormat
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.sheet.XSheetConditionalEntries
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.sheet._XSheetConditionalEntries
+* @see ifc.container._XElementAccess
+*/
+public class ScTableConditionalFormat extends TestCase {
+
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Fills some cells of the spreadsheet. Retrieves value of the property
+ * <code>'ConditionalFormat'</code> that is the collection of the conditions
+ * of a conditional format. Adds new two conditional entries to the
+ * collection using the interface <code>XSheetConditionalEntries</code>.
+ * The retrieved collection is the instance of the service
+ * <code>com.sun.star.sheet.TableConditionalFormat</code>.
+ * @see com.sun.star.sheet.TableConditionalFormat
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occurred while filling cells");
+ e.printStackTrace(log);
+ }
+
+ XPropertySet Props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oSheet);
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),
+ Props.getPropertyValue("ConditionalFormat"));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ConditionalFromat", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ConditionalFromat", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ConditionalFromat", e);
+ }
+
+ XSheetConditionalEntries xSCE = (XSheetConditionalEntries)
+ UnoRuntime.queryInterface(XSheetConditionalEntries.class, oObj);
+ xSCE.addNew(Conditions(5));
+ xSCE.addNew(Conditions(2));
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Returns the array of the property values that was filled by condition
+ * values.
+ */
+ public PropertyValue[] Conditions(int nr) {
+ PropertyValue[] con = new PropertyValue[5];
+ CellAddress ca = new CellAddress();
+ ca.Column = 1;
+ ca.Row = 5;
+ ca.Sheet = 0;
+ con[0] = new PropertyValue();
+ con[0].Name = "StyleName";
+ con[0].Value = "Result2";
+ con[1] = new PropertyValue();
+ con[1].Name = "Formula1";
+ con[1].Value = "$Sheet1.$B$"+nr;
+ con[2] = new PropertyValue();
+ con[2].Name = "Formula2";
+ con[2].Value = "";
+ con[3] = new PropertyValue();
+ con[3].Name = "Operator";
+ con[3].Value = ConditionOperator.EQUAL;
+ con[4] = new PropertyValue();
+ con[4].Name = "SourcePosition";
+ con[4].Value = ca;
+ return con;
+ }
+
+} // finish class ScTableConditionalFormat
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java
new file mode 100644
index 000000000000..f4db946d2a3a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableRows;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableRow</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::table::TableRow</code></li>
+* <li> <code>com::sun::star::table::XCellRange</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.table.TableRow
+* @see com.sun.star.table.XCellRange
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.table._TableRow
+* @see ifc.table._XCellRange
+* @see ifc.beans._XPropertySet
+*/
+public class ScTableRowObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Obtains the collection of rows using the interface
+ * <code>XColumnRowRange</code>. Obtains the row with index 6 from the
+ * collection and this is the instance of the service
+ * <code>com.sun.star.table.TableRow</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ValidRange'</code> for
+ * {@link ifc.table._XCellRange} </li>
+ * </ul>
+ * @see com.sun.star.table.XColumnRowRange
+ * @see com.sun.star.table.TableRow
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of the testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ XSpreadsheet xSpreadsheet = null;
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+ XTableRows oRows = (XTableRows) oColumnRowRange.getRows();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oRows);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oIndexAccess.getByIndex(6));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception during creating Testenvironment", e);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception during creating Testenvironment", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception during creating Testenvironment", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception during creating Testenvironment", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("ValidRange","A7:A7");
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java
new file mode 100644
index 000000000000..46ac8fddc1ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableRows;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.table.TableRows</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::table::XTableRows</code></li>
+* </ul>
+* @see com.sun.star.table.TableRows
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.table.XTableRows
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.table._XTableRows
+*/
+public class ScTableRowsObj extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Obtains the collection of rows using the interface
+ * <code>XColumnRowRange</code>. The obtained collection is the instance of
+ * the service <code>com.sun.star.table.TableRows</code>.
+ * @see com.sun.star.table.XColumnRowRange
+ * @see com.sun.star.table.TableRows
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting row");
+ XSpreadsheet xSpreadsheet = null;
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
+ try {
+ xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oNames.getByName(oNames.getElementNames()[0]));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get spreadsheet", e);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+
+ XTableRows oRows = (XTableRows) oColumnRowRange.getRows();
+ oObj = oRows;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // adding relation for XTableRows
+ tEnv.addObjRelation("XTableRows.XCellRange",
+ UnoRuntime.queryInterface(XCellRange.class, xSpreadsheet));
+
+ return tEnv;
+ }
+} // finish class ScTableRowsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java
new file mode 100644
index 000000000000..d50e80008079
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java
@@ -0,0 +1,421 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XScenariosSupplier;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+import ifc.sheet._XCellRangesQuery;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.sheet.Spreadsheet</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+* <li> <code>com::sun::star::table::XTableChartsSupplier</code></li>
+* <li> <code>com::sun::star::sheet::XSpreadsheet</code></li>
+* <li> <code>com::sun::star::table::CellProperties</code></li>
+* <li> <code>com::sun::star::sheet::XSheetAnnotationsSupplier</code></li>
+* <li> <code>com::sun::star::table::XCellRange</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeAddressable</code></li>
+* <li> <code>com::sun::star::sheet::XDataPilotTablesSupplier</code></li>
+* <li> <code>com::sun::star::sheet::Spreadsheet</code></li>
+* <li> <code>com::sun::star::sheet::XCellRangeMovement</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::sheet::XSheetOperation</code></li>
+* <li> <code>com::sun::star::sheet::XScenariosSupplier</code></li>
+* <li> <code>com::sun::star::sheet::XSheetPageBreak</code></li>
+* <li> <code>com::sun::star::sheet::XArrayFormulaRange</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCellRange</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::sheet::SheetCellRange</code></li>
+* <li> <code>com::sun::star::chart::XChartData</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::util::XMergeable</code></li>
+* <li> <code>com::sun::star::table::XColumnRowRange</code></li>
+* </ul>
+* @see com.sun.star.style.ParagraphProperties
+* @see com.sun.star.table.XTableChartsSupplier
+* @see com.sun.star.sheet.XSpreadsheet
+* @see com.sun.star.table.CellProperties
+* @see com.sun.star.sheet.XSheetAnnotationsSupplier
+* @see com.sun.star.table.XCellRange
+* @see com.sun.star.sheet.XCellRangeAddressable
+* @see com.sun.star.sheet.XDataPilotTablesSupplier
+* @see com.sun.star.sheet.Spreadsheet
+* @see com.sun.star.sheet.XCellRangeMovement
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.sheet.XSheetOperation
+* @see com.sun.star.sheet.XScenariosSupplier
+* @see com.sun.star.sheet.XSheetPageBreak
+* @see com.sun.star.sheet.XArrayFormulaRange
+* @see com.sun.star.sheet.XSheetCellRange
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.sheet.SheetCellRange
+* @see com.sun.star.chart.XChartData
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.util.XMergeable
+* @see com.sun.star.table.XColumnRowRange
+* @see ifc.style._ParagraphProperties
+* @see ifc.table._XTableChartsSupplier
+* @see ifc.sheet._XSpreadsheet
+* @see ifc.table._CellProperties
+* @see ifc.sheet._XSheetAnnotationsSupplier
+* @see ifc.table._XCellRange
+* @see ifc.sheet._XCellRangeAddressable
+* @see ifc.sheet._XDataPilotTablesSupplier
+* @see ifc.sheet._Spreadsheet
+* @see ifc.sheet._XCellRangeMovement
+* @see ifc.style._CharacterProperties
+* @see ifc.sheet._XSheetOperation
+* @see ifc.sheet._XScenariosSupplier
+* @see ifc.sheet._XSheetPageBreak
+* @see ifc.sheet._XArrayFormulaRange
+* @see ifc.sheet._XSheetCellRange
+* @see ifc.container._XNamed
+* @see ifc.sheet._SheetCellRange
+* @see ifc.chart._XChartData
+* @see ifc.beans._XPropertySet
+* @see ifc.util._XMergeable
+* @see ifc.table._XColumnRowRange
+*/
+public class ScTableSheetObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+
+ try {
+ XCloseable oCloser = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xSheetDoc);
+ oCloser.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Document already disposed");
+ } catch (java.lang.NullPointerException e) {
+ log.println("Couldn't get XCloseable");
+ }
+
+ try {
+ log.println("Sleeping 500 Millis");
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {
+ }
+
+ log.println("... Done");
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Fills some cell in the spreadsheet. The retrieved spreadsheet is the
+ * instance of the service <code>com.sun.star.sheet.Spreadsheet</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'noArray'</code> for
+ * {@link ifc.sheet._XArrayFormulaRange}(to avoid the test of
+ * the interface <code>XArrayFormulaRange</code>)</li>
+ * </ul>
+ * @see com.sun.star.sheet.XArrayFormulaRange
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),
+ oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ oSheet.getCellByPosition(8, 8).setFormula("= B5 + C1");
+ // fill cells for XSheetOtline::autoutline
+ oSheet.getCellByPosition(6, 6).setValue(3);
+ oSheet.getCellByPosition(7, 6).setValue(3);
+ oSheet.getCellByPosition(8, 6).setFormula("= SUM(G7:H7)");
+ oSheet.getCellByPosition(9, 6).setFormula("= G7*I7");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Exception occurred while filling cells", e);
+ }
+
+ oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, oSheet);
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ // do not execute com::sun::star::sheets::XCellSeries::fillAuto()
+ tEnv.addObjRelation("XCELLSERIES_FILLAUTO", new Boolean(false));
+
+ // set the adress ranges of the cells (see values set above): for e.g. XSheetOutline test
+ tEnv.addObjRelation("CellRangeAddress",
+ new CellRangeAddress((short)0, 6, 6, 8, 8));
+ tEnv.addObjRelation("CellRangeSubAddress",
+ new CellRangeAddress((short)0, 6, 6, 7, 8));
+ // pick a cell with a formula for XSheetAuditing, a dependent cell and a precedent cell
+ tEnv.addObjRelation("XSheetAuditing.CellAddress", new CellAddress((short)0, 8, 6));
+ tEnv.addObjRelation("XSheetAuditing.PrecedentCellAddress", new CellAddress((short)0, 7, 6));
+ tEnv.addObjRelation("XSheetAuditing.DependentCellAddress", new CellAddress((short)0, 9, 6));
+
+ // add an existing sheet for linking
+ tEnv.addObjRelation("XSheetLinkable.LinkSheet", "ScSheetLinksObj.sdc");
+
+ //adding Scenario and with that a ScenarioSheet-Relation for Scenario and XScenarioEnhanced
+ XScenariosSupplier scene = (XScenariosSupplier) UnoRuntime.queryInterface(
+ XScenariosSupplier.class,
+ tEnv.getTestObject());
+ scene.getScenarios()
+ .addNewByName("Scenario",
+ new CellRangeAddress[] {
+ new CellRangeAddress((short) 0, 0, 0, 10, 10)
+ }, "Comment");
+
+ XSpreadsheet sSheet = null;
+
+ try {
+ sSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+ XSpreadsheet.class,
+ xSpreadsheets.getByName("Scenario"));
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Couldn't get Scenario");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get Scenario");
+ }
+
+ tEnv.addObjRelation("ScenarioSheet", sSheet);
+
+ log.println("adding ObjRelation 'noArray' to avoid the test" +
+ " 'XArrayFormulaRange'");
+ tEnv.addObjRelation("noArray", "ScTableSheetObj");
+
+ XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet", PropSet);
+ tEnv.addObjRelation("SHEET", oSheet);
+
+ // add expected results for the XCellRangesQuery interface test
+ String[] expectedResults = new String[7];
+ expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.B5;Sheet1.C1";
+ expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "Sheet1.B5;Sheet1.C1;Sheet1.F6";
+ expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "Sheet1.A1 ... Sheet1.B1 ... Sheet1.B6 ... Sheet1.C2 ... Sheet1.D1 ... Sheet1.F1 ... Sheet1.F7 ... Sheet1.G1";
+ expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "Sheet1.I7:J7;Sheet1.I9";
+ expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "Sheet1.D4";
+ expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.A5;Sheet1.C1";
+ expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.A2";
+ tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS",
+ expectedResults);
+
+ // for XFormulaQuery interface test
+ try {
+ tEnv.addObjRelation("MAKEENTRYINCELL",
+ oSheet.getCellByPosition(15, 15));
+ tEnv.addObjRelation("RANGEINDICES", new int[] { 0, 0 });
+ tEnv.addObjRelation("EXPECTEDDEPENDENTVALUES",
+ new int[] { 0, 255, 0, 65535 });
+ tEnv.addObjRelation("EXPECTEDPRECEDENTVALUES",
+ new int[] { 0, 255, 0, 65535 });
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println(
+ "Cannot add the necessary object relation for XFormulaQuery test.");
+ }
+
+ // XSearchable interface test
+ try {
+ tEnv.addObjRelation("XSearchable.MAKEENTRYINCELL",
+ new XCell[] {
+ oSheet.getCellByPosition(15, 15),
+ oSheet.getCellByPosition(15, 16)
+ });
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((PrintWriter) log);
+ log.println(
+ "Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'.");
+ }
+
+ //Adding relation for util.XSortable
+ final PrintWriter finalLog = log;
+ final XCellRange oTable = oSheet;
+ tEnv.addObjRelation("SORTCHECKER",
+ new ifc.util._XSortable.XSortChecker() {
+ PrintWriter out = finalLog;
+
+ public void setPrintWriter(PrintWriter log) {
+ out = log;
+ }
+
+ public void prepareToSort() {
+ try {
+ oTable.getCellByPosition(0, 0).setValue(4);
+ oTable.getCellByPosition(0, 1).setFormula("b");
+ oTable.getCellByPosition(0, 2).setValue(3);
+ oTable.getCellByPosition(0, 3).setValue(23);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending) {
+ out.println("Sort checking...");
+
+ boolean res = false;
+ String[] value = new String[4];
+
+ for (int i = 0; i < 4; i++) {
+ try {
+ XCell cell = oTable.getCellByPosition(0, i);
+ value[i] = cell.getFormula();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ out.println("Exception while checking sort");
+ }
+ }
+
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ out.println("Sorting ascending");
+
+ String[] rightVal = { "3", "4", "23", "b" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ String[] vals = { value[0], value[1], value[2], value[3] };
+ res = ValueComparer.equalValue(vals, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ } else {
+ if (isSortAscending) {
+ String[] rightVal = { "3", "4", "23", "b" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected 3, 4, 23, b");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ } else {
+ String[] rightVal = { "b", "23", "4", "3" };
+ res = ValueComparer.equalValue(value, rightVal);
+ out.println("Expected b, 23, 4, 3");
+ out.println("getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] + ", " +
+ value[3]);
+ }
+ }
+
+ if (res) {
+ out.println("Sorted correctly");
+ } else {
+ out.println("Sorted uncorrectly");
+ }
+
+ return res;
+ }
+ });
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java
new file mode 100644
index 000000000000..4559c6fc0765
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+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.Spreadsheets</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::XSpreadsheets</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* </ul>
+* @see com.sun.star.sheet.Spreadsheets
+* @see com.sun.star.sheet.XSpreadsheets
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.container.XNameContainer
+* @see ifc.sheet._XSpreadsheets
+* @see ifc.container._XNameAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XNameReplace
+* @see ifc.container._XNameContainer
+*/
+public class ScTableSheetsObj extends TestCase {
+ private static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println("disposing xSpreadsheetDocument");
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the spreadsheets using the interface
+ * <code>XSpreadsheetDocument</code>. The retrieved collection is the
+ * instance of the service <code>com.sun.star.sheet.Spreadsheets</code>.
+ * Creates instances of the service <code>com.sun.star.sheet.Spreadsheet</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SecondInstance'</code> for
+ * {@link ifc.container._XNameContainer} (the created instance of the
+ * service <code>com.sun.star.sheet.Spreadsheet</code>) </li>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XNameContainer} (the created instances of the
+ * service <code>com.sun.star.sheet.Spreadsheet</code>) </li>
+ * </ul>
+ * @see com.sun.star.sheet.Spreadsheets
+ * @see com.sun.star.sheet.XSpreadsheetDocument
+ * @see com.sun.star.sheet.Spreadsheet
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ XInterface oObj = (XInterface)
+ UnoRuntime.queryInterface(XInterface.class, xSpreadsheets);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("creating instance of the sheet object to use it in tests");
+ XSpreadsheet oSecondSheet = null;
+
+ try {
+ oSecondSheet = SOF.createSpreadsheet(xSpreadsheetDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instances", e);
+ }
+
+ //adding Instance for XNameContainer
+ tEnv.addObjRelation("SecondInstance",oSecondSheet);
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+
+ int THRCNT = 1;
+ if ((String)Param.get("THRCNT") != null) {
+ THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
+ }
+ try {
+ for (int n = 1; n < (THRCNT+1) ;n++ ) {
+ log.println(
+ "adding INSTANCE" + n +" as mod relation to environment" );
+ tEnv.addObjRelation(
+ "INSTANCE" + n,
+ SOF.createSpreadsheet(xSpreadsheetDoc) );
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Couldn't create instances for object relations", e);
+ }
+
+ return tEnv;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java
new file mode 100644
index 000000000000..63b78fc806af
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+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.TableValidation</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::sheet::TableValidation</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::sheet::XSheetCondition</code></li>
+* </ul>
+* @see com.sun.star.sheet.TableValidation
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.sheet.XSheetCondition
+* @see ifc.sheet._TableValidation
+* @see ifc.beans._XPropertySet
+* @see ifc.sheet._XSheetCondition
+*/
+public class ScTableValidationObj extends TestCase {
+ static XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSpreadsheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from the document and takes one of
+ * them. Fills some cell in the spreadsheet. Obtains the property
+ * <code>'Validation'</code> of the spreadsheet. The value of the property
+ * is the instance of the service <code>com.sun.star.sheet.TableValidation</code>.
+ * @see com.sun.star.sheet.TableValidation
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println("getting sheets");
+ XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets();
+
+ log.println("getting a sheet");
+ XSpreadsheet oSheet = null;
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ }
+
+ log.println("filling some cells");
+ try {
+ oSheet.getCellByPosition(5, 5).setValue(15);
+ oSheet.getCellByPosition(1, 4).setValue(10);
+ oSheet.getCellByPosition(2, 0).setValue(-5.15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Exception occurred while filling cells", e);
+ }
+
+ XPropertySet Props = null;
+
+ try {
+ Props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oSheet);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),Props.getPropertyValue("Validation"));
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property 'Validation'", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property 'Validation'", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property 'Validation'", e);
+ }
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ScTableValidationObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java
new file mode 100644
index 000000000000..1d6e96564b6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XUniqueCellFormatRangesSupplier;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.awt.Color;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+public class ScUniqueCellFormatsEnumeration extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+ static XSpreadsheet oSheet = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ //add this lines after synchronisation
+ //log.println(" disposing xSheetDoc ");
+ //DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("Getting the first sheet");
+
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSheetDoc.getSheets());
+
+ try {
+ oSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+ XSpreadsheet.class, xIA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ changeColor("A1:A5", 0, 255, 0);
+ changeColor("A6:B10", 255, 0, 0);
+ changeColor("B1:B6", 0, 0, 255);
+ changeColor("B7", 0, 255, 0);
+ changeColor("B8:B10", 0, 0, 255);
+ changeColor("C1:C10", 0, 0, 255);
+ changeColor("D1:D10", 0, 255, 0);
+
+ XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface(
+ XUniqueCellFormatRangesSupplier.class,
+ oSheet);
+
+ XEnumerationAccess xEnum = (XEnumerationAccess) UnoRuntime.queryInterface(
+ XEnumerationAccess.class,
+ xUCRS.getUniqueCellFormatRanges());
+ XInterface oObj = xEnum.createEnumeration();
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("ExpectedCount", new Integer(4));
+
+ return tEnv;
+ }
+
+ protected void changeColor(String RangeName, int r, int g, int b) {
+ XCellRange xRange = oSheet.getCellRangeByName(RangeName);
+ XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, xRange);
+ Color c = new Color(r, g, b);
+ int c2int = 16777216 + c.hashCode();
+
+ try {
+ xPropertySet.setPropertyValue("CellBackColor", new Integer(c2int));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change CellFormat");
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java
new file mode 100644
index 000000000000..049f3f672ef2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XUniqueCellFormatRangesSupplier;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.awt.Color;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+public class ScUniqueCellFormatsObj extends TestCase {
+ static XSpreadsheetDocument xSheetDoc = null;
+ static XSpreadsheet oSheet = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ //add this lines after synchronisation
+ //log.println(" disposing xSheetDoc ");
+ //DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("Getting the first sheet");
+
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSheetDoc.getSheets());
+
+ try {
+ oSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+ XSpreadsheet.class, xIA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get a spreadsheet", e);
+ }
+
+ changeColor("A1:A5", 0, 255, 0);
+ changeColor("A6:B10", 255, 0, 0);
+ changeColor("B1:B6", 0, 0, 255);
+ changeColor("B7", 0, 255, 0);
+ changeColor("B8:B10", 0, 0, 255);
+ changeColor("C1:C10", 0, 0, 255);
+ changeColor("D1:D10", 0, 255, 0);
+
+ XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface(
+ XUniqueCellFormatRangesSupplier.class,
+ oSheet);
+
+ XInterface oObj = xUCRS.getUniqueCellFormatRanges();
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+ protected void changeColor(String RangeName, int r, int g, int b) {
+ XCellRange xRange = oSheet.getCellRangeByName(RangeName);
+ XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, xRange);
+ Color c = new Color(r, g, b);
+ int c2int = 16777216 + c.hashCode();
+
+ try {
+ xPropertySet.setPropertyValue("CellBackColor", new Integer(c2int));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change CellFormat");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change CellFormat");
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java
new file mode 100644
index 000000000000..88e2a0fd87d2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.NoSuchElementException;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XForm;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XViewPane;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import util.FormTools;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.sheet.SpreadsheetViewPane</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::sheet::XViewPane</code></li>
+ * <li> <code>com::sun::star::sheet::XCellRangeReferrer</code></li>
+ * </ul>
+ * @see com.sun.star.sheet.SpreadsheetViewPane
+ * @see com.sun.star.sheet.XViewPane
+ * @see com.sun.star.sheet.XCellRangeReferrer
+ * @see ifc.sheet._XViewPane
+ * @see ifc.sheet._XCellRangeReferrer
+ */
+public class ScViewPaneObj extends TestCase {
+ static private XSpreadsheetDocument xSpreadsheetDoc;
+ static private SOfficeFactory SOF;
+ static private XInterface oObj;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println("disposing xSpreadsheetDocument");
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ util.DesktopTools.closeDoc(oComp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retieves the current controller of the spreadsheet document using the
+ * interface <code>XModel</code>. The controller contains the collection
+ * of the view panes so retrieves the view pane with index 0 from
+ * the collection. The retrived view pane is the instance of the service
+ * <code>com.sun.star.sheet.SpreadsheetViewPane</code>. Retrieves the address
+ * of the cell range that consists of the cells which are visible in the pane.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DATAAREA'</code> for
+ * {@link ifc.sheet._XViewPane}(the retrieved address)</li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XDrawPage oDrawPage;
+
+ XModel xm = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+ XController xc = xm.getCurrentController();
+ XIndexAccess xIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xc);
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xIA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //Relation for XControlAccess
+ tEnv.addObjRelation("DOCUMENT", UnoRuntime.queryInterface(XComponent.class,xSpreadsheetDoc));
+ tEnv.addObjRelation("XControlAccess.isSheet", Boolean.TRUE);
+
+ XViewPane VP = (XViewPane)
+ UnoRuntime.queryInterface(XViewPane.class, oObj);
+ CellRangeAddress dataArea = VP.getVisibleRange();
+ tEnv.addObjRelation("DATAAREA", dataArea);
+
+ // XForm for com.sun.star.view.XFormLayerAccess
+ log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm");
+
+ XForm myForm = null;
+ String kindOfControl="CommandButton";
+ XShape aShape = null;
+ try{
+ log.println("adding contol shape '" + kindOfControl + "'");
+ XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ;
+
+ aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl);
+
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create following control shape : '" +
+ kindOfControl + "': ", e);
+ }
+
+ try {
+ log.println( "getting Drawpages" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc);
+ XDrawPages oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDP.getByIndex(0));
+ if (oDrawPage == null)
+ log.println("ERROR: could not get DrawPage: null");
+
+ oDrawPage.add(aShape);
+ log.println("getting XForm");
+ XNameContainer xForm = FormTools.getForms(oDrawPage);
+ try {
+ myForm = (XForm) AnyConverter.toObject(new Type(XForm.class),xForm.getByName("Standard"));
+ } catch (WrappedTargetException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ } catch (NoSuchElementException ex) {
+ log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
+ }
+ if (myForm == null)
+ log.println("ERROR: could not get XForm: null");
+ tEnv.addObjRelation("XFormLayerAccess.XForm", myForm);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (WrappedTargetException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ }
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java
new file mode 100644
index 000000000000..4defeb81b290
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLContentExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLContentExporter extends TestCase {
+
+ static XComponent xSheetDoc;
+ static ContentFilterChecker Filter;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a calc document" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLContentExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The calc document is set as a source document for exporter
+ * created. A cell in the sheet is set to some value. This made
+ * for checking if this value is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String CELL_TEXT = "XMLContentExporter";
+
+ ContentFilterChecker Filter = new ContentFilterChecker(log);
+
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Calc.XMLContentExporter",
+ new Object[] {arg} );
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xSheetDoc);
+
+ // Setting some string to a cell
+ XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+ XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();
+ XIndexAccess xSheetsIndexArray = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0));
+ XCell xCell = xSheet.getCellByPosition(0, 0);
+ xCell.setFormula(CELL_TEXT);
+
+ log.println("fill sheet 1 with contnet...");
+ util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 1, 1, 1, 5, 5);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ } catch (java.lang.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag("office:document-content");
+ Filter.addTagEnclosed("office:body", "office:document-content");
+ Filter.addTagEnclosed("office:script", "office:document-content");
+ Filter.addTagEnclosed("table:table", "office:body");
+ Filter.addTagEnclosed("table:table-column", "table:table");
+ Filter.addTagEnclosed("table:table-row", "table:table");
+ Filter.addTagEnclosed("table:table-cell", "table:table-row");
+ Filter.addTagEnclosed("text:p", "table:table-cell");
+ Filter.addCharactersEnclosed(CELL_TEXT, "text:p");
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"scalc: StarOffice XML (Calc)"}));
+ tEnv.addObjRelation("SourceDocument",xSheetDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter);
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class ContentFilterChecker extends XMLTools.XMLTagsChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public ContentFilterChecker(PrintWriter log) {
+ super(log) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return checkTags();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java
new file mode 100644
index 000000000000..9026c664d90a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.document.XImporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLContentImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLContentImporter extends TestCase {
+ static XSpreadsheetDocument xSheetDoc;
+ static XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc( null );
+ comp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ util.DesktopTools.closeDoc(comp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLContentImporter</code><p>
+ *
+ * The calc document is set as a target document for importer.
+ * Imported XML-data contains only content tags including table
+ * with test table name.
+ * After import table name getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Calc.XMLContentImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ imp.setTargetDocument(comp);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relations
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ final String impValue = "XMLContentImporter_test" ;
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-content",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table",
+ "office:class", "CDATA", "spreadsheet"
+ },
+ {"start", "office:body"},
+ {"start", "table:table",
+ "table:name", "CDATA", impValue},
+ {"end", "table:table"},
+ {"end", "office:body"},
+ {"end", "office:document-content"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ //save to log content before import
+ final PrintWriter fLog = log;
+ final XSpreadsheets xSheets = xSheetDoc.getSheets();
+
+ log.println("Sheets before importing :") ;
+ String[] names = xSheets.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ fLog.println("Sheet names :") ;
+ String[] snames = xSheets.getElementNames() ;
+ for (int i = 0; i < snames.length; i++) {
+ fLog.println(" " + snames[i]) ;
+ }
+ return xSheets.hasByName(impValue) ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLExporter.java b/qadevOOo/tests/java/mod/_sc/XMLExporter.java
new file mode 100644
index 000000000000..1e2454c52bb0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLExporter.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ static XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a calc document" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The calc document is set as a source document for exporter
+ * created. Checking whether tags for table corresponding to some sheet
+ * is exported.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker Filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+ final String SHEET_NAME = "XMLExporter_SheetTestName";
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Calc.XMLExporter", new Object[] {arg} );
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xSheetDoc);
+
+ //set name of sheet
+ XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+ XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();
+ XIndexAccess xSheetsIndexArray = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0));
+ XNamed xSheetNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, xSheet);
+ xSheetNamed.setName(SHEET_NAME);
+
+ log.println("fill sheet with contnet...");
+ util.CalcTools.fillCalcSheetWithContent(xSheet, 3, 3, 50, 50);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ } catch (java.lang.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag( new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:meta"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:settings"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:script"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:styles"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:body"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("table:table"),
+ new XMLTools.Tag("office:body") );
+ Filter.addTag(
+ new XMLTools.Tag("table:table", "table:name", SHEET_NAME) );
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"scalc: StarOffice XML (Calc)"}));
+ tEnv.addObjRelation("SourceDocument",xSheetDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter) ;
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLImporter.java b/qadevOOo/tests/java/mod/_sc/XMLImporter.java
new file mode 100644
index 000000000000..3f6c9d69c51e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLImporter.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.document.XImporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+
+ static XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ XSpreadsheetDocument xSpreadsheetDoc = SOF.createCalcDoc( null );
+ xSheetDoc = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSpreadsheetDoc);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLImporter</code><p>
+ *
+ * The calc document is set as a target document for importer.
+ * Imported tags contain new value for table name.
+ * After import table name getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impValue = "XMLImporter_test" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Calc.XMLImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ imp.setTargetDocument(xSheetDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xSheetDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table",
+ "office:class", "CDATA", "spreadsheet"
+ },
+ {"start", "office:body"},
+ {"start", "table:table",
+ "table:name", "CDATA", impValue},
+ {"end", "table:table"},
+ {"end", "office:body"},
+ {"end", "office:document"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter fLog = log ;
+ XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
+ final XSpreadsheets sheets = xSpreadsheetDoc.getSheets() ;
+ log.println("Sheets before importing :") ;
+ String[] names = sheets.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ fLog.println("Sheet names :") ;
+ String[] snames = sheets.getElementNames() ;
+ for (int i = 0; i < snames.length; i++) {
+ fLog.println(" " + snames[i]) ;
+ }
+
+ return sheets.hasByName(impValue) ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
new file mode 100644
index 000000000000..c6ae9c78bd46
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLMetaExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLMetaExporter extends TestCase {
+
+ static XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a calc document" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLMetaExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The calc document is set as a source document for exporter
+ * created. A meta property 'Title' is set to some value. This made
+ * for checking if this value is successfully exported within
+ * the document meta information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ // Checking tags existance and changed property value
+ filter.addTag(new XMLTools.Tag ("office:document-meta"));
+ filter.addTag(new XMLTools.Tag ("office:meta"));
+ filter.addCharactersEnclosed("TestDocument",
+ new XMLTools.Tag ("dc:title"));
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Calc.XMLMetaExporter", new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xSheetDoc);
+
+ // Obtaining and changing property values
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface (XDocumentInfoSupplier.class,
+ xSheetDoc) ;
+ XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ docInfo.setPropertyValue("Title", "TestDocument");
+
+ log.println("fill sheet 1 with contnet...");
+ util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create environment.", e) ;
+ } catch (java.lang.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"scalc: StarOffice XML (Calc)"}));
+ tEnv.addObjRelation("SourceDocument",xSheetDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
new file mode 100644
index 000000000000..9ddce92e1766
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XImporter;
+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;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLMetaImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLMetaImporter extends TestCase {
+ static XSpreadsheetDocument xSheetDoc;
+ static XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc( null );
+ comp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ util.DesktopTools.closeDoc(comp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLMetaImporter</code><p>
+ *
+ * The calc document is set as a target document for importer.
+ * Imported XML-data contains only meta tags including title tag
+ * with test title name.
+ * After import title name getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impTitle = "XMLMetaImporter" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Calc.XMLMetaImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ imp.setTargetDocument(comp) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-meta" ,
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:meta", "CDATA", "http://openoffice.org/2000/meta",
+ "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"},
+ {"start", "office:meta"} ,
+ {"start", "dc:title"},
+ {"chars", impTitle},
+ {"end", "dc:title"},
+ {"end", "office:meta"},
+ {"end", "office:document-meta"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ;
+ final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String) docInfo.getPropertyValue
+ ("Title") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java
new file mode 100644
index 000000000000..9126221adf69
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLSettingsExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLSettingsExporter extends TestCase {
+
+ static XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a calc document" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLSettingsExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The calc document is set as a source document for exporter
+ * created. Sets settings' property 'ShowGrid' to 'false', then checks
+ * it in the exported xml document.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ SettingsFilterChecker filter = new SettingsFilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), filter);
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Calc.XMLSettingsExporter",
+ new Object[] {arg} );
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xSheetDoc);
+
+ //set some settings
+ XModel xSheetModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+ XController xController = xSheetModel.getCurrentController();
+ XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+ xPropSet.setPropertyValue("ShowGrid", "false");
+
+ util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ } catch (java.lang.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ }
+
+ //Create and prepare filter
+ // adding tags which must be contained in XML output
+ filter.addTag(new XMLTools.Tag("office:document-settings") );
+ filter.addTagEnclosed(
+ new XMLTools.Tag("office:settings"),
+ new XMLTools.Tag("office:document-settings") );
+ filter.addCharactersEnclosed(
+ "false",
+ new XMLTools.Tag("config:config-item", "config:name", "ShowGrid") );
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"scalc: StarOffice XML (Calc)"}));
+ tEnv.addObjRelation("SourceDocument",xSheetDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class SettingsFilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public SettingsFilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java
new file mode 100644
index 000000000000..68b2df5b5f0f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.beans.XPropertySet;
+import com.sun.star.document.XImporter;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+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;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLSettingsImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLSettingsImporter extends TestCase {
+ static XSpreadsheetDocument xSheetDoc;
+ static XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc( null );
+ comp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ util.DesktopTools.closeDoc(comp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLSettingsImporter</code><p>
+ *
+ * The calc document is set as a target document for importer.
+ * Imported XML-data contains only settings tags including tag
+ * with new number of iteration steps.
+ * After import 'IterationCount' proeprty getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ final XPropertySet xPropSet ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Calc.XMLSettingsImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ imp.setTargetDocument(comp) ;
+
+ XModel xSheetModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSheetDoc);
+ XController xController = xSheetModel.getCurrentController();
+ xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-settings",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
+ "xmlns:config", "CDATA", "http://openoffice.org/2001/config"},
+ {"start", "office:settings"},
+ {"start", "config:config-item-set",
+ "config:name", "CDATA", "view-settings"},
+ {"start", "config:config-item-map-indexed",
+ "config:name", "CDATA", "Views"},
+ {"start", "config:config-item-map-entry"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "ShowGrid",
+ "config:type", "CDATA", "boolean"},
+ {"chars", "false"},
+ {"end", "config:config-item"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "ZoomType",
+ "config:type", "CDATA", "short"},
+ {"chars", "0"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "ZoomValue",
+ "config:type", "CDATA", "int"},
+ {"chars", "124"},
+ {"end", "config:config-item"},
+ {"end", "config:config-item"},
+ {"end", "config:config-item-map-entry"},
+ {"end", "config:config-item-map-indexed"},
+ {"end", "config:config-item-set"},
+ {"end", "office:settings"},
+ {"end", "office:document-settings"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ Object gVal = xPropSet.getPropertyValue("ShowGrid") ;
+ logF.println("ShowGrid = " + gVal ) ;
+ return "false".equals(gVal) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java
new file mode 100644
index 000000000000..51671d8d279c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLStylesExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLStylesExporter extends TestCase {
+ static XComponent xSheetDoc;
+ protected int counter = 0;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+
+ try {
+ log.println( "creating a calc document" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLStylesExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The calc document is set as a source document for exporter
+ * created. New style 'NewStyle' added to style family "Cell Styles".
+ * This made for checking if this style is successfully exported within
+ * the document styles information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ String newName = "NewStyle" + counter++;
+ // Adding tags for checking existance of head tag and property value
+ filter.addTag(new XMLTools.Tag("office:document-styles"));
+ filter.addTag(new XMLTools.Tag("style:style","style:name", newName));
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Calc.XMLStylesExporter", new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xSheetDoc);
+
+ // Obtaining and changing property values
+ XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class, xSheetDoc);
+ XNameAccess StyleFamilies = styleSup.getStyleFamilies();
+ String[] styleFamiliesNames = StyleFamilies.getElementNames();
+ XNameContainer StyleFamilyName = (XNameContainer)
+ AnyConverter.toObject(new Type(XNameContainer.class),
+ StyleFamilies.getByName(styleFamiliesNames[0]));
+ Object SC = SOF.createInstance(
+ xSheetDoc, "com.sun.star.style.CellStyle");
+ XStyle StyleCell = (XStyle)
+ UnoRuntime.queryInterface(XStyle.class,SC);
+ StyleFamilyName.insertByName(newName, StyleCell);
+
+ log.println("fill sheet 1 with contnet...");
+ util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 1, 3, 3, 50, 100);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ } catch (java.lang.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create environment.", e);
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"scalc: StarOffice XML (Calc)"}));
+ tEnv.addObjRelation("SourceDocument",xSheetDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java
new file mode 100644
index 000000000000..a9bec3a769fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+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.container.XNameAccess;
+import com.sun.star.document.XImporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLStylesImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLStylesImporter extends TestCase {
+ static XSpreadsheetDocument xSheetDoc;
+ static XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc( null );
+ comp = (XComponent) UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc) ;
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ util.DesktopTools.closeDoc(comp);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLStylesImporter</code><p>
+ *
+ * The calc document is set as a target document for importer.
+ * Imported XML-data contains only style tags including tag
+ * with new style name.
+ * After import style names getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Calc.XMLStylesImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ imp.setTargetDocument(comp) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ final String impStyleName = "XMLStylesImporter" ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-styles",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:style", "CDATA", "http://openoffice.org/2000/style",
+ "xmlns:fo", "CDATA", "http://www.w3.org/1999/XSL/Format",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table"},
+ {"start", "office:styles"},
+ {"start", "style:style",
+ "style:name", "CDATA", impStyleName,
+ "style:family", "CDATA", "table-cell",
+ "style:parent-style-name", "CDATA", "Default"},
+ { "start", "style:properties",
+ "fo:width", "CDATA", "12cm",
+ "fo:background-color", "CDATA", "light-grey"},
+ {"end", "style:properties"},
+ {"end", "style:style"},
+ {"end", "office:styles"},
+ {"end", "office:document-styles"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ XNameAccess styles = null ;
+ try {
+ XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface
+ (XStyleFamiliesSupplier.class, xSheetDoc);
+ XNameAccess oStyleFamilies = sup.getStyleFamilies();
+ Object family = oStyleFamilies.getByName("CellStyles") ;
+ styles = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, family) ;
+ log.println("Styles before:") ;
+ String[] names = styles.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ }
+ final XNameAccess stylesF = styles ;
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ logF.println("Styles after:") ;
+ String[] names = stylesF.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ logF.println(" " + names[i]) ;
+ }
+ return stylesF.hasByName(impStyleName) ;
+ }
+ }) ;
+
+ return tEnv ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sc/package.html b/qadevOOo/tests/java/mod/_sc/package.html
new file mode 100644
index 000000000000..0e25718b7507
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'sc'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccArea.java b/qadevOOo/tests/java/mod/_sch/AccArea.java
new file mode 100644
index 000000000000..3c2a0553b53b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccArea.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccArea extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccArea");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccAxis.java b/qadevOOo/tests/java/mod/_sch/AccAxis.java
new file mode 100644
index 000000000000..f566c2178d7d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccAxis.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccAxis extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccAxis");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccDataPoint.java b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java
new file mode 100644
index 000000000000..2be986c8dd6e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccDataPoint extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccDataPoint");
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccDataSeries.java b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java
new file mode 100644
index 000000000000..7d0869150f63
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccDataSeries extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccDataSeries");
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccDiagram.java b/qadevOOo/tests/java/mod/_sch/AccDiagram.java
new file mode 100644
index 000000000000..cafb821be171
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDiagram.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccDiagram extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccDiagram");
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccFloor.java b/qadevOOo/tests/java/mod/_sch/AccFloor.java
new file mode 100644
index 000000000000..d41d88a73509
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccFloor.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccFloor extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ log.println("Change Diagram to 3D");
+ XPropertySet ChartProps = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() );
+ try {
+ ChartProps.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccFloor");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccGrid.java b/qadevOOo/tests/java/mod/_sch/AccGrid.java
new file mode 100644
index 000000000000..0cf1cbb2ed49
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccGrid.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccGrid extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccGrid");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccLegend.java b/qadevOOo/tests/java/mod/_sch/AccLegend.java
new file mode 100644
index 000000000000..f04b8f8916bb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccLegend.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccLegend extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccLegend");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java
new file mode 100644
index 000000000000..89f5adf86b99
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccLegendEntry extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccLegendEntry");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java
new file mode 100644
index 000000000000..79c820d74ebe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccStatisticsObject extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ log.println("Display MeanValue");
+ XPropertySet diagProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xChartDoc.getDiagram());
+ diagProps.setPropertyValue("MeanValue",new Boolean(true));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccStatisticsObject");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccTitle.java b/qadevOOo/tests/java/mod/_sch/AccTitle.java
new file mode 100644
index 000000000000..17ad8808d6e8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccTitle.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccTitle extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccTitle");
+
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccWall.java b/qadevOOo/tests/java/mod/_sch/AccWall.java
new file mode 100644
index 000000000000..96b2aed3ca50
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccWall.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccWall extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) cleanup(Param, log);
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ log.println("Change Diagram to 3D");
+ XPropertySet ChartProps = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() );
+ try {
+ ChartProps.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change Diagram to 3D");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change Diagram to 3D", e);
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext cont = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.SHAPE, "", "AccWall");
+
+ oObj = cont;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ log.println("AccessibleName " + cont.getAccessibleName());
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acc = (XAccessibleComponent)
+ UnoRuntime.queryInterface(
+ XAccessibleComponent.class,oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acc.grabFocus();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
new file mode 100644
index 000000000000..d52e5a37ff2e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XWindow;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleDocumentView extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xChartDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ if (oObj == null) {
+ log.println("DocumentView hasn't the role 'Document'");
+ log.println("trying the role 'Shape'");
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+ oObj = AccessibilityTools.SearchedContext;
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XWindow xDocWin = xWindow;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle rect = xDocWin.getPosSize();
+ xDocWin.setPosSize(100,100,100,100,PosSize.POSSIZE);
+ xDocWin.setPosSize(rect.X,rect.Y,rect.Width,rect.Height,
+ PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a chart document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java
new file mode 100644
index 000000000000..786456d27381
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XAxisYSupplier;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartAxis</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::chart::ChartAxis</code></li>
+* </ul>
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.chart.ChartAxis
+* @see ifc.drawing._LineProperties
+* @see ifc.style._CharacterProperties
+* @see ifc.beans._XPropertySet
+* @see ifc.chart._ChartAxis
+*/
+public class ChXChartAxis extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the diagram of the chart document. Then obtains the properties
+ * of the y-axis of the diagram using the interface
+ * <code>XAxisYSupplier</code>. The obatined property is the instance
+ * of the service <code>com.sun.star.chart.ChartAxis</code>.
+ * @see com.sun.star.chart.XAxisYSupplier
+ * @see com.sun.star.chart.ChartAxis
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XPropertySet oObj = null;
+ XShape oDiagram = null;
+
+ // create testobject here
+ // get the Diagram
+ log.println( "getting Diagram" );
+ oDiagram = (XDiagram) xChartDoc.getDiagram();
+
+ // get the Axis
+ log.println( "getting ChartAxis" );
+ XAxisYSupplier oAxisSup = (XAxisYSupplier)
+ UnoRuntime.queryInterface(XAxisYSupplier.class,oDiagram);
+ oObj = (XPropertySet) oAxisSup.getYAxis();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+
+} // finish class ChXChartAxis
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartData.java b/qadevOOo/tests/java/mod/_sch/ChXChartData.java
new file mode 100644
index 000000000000..861cd2b807c6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartData.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartData</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::chart::XChartData</code></li>
+* </ul>
+* @see com.sun.star.chart.ChartData
+* @see com.sun.star.chart.XChartData
+* @see ifc.chart._XChartData
+*/
+public class ChXChartData extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the data source of the chart. This data source is the instance
+ * of the service <code>com.sun.star.chart.ChartData</code>.
+ * @see com.sun.star.chart.ChartData
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ // get the Data
+ log.println( "getting Data" );
+ XChartData oObj = (XChartData) xChartDoc.getData();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ChXChartData
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java
new file mode 100644
index 000000000000..b9db27d44582
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartDataArray</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::chart::XChartData</code></li>
+* <li> <code>com::sun::star::chart::XChartDataArray</code></li>
+* </ul>
+* @see com.sun.star.chart.ChartDataArray
+* @see com.sun.star.chart.XChartData
+* @see com.sun.star.chart.XChartDataArray
+* @see ifc.chart._XChartData
+* @see ifc.chart._XChartDataArray
+*/
+public class ChXChartDataArray extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the data source of the chart. This data source is the instance
+ * of the service <code>com.sun.star.chart.ChartDataArray</code>.
+ * <code>com.sun.star.chart.ChartDataArray</code>.
+ * @see com.sun.star.chart.ChartDataArray
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ // get the Data
+ log.println( "getting Data" );
+ XChartData oObj = (XChartData) xChartDoc.getData();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ChXChartDataArray
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java
new file mode 100644
index 000000000000..423a9f473457
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sch;
+
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.frame.XController;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XSelectionSupplier;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartDocument</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::frame::XModel</code></li>
+* <li> <code>com::sun::star::chart::XChartDocument</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::chart::ChartTableAddressSupplier</code></li>
+* <li> <code>com::sun::star::chart::ChartDocument</code></li>
+* </ul>
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.frame.XModel
+* @see com.sun.star.chart.XChartDocument
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.chart.ChartTableAddressSupplier
+* @see com.sun.star.chart.ChartDocument
+* @see ifc.lang._XComponent
+* @see ifc.frame._XModel
+* @see ifc.chart._XChartDocument
+* @see ifc.beans._XPropertySet
+* @see ifc.chart._ChartTableAddressSupplier
+* @see ifc.chart._ChartDocument
+*/
+public class ChXChartDocument extends TestCase {
+ XChartDocument xChartDoc = null;
+ XChartDocument doc2 = null;
+
+ /**
+ * Disposes Chart documents.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ if( doc2!=null ) {
+ log.println( " closing xChartDoc2" );
+ util.DesktopTools.closeDoc(doc2);
+ doc2 = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two chart documents and retrieves current controllers from them
+ * using the interface <code>XChartDocument</code>. The created documents
+ * is the instances of the service <code>com.sun.star.chart.ChartDocument</code>.
+ * Obtains the data source of the second created chart and creates
+ * a pie diagram.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SELSUPP'</code> for
+ * {@link ifc.frame._XModel}(the controller of the first created chart
+ * document)</li>
+ * <li> <code>'TOSELECT'</code> for
+ * {@link ifc.frame._XModel}(the shape of the main title of
+ * the first created chart document)</li>
+ * <li> <code>'CONT2'</code> for
+ * {@link ifc.frame._XModel}(the second created chart document)</li>
+ * <li> <code>'DIAGRAM'</code> for
+ * {@link ifc.chart._XChartDocument}(the created pie diagram)</li>
+ * <li> <code>'CHARTDATA'</code> for
+ * {@link ifc.chart._XChartDocument}(the data source of the second
+ * created chart)</li>
+ * </ul>
+ * @see com.sun.star.chart.XChartData
+ * @see com.sun.star.chart.ChartDocument
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a chartdocument");
+ xChartDoc = SOF.createChartDoc(null);
+ log.println("Waiting before opening second document");
+ doc2 = SOF.createChartDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+
+ // get the chartdocument
+ log.println("getting ChartDocument");
+
+ XInterface oObj = (XChartDocument) xChartDoc;
+
+ XController cont1 = xChartDoc.getCurrentController();
+ XController cont2 = doc2.getCurrentController();
+
+ cont1.getFrame().setName("cont1");
+ cont2.getFrame().setName("cont2");
+
+ XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, cont1);
+
+ log.println("creating a new environment for chartdocument object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Adding SelectionSupplier and Shape to select for XModel");
+ tEnv.addObjRelation("SELSUPP", sel);
+ tEnv.addObjRelation("TOSELECT", xChartDoc.getTitle());
+
+ log.println("adding Controller as ObjRelation for XModel");
+ tEnv.addObjRelation("CONT2", cont2);
+
+ log.println("adding another Diagram as mod relation to environment");
+ tEnv.addObjRelation("DIAGRAM",
+ SOF.createDiagram(xChartDoc, "PieDiagram"));
+
+ log.println("adding another ChartData as mod relation to environment");
+
+ XChartData ChartData = doc2.getData();
+ tEnv.addObjRelation("CHARTDATA", ChartData);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class ChXChartDocument
diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartView.java b/qadevOOo/tests/java/mod/_sch/ChXChartView.java
new file mode 100644
index 000000000000..9a8ada525fa3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartView.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShapeDescriptor;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.view.OfficeDocumentView</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::view::XViewSettingsSupplier</code></li>
+* <li> <code>com::sun::star::view::XControlAccess</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* </ul>
+* @see com.sun.star.view.OfficeDocumentView
+* @see com.sun.star.view.XViewSettingsSupplier
+* @see com.sun.star.view.XControlAccess
+* @see com.sun.star.view.XSelectionSupplier
+* @see ifc.view._XViewSettingsSupplier
+* @see ifc.view._XControlAccess
+* @see ifc.view._XSelectionSupplier
+*/
+public class ChXChartView extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the current controller of the chart document using
+ * the interface <code>XModel</code>.The retrieved controller is the instance
+ * of the service <code>com.sun.star.view.OfficeDocumentView</code>.
+ * Obtains the main title and the legend of the chart document.
+ * Object relations created :
+ * <ul>
+ *
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XController oObj = null;
+ XModel oModel = null;
+
+ // get the ChartView
+ log.println( "getting ChartView" );
+ oModel = (XModel)UnoRuntime.queryInterface(XModel.class, xChartDoc);
+ oObj = (XController)oModel.getCurrentController();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("Selections", new Object[]
+ {xChartDoc.getArea(), xChartDoc.getDiagram(), xChartDoc.getTitle(),
+ xChartDoc.getLegend()} );
+
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XShapeDescriptor descr1 = (XShapeDescriptor)
+ UnoRuntime.queryInterface(XShapeDescriptor.class, o1);
+ XShapeDescriptor descr2 = (XShapeDescriptor)
+ UnoRuntime.queryInterface(XShapeDescriptor.class, o2);
+ if (descr1 == null || descr2 == null) {
+ return -1;
+ }
+ if (descr1.getShapeType().equals(descr2.getShapeType())) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ }
+ } );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class ChXChartView
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java
new file mode 100644
index 000000000000..078571d5df9c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartDataPointProperties</code>. <p>
+* Object implements the following interfaces
+* <ul>
+* <li> <code>com::sun::star::chart::ChartDataPointProperties</code></li>
+* <li> <code>com::sun::star::drawing::FillProperties</code></li>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::chart::Chart3DBarProperties</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TransparencyChart.sxs </b> : to load predefined chart
+* document where two 'automatic' transparency styles exists :
+* 'Transparency 1' and 'Transparency 2'.</li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartDataPointProperties
+* @see com.sun.star.drawing.FillProperties
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.chart.Chart3DBarProperties
+* @see ifc.chart._ChartDataPointProperties
+* @see ifc.drawing._FillProperties
+* @see ifc.drawing._LineProperties
+* @see ifc.style._CharacterProperties
+* @see ifc.beans._XPropertySet
+* @see ifc.chart._Chart3DBarProperties
+*/
+public class ChXDataPoint extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ XComponent xComp = SOF.loadDocument(
+ utils.getFullTestURL("TransparencyChart.sxs"));
+ xChartDoc = (XChartDocument)
+ UnoRuntime.queryInterface(XChartDocument.class,xComp);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the diagram of the chart document. Obtains the properties of
+ * the specified data point. The obtained properties is the instance of
+ * the service <code>com.sun.star.chart.ChartDataPointProperties</code>.
+ * Creates a XY-diagram and bar-diagram also.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'LINE'</code> for
+ * {@link ifc.chart._ChartDataPointProperties}(the created XY-diagram)</li>
+ * <li> <code>'CHARTDOC'</code> for
+ * {@link ifc.chart._ChartDataPointProperties},
+ * {@link ifc.chart._Chart3DBarProperties}(the chart document)</li>
+ * <li> <code>'BAR'</code> for
+ * {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XPropertySet oObj = null;
+ XDiagram oDiagram = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ // get the DataRowPoint_Point
+ try {
+ log.println( "getting ChXDataRowPoint_Point" );
+ oDiagram = (XDiagram) xChartDoc.getDiagram();
+ oObj = (XPropertySet) oDiagram.getDataPointProperties(1,1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get ChXDataRowPoint_Point", e );
+ }
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ Object line = SOF.createDiagram(xChartDoc,"XYDiagram");
+ tEnv.addObjRelation("LINE",line);
+
+ Object bar = SOF.createDiagram(xChartDoc,"BarDiagram");
+ tEnv.addObjRelation("BAR",bar);
+
+ log.println( "adding ChartDocument as mod relation to environment" );
+ tEnv.addObjRelation("CHARTDOC", xChartDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ChXDataPoint
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java
new file mode 100644
index 000000000000..5bb8d83ac3a8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartDataRowProperties</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::FillProperties</code></li>
+* <li> <code>com::sun::star::chart::ChartStatistics</code></li>
+* <li> <code>com::sun::star::chart::ChartDataRowProperties</code></li>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::chart::ChartDataPointProperties</code></li>
+* <li> <code>com::sun::star::chart::Chart3DBarProperties</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TransparencyChart.sxs </b> : to load predefined chart
+* document where two 'automatic' transparency styles exists :
+* 'Transparency 1' and 'Transparency 2'.</li>
+* </ul> <p>
+* @see com.sun.star.drawing.FillProperties
+* @see com.sun.star.chart.ChartStatistics
+* @see com.sun.star.chart.ChartDataRowProperties
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.chart.ChartDataPointProperties
+* @see com.sun.star.chart.Chart3DBarProperties
+* @see com.sun.star.style.CharacterProperties
+* @see ifc.drawing._FillProperties
+* @see ifc.chart._ChartStatistics
+* @see ifc.chart._ChartDataRowProperties
+* @see ifc.drawing._LineProperties
+* @see ifc.beans._XPropertySet
+* @see ifc.chart._ChartDataPointProperties
+* @see ifc.chart._Chart3DBarProperties
+* @see ifc.style._CharacterProperties
+*/
+public class ChXDataRow extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ XComponent xComp = SOF.loadDocument(
+ utils.getFullTestURL("TransparencyChart.sxs"));
+ xChartDoc = (XChartDocument)
+ UnoRuntime.queryInterface(XChartDocument.class,xComp);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected synchronized void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the diagram of the chart document. Obtains the properties of
+ * the specified data row. The obtained properties is the instance of
+ * the service <code>com.sun.star.chart.ChartDataRowProperties</code>.
+ * Creates a XY-diagram and bar-diagram also.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'LINE'</code> for
+ * {@link ifc.chart._ChartDataPointProperties}(the created XY-diagram)</li>
+ * <li> <code>'CHARTDOC'</code> for
+ * {@link ifc.chart._ChartDataPointProperties},
+ * {@link ifc.chart._Chart3DBarProperties}(the chart document)</li>
+ * <li> <code>'BAR'</code> for
+ * {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XPropertySet oObj = null;
+ XDiagram oDiagram = null;
+ // get the ChXDataRowPoint_Row
+ try {
+ log.println( "getting ChXDataRowPoint_Row" );
+ oDiagram = (XDiagram) xChartDoc.getDiagram();
+ oObj = (XPropertySet) oDiagram.getDataRowProperties(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get ChXDataRowPoint_Row", e );
+ }
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ Object line = SOF.createDiagram(xChartDoc,"XYDiagram");
+ tEnv.addObjRelation("LINE",line);
+
+ Object bar = SOF.createDiagram(xChartDoc,"BarDiagram");
+ tEnv.addObjRelation("BAR",bar);
+
+ log.println( "adding ChartDocument as mod relation to environment" );
+ tEnv.addObjRelation("CHARTDOC", xChartDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class ChXDataRow
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java
new file mode 100644
index 000000000000..901467a89d33
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java
@@ -0,0 +1,413 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.chart.XChartDataArray;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.document.XEmbeddedObjectSupplier;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XTableChart;
+import com.sun.star.table.XTableCharts;
+import com.sun.star.table.XTableChartsSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by the following services:
+* <ul>
+* <li> <code>com.sun.star.chart.Dim3DDiagram</code> </li>
+* <li> <code>com.sun.star.chart.StockDiagram</code> </li>
+* <li> <code>com.sun.star.chart.LineDiagram</code> </li>
+* <li> <code>com.sun.star.chart.BarDiagram</code> </li>
+* <li> <code>com.sun.star.chart.StackableDiagram</code> </li>
+* </ul>
+* <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::chart::XDiagram</code></li>
+* <li> <code>com::sun::star::chart::ChartAxisXSupplier</code></li>
+* <li> <code>com::sun::star::chart::Dim3DDiagram</code></li>
+* <li> <code>com::sun::star::chart::StockDiagram</code></li>
+* <li> <code>com::sun::star::chart::ChartAxisZSupplier</code></li>
+* <li> <code>com::sun::star::chart::XTwoAxisXSupplier</code></li>
+* <li> <code>com::sun::star::chart::LineDiagram</code></li>
+* <li> <code>com::sun::star::chart::BarDiagram</code></li>
+* <li> <code>com::sun::star::chart::XAxisYSupplier</code></li>
+* <li> <code>com::sun::star::chart::Diagram</code></li>
+* <li> <code>com::sun::star::chart::X3DDisplay</code></li>
+* <li> <code>com::sun::star::chart::ChartTwoAxisYSupplier</code></li>
+* <li> <code>com::sun::star::chart::StackableDiagram</code></li>
+* <li> <code>com::sun::star::chart::ChartAxisYSupplier</code></li>
+* <li> <code>com::sun::star::chart::XAxisXSupplier</code></li>
+* <li> <code>com::sun::star::chart::ChartTwoAxisXSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XShape</code></li>
+* <li> <code>com::sun::star::chart::XTwoAxisYSupplier</code></li>
+* <li> <code>com::sun::star::chart::ChartStatistics</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+* <li> <code>com::sun::star::chart::XAxisZSupplier</code></li>
+* <li> <code>com::sun::star::chart::XStatisticDisplay</code></li>
+* </ul>
+* @see com.sun.star.chart.XDiagram
+* @see com.sun.star.chart.ChartAxisXSupplier
+* @see com.sun.star.chart.Dim3DDiagram
+* @see com.sun.star.chart.StockDiagram
+* @see com.sun.star.chart.ChartAxisZSupplier
+* @see com.sun.star.chart.XTwoAxisXSupplier
+* @see com.sun.star.chart.LineDiagram
+* @see com.sun.star.chart.BarDiagram
+* @see com.sun.star.chart.XAxisYSupplier
+* @see com.sun.star.chart.Diagram
+* @see com.sun.star.chart.X3DDisplay
+* @see com.sun.star.chart.ChartTwoAxisYSupplier
+* @see com.sun.star.chart.StackableDiagram
+* @see com.sun.star.chart.ChartAxisYSupplier
+* @see com.sun.star.chart.XAxisXSupplier
+* @see com.sun.star.chart.ChartTwoAxisXSupplier
+* @see com.sun.star.drawing.XShape
+* @see com.sun.star.chart.XTwoAxisYSupplier
+* @see com.sun.star.chart.ChartStatistics
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.drawing.XShapeDescriptor
+* @see com.sun.star.chart.XAxisZSupplier
+* @see com.sun.star.chart.XStatisticDisplay
+* @see ifc.chart._XDiagram
+* @see ifc.chart._ChartAxisXSupplier
+* @see ifc.chart._Dim3DDiagram
+* @see ifc.chart._StockDiagram
+* @see ifc.chart._ChartAxisZSupplier
+* @see ifc.chart._XTwoAxisXSupplier
+* @see ifc.chart._LineDiagram
+* @see ifc.chart._BarDiagram
+* @see ifc.chart._XAxisYSupplier
+* @see ifc.chart._Diagram
+* @see ifc.chart._X3DDisplay
+* @see ifc.chart._ChartTwoAxisYSupplier
+* @see ifc.chart._StackableDiagram
+* @see ifc.chart._ChartAxisYSupplier
+* @see ifc.chart._XAxisXSupplier
+* @see ifc.chart._ChartTwoAxisXSupplier
+* @see ifc.drawing._XShape
+* @see ifc.chart._XTwoAxisYSupplier
+* @see ifc.chart._ChartStatistics
+* @see ifc.beans._XPropertySet
+* @see ifc.drawing._XShapeDescriptor
+* @see ifc.chart._XAxisZSupplier
+* @see ifc.chart._XStatisticDisplay
+*/
+public class ChXDiagram extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a sheetdocument" );
+ xSheetDoc = SOF.createCalcDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Spreadsheet document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " closing xSheetDoc " );
+ util.DesktopTools.closeDoc(xSheetDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves a collection of spreadsheets from a document
+ * and takes one of them. Inserts some values into the cells of the some cell
+ * range address. Adds and retrieves the chart that using the data from
+ * the cells of this cell range address. Obtains the chart document which is
+ * embedded into the retrieved chart using the interface
+ * <code>XEmbeddedObjectSupplier</code>. Retrieves the diagram from
+ * the obtained chart document. The retrieved diagram is the instance of
+ * the service <code>com.sun.star.chart.Diagram</code>.
+ * Obtains the data source of the chart from the chart document.
+ * Creates a stock-diagram, a bar-diagram, a XY-diagram and line-diagram
+ * that are the instances of the following services:
+ * <ul>
+ * <li> <code>com.sun.star.chart.StockDiagram</code> </li>
+ * <li> <code>com.sun.star.chart.BarDiagram</code> </li>
+ * <li> <code>com.sun.star.chart.LineDiagram</code> </li>
+ * <li> <code>com.sun.star.chart.StackableDiagram</code> </li>
+ * </ul>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CHARTDOC'</code> for
+ * {@link ifc.chart._Dim3DDiagram}, {@link ifc.chart._StockDiagram},
+ * {@link ifc.chart._ChartAxisZSupplier}, {@link _LineDiagram},
+ * {@link ifc.chart._BarDiagram}, {@link ifc.chart._Diagram},
+ * {@link ifc.chart._ChartTwoAxisYSupplier},
+ * {@link ifc.chart._StackableDiagram}, {@link ifc.chart._Diagram},
+ * {@link ifc.chart._ChartAxisYSupplier},
+ * {@link ifc.chart._ChartTwoAxisXSupplier},
+ * {@link ifc.chart._ChartStatistics} (the obtained chart document)</li>
+ * <li> <code>'ROWAMOUNT', 'COLAMOUNT'</code> for
+ * {@link ifc.chart._XDiagram}(the number of chart columns and
+ * the number of chart rows) </li>
+ * <li> <code>'STOCK'</code> for
+ * {@link ifc.chart._StockDiagram}(the created stock-diagram) </li>
+ * <li> <code>'BAR'</code> for
+ * {@link ifc.chart._BarDiagram}, {@link ifc.chart._ChartAxisZSupplier},
+ * {@link ifc.chart._ChartTwoAxisXSupplier},
+ * {@link ifc.chart._ChartTwoAxisYSupplier}(the created bar-diagram)</li>
+ * <li> <code>'LINE'</code> for
+ * {@link ifc.chart._LineDiagram}(the created XY-diagram) </li>
+ * <li> <code>'STACK'</code> for
+ * {@link ifc.chart._StackableDiagram}(the created Line-diagram) </li>
+ * </ul>
+ * @see com.sun.star.document.XEmbeddedObjectSupplier
+ * @see com.sun.star.chart.Diagram
+ * @see com.sun.star.chart.StockDiagram
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XSpreadsheet oSheet=null;
+ XChartDocument xChartDoc=null;
+ XDiagram oObj = null;
+
+ System.out.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ try {
+ oSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get sheet", e);
+ }
+
+ log.println("Creating the Header") ;
+
+ insertIntoCell(1,0,"JAN",oSheet,"");
+ insertIntoCell(2,0,"FEB",oSheet,"");
+ insertIntoCell(3,0,"MAR",oSheet,"");
+ insertIntoCell(4,0,"APR",oSheet,"");
+ insertIntoCell(5,0,"MAI",oSheet,"");
+ insertIntoCell(6,0,"JUN",oSheet,"");
+ insertIntoCell(7,0,"JUL",oSheet,"");
+ insertIntoCell(8,0,"AUG",oSheet,"");
+ insertIntoCell(9,0,"SEP",oSheet,"");
+ insertIntoCell(10,0,"OCT",oSheet,"");
+ insertIntoCell(11,0,"NOV",oSheet,"");
+ insertIntoCell(12,0,"DEC",oSheet,"");
+ insertIntoCell(13,0,"SUM",oSheet,"");
+
+ log.println("Fill the lines");
+
+ insertIntoCell(0,1,"Smith",oSheet,"");
+ insertIntoCell(1,1,"42",oSheet,"V");
+ insertIntoCell(2,1,"58.9",oSheet,"V");
+ insertIntoCell(3,1,"-66.5",oSheet,"V");
+ insertIntoCell(4,1,"43.4",oSheet,"V");
+ insertIntoCell(5,1,"44.5",oSheet,"V");
+ insertIntoCell(6,1,"45.3",oSheet,"V");
+ insertIntoCell(7,1,"-67.3",oSheet,"V");
+ insertIntoCell(8,1,"30.5",oSheet,"V");
+ insertIntoCell(9,1,"23.2",oSheet,"V");
+ insertIntoCell(10,1,"-97.3",oSheet,"V");
+ insertIntoCell(11,1,"22.4",oSheet,"V");
+ insertIntoCell(12,1,"23.5",oSheet,"V");
+ insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");
+
+ insertIntoCell(0,2,"Jones",oSheet,"");
+ insertIntoCell(1,2,"21",oSheet,"V");
+ insertIntoCell(2,2,"40.9",oSheet,"V");
+ insertIntoCell(3,2,"-57.5",oSheet,"V");
+ insertIntoCell(4,2,"-23.4",oSheet,"V");
+ insertIntoCell(5,2,"34.5",oSheet,"V");
+ insertIntoCell(6,2,"59.3",oSheet,"V");
+ insertIntoCell(7,2,"27.3",oSheet,"V");
+ insertIntoCell(8,2,"-38.5",oSheet,"V");
+ insertIntoCell(9,2,"43.2",oSheet,"V");
+ insertIntoCell(10,2,"57.3",oSheet,"V");
+ insertIntoCell(11,2,"25.4",oSheet,"V");
+ insertIntoCell(12,2,"28.5",oSheet,"V");
+ insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");
+
+ insertIntoCell(0,3,"Brown",oSheet,"");
+ insertIntoCell(1,3,"31.45",oSheet,"V");
+ insertIntoCell(2,3,"-20.9",oSheet,"V");
+ insertIntoCell(3,3,"-117.5",oSheet,"V");
+ insertIntoCell(4,3,"23.4",oSheet,"V");
+ insertIntoCell(5,3,"-114.5",oSheet,"V");
+ insertIntoCell(6,3,"115.3",oSheet,"V");
+ insertIntoCell(7,3,"-171.3",oSheet,"V");
+ insertIntoCell(8,3,"89.5",oSheet,"V");
+ insertIntoCell(9,3,"41.2",oSheet,"V");
+ insertIntoCell(10,3,"71.3",oSheet,"V");
+ insertIntoCell(11,3,"25.4",oSheet,"V");
+ insertIntoCell(12,3,"38.5",oSheet,"V");
+ insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");
+
+ // insert a chart
+ Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);
+
+ XCellRange oRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, oSheet);
+ XCellRange myRange = oRange.getCellRangeByName("A1:N4");
+ XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
+ CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
+
+ CellRangeAddress[] oAddr = new CellRangeAddress[1];
+ oAddr[0] = myAddr;
+ XTableChartsSupplier oSupp = (XTableChartsSupplier)
+ UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);
+
+ log.println("Insert Chart");
+ XTableCharts oCharts = oSupp.getCharts();
+
+
+ if (!oCharts.hasByName("ChXDiagram")) {
+ oCharts.addNewByName("ChXDiagram", oRect, oAddr, true, true);
+ }
+
+ // get the TableChart
+ XTableChart oChart = null;
+ try {
+ oChart = (XTableChart) AnyConverter.toObject(
+ new Type(XTableChart.class),((XNameAccess)
+ UnoRuntime.queryInterface(
+ XNameAccess.class, oCharts)).getByName("ChXDiagram"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TableChart", e);
+ }
+
+ XEmbeddedObjectSupplier oEOS = (XEmbeddedObjectSupplier)
+ UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, oChart);
+ XInterface oInt = oEOS.getEmbeddedObject();
+ xChartDoc = (XChartDocument)
+ UnoRuntime.queryInterface(XChartDocument.class,oInt);
+ oObj = (XDiagram) xChartDoc.getDiagram();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding ChartDocument as mod relation to environment" );
+ tEnv.addObjRelation("CHARTDOC", xChartDoc);
+
+ XChartDataArray da = (XChartDataArray)
+ UnoRuntime.queryInterface(XChartDataArray.class, xChartDoc.getData());
+ int cols = da.getColumnDescriptions().length;
+ int rows = da.getRowDescriptions().length;
+
+ tEnv.addObjRelation("ROWAMOUNT", new Integer(rows));
+ tEnv.addObjRelation("COLAMOUNT", new Integer(cols));
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ Object stock = SOF.createDiagram(xChartDoc,"StockDiagram");
+ tEnv.addObjRelation("STOCK",stock);
+
+ Object bar = SOF.createDiagram(xChartDoc,"BarDiagram");
+ tEnv.addObjRelation("BAR",bar);
+
+ Object line = SOF.createDiagram(xChartDoc,"XYDiagram");
+ tEnv.addObjRelation("LINE",line);
+
+ Object stack = SOF.createDiagram(xChartDoc,"LineDiagram");
+ tEnv.addObjRelation("STACK",stack);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Inserts a value or a formula in the cell of the spreasheet.
+ * @param CellX is the column index of the cell
+ * @param CellY is the row index of the cell
+ * @param theValue string representation of the value
+ * @param TT1 specify the spreadsheet, the interface
+ * <code>com.sun.star.sheet.XSpreadsheet</code>
+ * @param flag if it's equal to <code>'V'</code> then the method inserts
+ * a double-value in the cell else it inserts a formula in the cell
+ */
+ public static void insertIntoCell(
+ int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) {
+
+ XCell oCell = null;
+
+ try {
+ oCell = TT1.getCellByPosition(CellX, CellY);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ System.out.println("Could not get Cell");
+ }
+ if (flag.equals("V")) {oCell.setValue((new Float(theValue)).floatValue());}
+ else {oCell.setFormula(theValue);}
+
+ } // end of insertIntoCell
+
+
+} // finish class ChXDiagram
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChartArea.java b/qadevOOo/tests/java/mod/_sch/ChartArea.java
new file mode 100644
index 000000000000..017a1be8a4f3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartArea.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartArea</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::FillProperties</code></li>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TransparencyChart.sxs </b> : to load predefined chart
+* document where two 'automatic' transparency styles exists :
+* 'Transparency 1' and 'Transparency 2'.</li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartArea
+* @see com.sun.star.drawing.FillProperties
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.drawing._FillProperties
+* @see ifc.drawing._LineProperties
+* @see ifc.beans._XPropertySet
+*/
+public class ChartArea extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ XComponent xComp = SOF.loadDocument(
+ utils.getFullTestURL("TransparencyChart.sxs"));
+ xChartDoc = (XChartDocument)
+ UnoRuntime.queryInterface(XChartDocument.class,xComp);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieved the instance of the service <code>com.sun.star.chart.ChartArea</code>
+ * using the interface <code>XChartDocument</code>.
+ * @see com.sun.star.chart.XChartDocument
+ * @see com.sun.star.chart.ChartArea
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ // get the Area
+ log.println( "getting Area" );
+ XPropertySet oObj = (XPropertySet) xChartDoc.getArea();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ChartArea
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChartGrid.java b/qadevOOo/tests/java/mod/_sch/ChartGrid.java
new file mode 100644
index 000000000000..f863d134bceb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartGrid.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XAxisXSupplier;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartGrid</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.chart.ChartGrid
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.drawing._LineProperties
+* @see ifc.beans._XPropertySet
+*/
+public class ChartGrid extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the diagram of the chart document. Then obtains
+ * the properties of the main grid of the x-axis of the diagram
+ * using the interface <code>XAxisXSupplier</code>. This properties is
+ * the instance of the service <code>com.sun.star.chart.ChartGrid</code>.
+ * @see com.sun.star.chart.XAxisXSupplier
+ * @see com.sun.star.chart.ChartGrid
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XPropertySet oObj = null;
+ XShape oDiagram = null;
+
+ // get the Diagram
+ log.println( "getting Diagram" );
+ oDiagram = (XDiagram) xChartDoc.getDiagram();
+
+ // get the Grid
+ log.println( "getting ChartGrid" );
+ XAxisXSupplier oAxisSup = (XAxisXSupplier)
+ UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram);
+ oObj = (XPropertySet) oAxisSup.getXMainGrid();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class ChartGrid
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChartLegend.java b/qadevOOo/tests/java/mod/_sch/ChartLegend.java
new file mode 100644
index 000000000000..429e30d325ed
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartLegend.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartLegend</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::FillProperties</code></li>
+* <li> <code>com::sun::star::drawing::XShape</code></li>
+* <li> <code>com::sun::star::drawing::Shape</code></li>
+* <li> <code>com::sun::star::chart::ChartLegend</code></li>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> TransparencyChart.sxs </b> : to load predefined chart
+* document where two 'automatic' transparency styles exists :
+* 'Transparency 1' and 'Transparency 2'.</li>
+* </ul> <p>
+* @see com.sun.star.drawing.FillProperties
+* @see com.sun.star.drawing.XShape
+* @see com.sun.star.drawing.Shape
+* @see com.sun.star.chart.ChartLegend
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.drawing.XShapeDescriptor
+* @see com.sun.star.lang.XComponent
+* @see ifc.drawing._FillProperties
+* @see ifc.drawing._XShape
+* @see ifc.drawing._Shape
+* @see ifc.chart._ChartLegend
+* @see ifc.drawing._LineProperties
+* @see ifc.beans._XPropertySet
+* @see ifc.style._CharacterProperties
+* @see ifc.drawing._XShapeDescriptor
+* @see ifc.lang._XComponent
+*/
+public class ChartLegend extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ XComponent xComp = SOF.loadDocument(
+ utils.getFullTestURL("TransparencyChart.sxs"));
+ xChartDoc = (XChartDocument)
+ UnoRuntime.queryInterface(XChartDocument.class,xComp);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the diagram of the chart document. The retrieved
+ * diagram is the instance of the service
+ * <code>com.sun.star.chart.ChartLegend</code>.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XShape oObj = null;
+
+ // get the Legend
+ log.println( "getting Legend" );
+ oObj = (XShape) xChartDoc.getLegend();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("NoSetSize", "sch.ChartLegend");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class ChartLegend
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChartLine.java b/qadevOOo/tests/java/mod/_sch/ChartLine.java
new file mode 100644
index 000000000000..495bda11c4b7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartLine.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartLine</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::LineProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.drawing.LineProperties
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.drawing._LineProperties
+* @see ifc.beans._XPropertySet
+*/
+public class ChartLine extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates a bar diagram and sets the created diagram for the chart document.
+ * Retrieves the property <code>'DataMeanValueProperties'</code> of
+ * the specified data row. The retrieved property is the instance of
+ * the service <code>com.sun.star.chart.ChartLine</code>.
+ * @see com.sun.star.chart.ChartLine
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XPropertySet oObj = null;
+ XDiagram oDiagram = null;
+ SOfficeFactory SOF = null;
+
+ //get LineDiagram
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ oDiagram = SOF.createDiagram(xChartDoc, "LineDiagram");
+
+ log.println( "getting Line-Diagram" );
+ xChartDoc.setDiagram(oDiagram);
+
+ // get the Line
+ try {
+ log.println( "getting Line" );
+ XPropertySet RowProps = oDiagram.getDataRowProperties(1);
+ RowProps.setPropertyValue("MeanValue", new Boolean( true ));
+ oObj = (XPropertySet) AnyConverter.toObject(
+ new Type(XPropertySet.class),
+ RowProps.getPropertyValue("DataMeanValueProperties"));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get Line", e );
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get Line", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get Line", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get Line", e );
+ }
+ catch(com.sun.star.beans.PropertyVetoException e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get Line", e );
+ }
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class ChartLine
+
diff --git a/qadevOOo/tests/java/mod/_sch/ChartTitle.java b/qadevOOo/tests/java/mod/_sch/ChartTitle.java
new file mode 100644
index 000000000000..004599065969
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartTitle.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.chart.ChartTitle</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::chart::ChartTitle</code></li>
+* <li> <code>com::sun::star::drawing::XShape</code></li>
+* <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+* <li> <code>com::sun::star::style::CharacterProperties</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::drawing::Shape</code></li>
+* </ul>
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.chart.ChartTitle
+* @see com.sun.star.drawing.XShape
+* @see com.sun.star.drawing.XShapeDescriptor
+* @see com.sun.star.style.CharacterProperties
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.drawing.Shape
+* @see ifc.lang._XComponent
+* @see ifc.chart._ChartTitle
+* @see ifc.drawing._XShape
+* @see ifc.drawing._XShapeDescriptor
+* @see ifc.style._CharacterProperties
+* @see ifc.beans._XPropertySet
+* @see ifc.drawing._Shape
+*/
+public class ChartTitle extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * Creates Chart document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Chart document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the shape of the main title of the chart document.
+ * The retrieved shape is the instance of the service
+ * <code>com.sun.star.chart.ChartTitle</code>.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ // get the Title
+ log.println( "getting Title" );
+ XShape oObj = (XShape) xChartDoc.getTitle();
+
+ log.println( "creating a new environment for chartdocument object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("NoSetSize","sch.ChartTitle");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ChXChartObject_Title
+
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
new file mode 100644
index 000000000000..383e8eadcf16
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XDrawView;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleDrawDocumentView extends TestCase {
+
+ XComponent xDrawDoc;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ final XDrawPage fDP2 = oDPn.insertNewByIndex(1);
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oDPn);
+ XDrawPage oDP = null;
+ try {
+ oDP = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ //get a Shape
+ log.println( "inserting a Shape" );
+ XShape oShape = SOF.createShape(xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow (
+ (XMultiServiceFactory)Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //com.sun.star.accessibility.AccessibleRole
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName "+utils.getImplName(oObj));
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XDrawView xView = (XDrawView) UnoRuntime.queryInterface
+ (XDrawView.class, aModel.getCurrentController()) ;
+ final XDrawPage fDP1 = oDP;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xView.setCurrentPage(fDP2);
+ xView.setCurrentPage(fDP1);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing Draw document");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
new file mode 100644
index 000000000000..a5feffd8612a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+public class AccessibleOutlineView extends TestCase {
+
+ XModel aModel = null;
+ XComponent xImpressDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow (
+ (XMultiServiceFactory)Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName "+utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel);
+ final XDrawPages oDPn = oDPS.getDrawPages();
+
+ tEnv.addObjRelation("EventMsg","Inserting a drawpage via API has no "+
+ "effect to the outline view #101050# \r\n"+
+ "Therefore the listener isn't called");
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ oDPn.insertNewByIndex(1);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log ) {
+ log.println("disposing Impress document");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ //Change to Outline view
+ try {
+ String aSlotID = "slot:27010";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, oObj );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+ shortWait();
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
new file mode 100644
index 000000000000..0c78c06c592e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+public class AccessibleSlideView extends TestCase {
+
+ XModel aModel = null;
+ XComponent xImpressDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel);
+ XDrawPages oDPn = oDPS.getDrawPages();
+
+ oDPn.insertNewByIndex(0);
+
+ shortWait();
+
+ XWindow xWindow = at.getCurrentWindow (
+ (XMultiServiceFactory)Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ System.out.println("ImplementationName "+utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //util.dbg.printInterfaces(oObj);
+ log.println("Implementationname: "+util.utils.getImplName(oObj));
+
+ final XDrawPages DrawPages = oDPn;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ DrawPages.insertNewByIndex(2);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log ) {
+ log.println("disposing impress document");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+
+ //Change to Outline view
+ try {
+ String aSlotID = "slot:27011";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class,
+ aModel.getCurrentController() );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+
+ shortWait();
+
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
new file mode 100644
index 000000000000..b8aa29b0c0c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class DrawController_DrawView extends TestCase {
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page. Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating two impress documents" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ shortWait();
+ xSecondDrawDoc = SOF.createDrawDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ XController aController2 = aModel2.getCurrentController();
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class, aController2);
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = ((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = ((XMultiServiceFactory)Param.getMSF()).
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ XShapes xShapes1 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
+ XShapes xShapes2 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
+ xShapes1.add(shape2);
+ xShapes1.add(shape3);
+ xShapes2.add(shape1);
+ shortWait();
+
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, oShapeCol1, oShapeCol2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = aController2.getFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel2);
+
+ tEnv.addObjRelation("SecondController", aController2);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java
new file mode 100644
index 000000000000..486a42d72402
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* The view was switched to <b>HandoutMode</b>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class DrawController_HandoutView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service
+ * <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page.
+ * Switch to the <b>HandoutMode</b>.
+ * Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(xMSF);
+
+ try {
+ log.println( "creating two impress documents" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ xDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ for (int i = 1; i < 10; i++){
+ the_pages.insertNewByIndex(i);
+ }
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ log.println("switch to HandoutView...");
+ try{
+ utils.dispatchURL(xMSF, xDrawDoc, ".uno:HandoutMode");
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(e.toString()));
+ }
+
+ utils.shortWait(500);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ log.println("bring first document to front...");
+ DesktopTools.bringWindowToFront(aModel);
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ XShapes xShapes1 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
+ XShapes xShapes2 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
+ xShapes1.add(shape2);
+ xShapes1.add(shape3);
+ xShapes2.add(shape1);
+ shortWait();
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, oShapeCol1, oShapeCol2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java
new file mode 100644
index 000000000000..4164342158ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java
@@ -0,0 +1,334 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* The view was switched to <b>NotesMode</b>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class DrawController_NotesView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service
+ * <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page.
+ * Switch to the <b>NotesMode</b>.
+ * Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(xMSF);
+
+ try {
+ log.println( "creating two impress documents" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ xDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ log.println("switch to HandoutView...");
+ try{
+ utils.dispatchURL(xMSF, xDrawDoc, ".uno:NotesMode");
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(e.toString()));
+ }
+
+ utils.shortWait(500);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ log.println("bring first document to front...");
+ DesktopTools.bringWindowToFront(aModel);
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ XShapes xShapes1 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
+ XShapes xShapes2 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
+ xShapes1.add(shape2);
+ xShapes1.add(shape3);
+ xShapes2.add(shape1);
+ shortWait();
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, oShapeCol1, oShapeCol2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java
new file mode 100644
index 000000000000..4a39c3049eb5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java
@@ -0,0 +1,334 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* The view was switched to <b>OutlineMode</b>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class DrawController_OutlineView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service
+ * <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page.
+ * Switch to the <b>OutlineMode</b>.
+ * Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(xMSF);
+
+ try {
+ log.println( "creating two impress documents" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ xDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ log.println("switch to HandoutView...");
+ try{
+ utils.dispatchURL(xMSF, xDrawDoc, ".uno:OutlineMode");
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(e.toString()));
+ }
+
+ utils.shortWait(500);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ log.println("bring first document to front...");
+ DesktopTools.bringWindowToFront(aModel);
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ XShapes xShapes1 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
+ XShapes xShapes2 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
+ xShapes1.add(shape2);
+ xShapes1.add(shape3);
+ xShapes2.add(shape1);
+ shortWait();
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, oShapeCol1, oShapeCol2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java
new file mode 100644
index 000000000000..c86d45878656
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java
@@ -0,0 +1,334 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* The view was switched to <b>DiaMode</b>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class DrawController_PresentationView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service
+ * <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page.
+ * Switch to the <b>DiaMode</b>.
+ * Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(xMSF);
+
+ try {
+ log.println( "creating two impress documents" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ xDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ log.println("switch to PresentationView...");
+ try{
+ utils.dispatchURL(xMSF, xDrawDoc, ".uno:DiaMode");
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(e.toString()));
+ }
+
+ utils.shortWait(500);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ log.println("bring first document to front...");
+ DesktopTools.bringWindowToFront(aModel);
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = xMSF.
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed("Couldn't create instance"));
+ }
+
+ XShapes xShapes1 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
+ XShapes xShapes2 = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
+ xShapes1.add(shape2);
+ xShapes1.add(shape3);
+ xShapes2.add(shape1);
+ shortWait();
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, oShapeCol1, oShapeCol2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java
new file mode 100644
index 000000000000..bc24b11b4325
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.document.XLinkTargetSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.document.LinkTargets</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.document.LinkTargets
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class SdDocLinkTargets extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the possible links to childrens of the drawing document using
+ * the interface <code>XLinkTargetSupplier</code>. The retrieved collection
+ * is the instance of the service <code>com.sun.star.document.LinkTargets</code>.
+ * @see com.sun.star.document.XLinkTargetSupplier
+ * @see com.sun.star.document.LinkTargets
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // get the Links here
+ log.println( "getting Links" );
+ XLinkTargetSupplier oLTS = (XLinkTargetSupplier)
+ UnoRuntime.queryInterface(XLinkTargetSupplier.class,xDrawDoc);
+ XInterface oObj = oLTS.getLinks();
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdDocLinkTargets
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPage.java b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java
new file mode 100644
index 000000000000..876615f0b30a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XMasterPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawPage</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+* <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+* <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+* <li> <code>com::sun::star::drawing::XShapes</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XMasterPageTarget</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawPage
+* @see com.sun.star.drawing.GenericDrawPage
+* @see com.sun.star.drawing.XShapeBinder
+* @see com.sun.star.drawing.XShapeGrouper
+* @see com.sun.star.drawing.XShapes
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XMasterPageTarget
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.drawing.XShapeCombiner
+* @see ifc.drawing._GenericDrawPage
+* @see ifc.drawing._XShapeBinder
+* @see ifc.drawing._XShapeGrouper
+* @see ifc.drawing._XShapes
+* @see ifc.lang._XServiceInfo
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XMasterPageTarget
+* @see ifc.container._XNamed
+* @see ifc.drawing._XShapeCombiner
+*/
+public class SdDrawPage extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the draw pages from the drawing document using
+ * the interface <code>XDrawPagesSupplier</code> and take one of them.
+ * The retrieved draw page is the instance of the service
+ * <code>com.sun.star.drawing.DrawPage</code>. Inserts some shapes
+ * into the draw page. Obtains the MasterPages collection. Creates
+ * the rectangle shape.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes}( the created rectangle shape )</li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeBinder}, {@link ifc.drawing._XShapeGrouper},
+ * {@link ifc.drawing._XShapeCombiner}( the retrieved draw page )</li>
+ * <li> <code>'MasterPageSupplier'</code> for
+ * {@link ifc.drawing._XMasterPageTarget}(the obtained master pages
+ * collection)</li>
+ * </ul>
+ * @see com.sun.star.drawing.DrawPage
+ * @see com.sun.star.drawing.XDrawPagesSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ 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" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,oDPn);
+ try {
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get DrawPage", e );
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get DrawPage", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get DrawPage", e );
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes) UnoRuntime.queryInterface
+ (XShapes.class,oObj);
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 2000, 1500, 1000, 1000, "Line"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"));
+
+ //get the XMasterPagesSupplier
+ log.println("get XMasterPagesSupplier");
+ XMasterPagesSupplier oMPS = (XMasterPagesSupplier)
+ UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc);
+ XDrawPages oGroup = oMPS.getMasterPages();
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XControlShape aShape = FormTools.createControlShape(
+ xDrawDoc,3000,4500,15000,10000,"CommandButton");
+
+ oShapes.add((XShape) aShape);
+
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xDrawDoc, sDsc));
+ tEnv.addObjRelation("DrawPage", oObj);
+ tEnv.addObjRelation("MasterPageSupplier",oGroup);
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdDrawPage
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java
new file mode 100644
index 000000000000..690706c4fc57
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawPages</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::XDrawPageExpander</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::drawing::XDrawPageSummarizer</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XDrawPages</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawPages
+* @see com.sun.star.drawing.XDrawPageExpander
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.drawing.XDrawPageSummarizer
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XDrawPages
+* @see ifc.drawing._XDrawPageExpander
+* @see ifc.container._XIndexAccess
+* @see ifc.drawing._XDrawPageSummarizer
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XDrawPages
+*/
+public class SdDrawPagesAccess extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the draw pages from the drawing document using
+ * the interface <code>XDrawPagesSupplier</code>. Inserts two new draw pages.
+ * The retrieved collection is the instance of the service
+ * <code>com.sun.star.drawing.DrawPages</code>.
+ * @see com.sun.star.drawing.DrawPages
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpages" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ XInterface oObj = oDP;
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+
+} // finish class SdDrawPagesAccess
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java b/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java
new file mode 100644
index 000000000000..c1950fb9b789
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.GenericDrawPage</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+* <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+* <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+* <li> <code>com::sun::star::drawing::XShapes</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* </ul>
+* @see com.sun.star.drawing.GenericDrawPage
+* @see com.sun.star.drawing.XShapeBinder
+* @see com.sun.star.drawing.XShapeGrouper
+* @see com.sun.star.drawing.XShapes
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XShapeCombiner
+* @see com.sun.star.container.XNamed
+* @see ifc.drawing._GenericDrawPage
+* @see ifc.drawing._XShapeBinder
+* @see ifc.drawing._XShapeGrouper
+* @see ifc.drawing._XShapes
+* @see ifc.lang._XServiceInfo
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XShapeCombiner
+* @see ifc.container._XNamed
+*/
+public class SdGenericDrawPage extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the draw pages from the drawing document using
+ * the interface <code>XDrawPagesSupplier</code> and take one of them.
+ * The retrieved draw page is the instance of the service
+ * <code>com.sun.star.drawing.DrawPage</code>. Inserts some shapes
+ * into the draw page. Creates the rectangle shape.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes}( the created rectangle shape )</li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeBinder}, {@link ifc.drawing._XShapeGrouper},
+ * {@link ifc.drawing._XShapeCombiner}( the retrieved draw page )</li>
+ * </ul>
+ * @see com.sun.star.drawing.DrawPage
+ * @see com.sun.star.drawing.XDrawPagesSupplier
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShapes oShapes = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess) UnoRuntime.queryInterface
+ (XIndexAccess.class,oDPn);
+ try {
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class,oObj);
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 2000, 1500, 1000, 1000, "Line"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"));
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xDrawDoc, sDsc));
+
+ // adding relation for XShapeGrouper
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+
+} // finish class SdGenericDrawPage
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdLayer.java b/qadevOOo/tests/java/mod/_sd/SdLayer.java
new file mode 100644
index 000000000000..a8d8d513d259
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdLayer.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.drawing.XLayer;
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XLayerSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.Layer</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::Layer</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.drawing.Layer
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.drawing._Layer
+* @see ifc.beans._XPropertySet
+*/
+public class SdLayer extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the layer manager from the document and takes one of the layer.
+ * The obtained layer is the instance of the service
+ * <code>com.sun.star.drawing.Layer</code>.
+ * @see com.sun.star.drawing.Layer
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XLayerManager oLM = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // get the drawpage of drawing here
+ log.println( "getting LayerManager" );
+ XLayerSupplier oLS = (XLayerSupplier)
+ UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc);
+ XNameAccess oNA = oLS.getLayerManager();
+ oLM = (XLayerManager)
+ UnoRuntime.queryInterface(XLayerManager.class, oNA);
+ XIndexAccess oIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,oLM);
+ log.println( "getting LayerManager" );
+ try {
+ oObj = (XLayer) AnyConverter.toObject(
+ new Type(XLayer.class),oIA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdLayer
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdLayerManager.java b/qadevOOo/tests/java/mod/_sd/SdLayerManager.java
new file mode 100644
index 000000000000..7604ae36c922
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdLayerManager.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XLayerSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.LayerManager</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::XLayerManager</code></li>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.drawing.LayerManager
+* @see com.sun.star.drawing.XLayerManager
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.drawing._XLayerManager
+* @see ifc.container._XNameAccess
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+*/
+public class SdLayerManager extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the layer manager using the interface <code>XLayerSupplier</code>.
+ * The manager is the instance of the service
+ * <code>com.sun.star.drawing.LayerManager</code>. Creates a rectangle shape.
+ * Retrieves the collection of the draw pages and take one of them.
+ * <ul>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XLayerManager}(the created shape)</li>
+ * <li> <code>'Shapes'</code> for
+ * {@link ifc.drawing._XLayerManager}(the shape collection of
+ * the retrived draw page)</li>
+ * </ul>
+ * @see com.sun.star.drawing.XLayerSupplier
+ * @see com.sun.star.drawing.LayerManager
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+ XLayerSupplier oLS = (XLayerSupplier)
+ UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc);
+ XInterface oObj = oLS.getLayerManager();
+
+ log.println( "creating a new environment for XLayerManager object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator(xDrawDoc, sDsc));
+
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,oDPn);
+
+ XDrawPage oDP = null;
+ try {
+ oDP = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDP);
+
+ log.println( "adding Shapes as mod relation to environment" );
+ tEnv.addObjRelation("Shapes", oShapes);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SdLayerManager
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdMasterPage.java b/qadevOOo/tests/java/mod/_sd/SdMasterPage.java
new file mode 100644
index 000000000000..3ab99f2ebeca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdMasterPage.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPagesSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.MasterPage</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+* <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+* <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+* <li> <code>com::sun::star::drawing::XShapes</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* </ul>
+* @see com.sun.star.drawing.MasterPage
+* @see com.sun.star.drawing.GenericDrawPage
+* @see com.sun.star.drawing.XShapeBinder
+* @see com.sun.star.drawing.XShapeGrouper
+* @see com.sun.star.drawing.XShapes
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XShapeCombiner
+* @see com.sun.star.container.XNamed
+* @see ifc.drawing._GenericDrawPage
+* @see ifc.drawing._XShapeBinder
+* @see ifc.drawing._XShapeGrouper
+* @see ifc.drawing._XShapes
+* @see ifc.lang._XServiceInfo
+* @see ifc.beans._XPropertySet
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XShapeCombiner
+* @see ifc.container._XNamed
+*/
+public class SdMasterPage extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the master pages from the document using the
+ * interface <code>XMasterPagesSupplier</code> and takes
+ * one of them. Inserts some shapes into the document. Creates a rectangle
+ * shape. The retrieved master page is the instance of the service
+ * <code>com.sun.star.drawing.MasterPage</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeBinder}, {@link ifc.drawing._XShapeGrouper},
+ * {@link ifc.drawing._XShapeCombiner}( the draw page of the retrieved
+ * master page)</li>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes}(the created rectangle shape)</li>
+ * </ul>
+ * @see com.sun.star.drawing.XMasterPagesSupplier
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get the MasterPages here
+ log.println( "getting MasterPages" );
+ XMasterPagesSupplier oMPS = (XMasterPagesSupplier)
+ UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc);
+ XDrawPages oMPn = oMPS.getMasterPages();
+ XIndexAccess oMPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oMPn);
+
+ log.println( "getting MasterPage" );
+ XInterface oObj = null;
+ try {
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oMPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get MasterPage by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get MasterPage by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get MasterPage by index", e);
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ //put something on the masterpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oObj);
+ oShapes.add(SOF.createShape(xDrawDoc, 2000, 1500, 1000, 1000, "Line"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"));
+ oShapes.add(SOF.createShape
+ (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"));
+
+ log.println( "creating a new environment for MasterPage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding DrawPage as mod relation to environment" );
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xDrawDoc, sDsc));
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdMasterPage
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java b/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java
new file mode 100644
index 000000000000..ba314d66dfef
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.MasterPages</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::drawing::XDrawPages</code></li>
+* </ul>
+* @see com.sun.star.drawing.MasterPages
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.drawing.XDrawPages
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.drawing._XDrawPages
+*/
+public class SdMasterPagesAccess extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the master pages from the document using the
+ * interface <code>XMasterPagesSupplier</code>. Inserts two new draw pages.
+ * The retrieved collection is the instance of the service
+ * <code>com.sun.star.drawing.MasterPages</code>.
+ * @see com.sun.star.drawing.XMasterPagesSupplier
+ * @see com.sun.star.drawing.MasterPages
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ log.println( "creating a test environment" );
+
+ // get the MasterPages here
+ log.println( "getting MasterPages" );
+ XMasterPagesSupplier oMPS = (XMasterPagesSupplier)
+ UnoRuntime.queryInterface( XMasterPagesSupplier.class, xDrawDoc);
+ XDrawPages oMP = oMPS.getMasterPages();
+ log.println( "insert MasterPages" );
+ oMP.insertNewByIndex(1);
+ oMP.insertNewByIndex(2);
+ XInterface oObj = oMP;
+
+ log.println( "creating a new environment for MasterPagesAccess object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdMasterPagesAccess
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java
new file mode 100644
index 000000000000..7a729cd11121
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XLinkTargetSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.document.LinkTargets</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* </ul>
+* @see com.sun.star.document.LinkTargets
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+*/
+public class SdPageLinkTargets extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of draw pages and take one of them.
+ * Obtains the collection of possible links using the interface
+ * <code>XLinkTargetSupplier</code>. The obtained collection is
+ * the instance of the service <code>com.sun.star.document.LinkTargets</code>.
+ * Inserts some shapes into the document.
+ * @see com.sun.star.document.XLinkTargetSupplier
+ * @see com.sun.star.document.LinkTargets
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+ XDrawPage the_page = DrawTools.getDrawPage(xDrawDoc, 0);
+ XLinkTargetSupplier oLTS = (XLinkTargetSupplier)
+ UnoRuntime.queryInterface(XLinkTargetSupplier.class, the_page);
+ XInterface oObj = oLTS.getLinks();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class,the_page);
+ XShape oShape =
+ SOF.createShape(xDrawDoc, 15000, 13500, 5000, 5000, "OLE2");
+ oShapes.add(oShape);
+
+ XPropertySet shape_props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+
+ log.println("Inserting a Chart");
+
+ try {
+ shape_props.
+ setPropertyValue("CLSID","12DCAE26-281F-416F-a234-c3086127382e");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ }
+
+ log.println( "creating a new environment for LinkTargets object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdPageLinkTargets
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java
new file mode 100644
index 000000000000..fc90ba4166f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java
@@ -0,0 +1,299 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class SdUnoDrawView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xDrawDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service
+ * <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing draw documents");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ util.DesktopTools.closeDoc(xSecondDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating
+ * of the documents makes short
+ * wait to allow frames to be loaded. Retrieves
+ * the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page. Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing.DrawingDocumentDrawView}(the draw page which will
+ * be new current page) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ public synchronized lib.TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating two draw documents" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ shortWait();
+ xSecondDrawDoc = SOF.createDrawDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ XShape shape3 = SOF.createShape(
+ xDrawDoc, 3000, 500, 5000, 1000, "Line");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+ oShapes.add(shape3);
+ shortWait();
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ shape1, shape2, shape3});
+
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27009");
+
+ //Adding relations for DrawingDocumentDrawView
+ XDrawPage new_page = the_pages.insertNewByIndex(1);
+ tEnv.addObjRelation("DrawPage", new_page);
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
+
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+} // finish class SdUnoDrawView
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java
new file mode 100644
index 000000000000..ccd05a7f7ac9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.present.OutlineView</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::presentation::OutlineView</code></li>
+* <li> <code>com::sun::star::frame::XDispatchProvider</code></li>
+* <li> <code>com::sun::star::awt::XWindow</code></li>
+* </ul>
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.presentation.OutlineView
+* @see com.sun.star.awt.XWindow
+* @see com.sun.star.frame.XDispatchProvider
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.awt._XWindow
+* @see ifc.presentation._OutlineView
+* @see ifc.frame._XDispatchProvider
+*/
+public class SdUnoOutlineView extends TestCase {
+ XDesktop the_Desk;
+ XComponent xImpressDoc;
+ XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ util.DesktopTools.closeDoc(xSecondDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating of the documents makes short
+ * wait to allow frames to be loaded. Retrieves the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page. Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service <code>com.sun.star.presentation.OutlineView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ //Change to Outline view
+ try {
+ String aSlotID = "slot:27010";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, oObj );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+
+ try {
+ log.println( "creating a second impress document" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ oObj = aModel.getCurrentController();
+
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ }
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27069");
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(5000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+} // finish class SdUnoOutlineView
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java
new file mode 100644
index 000000000000..08dd749f4403
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java
@@ -0,0 +1,301 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.DrawingDocumentDrawView</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::drawing::DrawingDocumentDrawView</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+* <li> <code>com::sun::star::frame::XController</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::view::XSelectionSupplier</code></li>
+* <li> <code>com::sun::star::drawing::XDrawView</code></li>
+* </ul>
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.lang.XServiceInfo
+* @see com.sun.star.frame.XController
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.view.XSelectionSupplier
+* @see com.sun.star.drawing.XDrawView
+* @see ifc.drawing._DrawingDocumentDrawView
+* @see ifc.lang._XComponent
+* @see ifc.lang._XServiceInfo
+* @see ifc.frame._XController
+* @see ifc.beans._XPropertySet
+* @see ifc.view._XSelectionSupplier
+* @see ifc.drawing._XDrawView
+*/
+public class SdUnoPresView extends TestCase {
+ static XDesktop the_Desk;
+ static XComponent xImpressDoc;
+ static XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ util.DesktopTools.closeDoc(xSecondDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating of the documents makes short
+ * wait to allow frames to be loaded. Retrieves the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page. Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service
+ * <code>com.sun.star.drawing.DrawingDocumentDrawView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'First'</code> for
+ * {@link ifc.view._XSelectionSupplier}(the first created shape) </li>
+ * <li> <code>'Second'</code> for
+ * {@link ifc.view._XSelectionSupplier}(the second created shape) </li>
+ * <li> <code>'Pages'</code> for
+ * {@link ifc.drawing._XDrawView}(the retrieved collection of the draw
+ * pages) </li>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ * @see com.sun.star.drawing.DrawingDocumentDrawView
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating two impress documents" );
+ xImpressDoc = SOF.createImpressDoc(null);
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPages the_pages = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,the_pages);
+
+ XDrawPage oDrawPage = null;
+ XDrawPage secondDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ the_pages.insertNewByIndex(0);
+ the_pages.insertNewByIndex(0);
+ the_pages.insertNewByIndex(0);
+ the_pages.insertNewByIndex(0);
+ secondDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(3));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get DrawPage", e);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xImpressDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ oShapes.add(shape1);
+
+ oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, secondDrawPage);
+ shape1 = SOF.createShape(
+ xImpressDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ oShapes.add(shape1);
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ log.println( "creating a new environment for impress view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
+ }
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oDrawPage, secondDrawPage});
+
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+ if (indAc1 == null || indAc2 == null) return -1;
+ if (indAc1.getCount() == indAc2.getCount()) {
+ return 0;
+ }
+ return 1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+ tEnv.addObjRelation("FirstPage", oDrawPage);
+ tEnv.addObjRelation("SecondPage", secondDrawPage);
+
+ //tEnv.addObjRelation("First", shape1);
+ //tEnv.addObjRelation("Second", shape2);
+
+ tEnv.addObjRelation("Pages", the_pages);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel);
+
+ XController secondController = aModel.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27010");
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ XModifiable modify = (XModifiable)
+ UnoRuntime.queryInterface(XModifiable.class,xImpressDoc);
+
+ tEnv.addObjRelation("Modifiable",modify);
+
+
+ tEnv.addObjRelation("XComponent.DisposeThis", xImpressDoc);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(5000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+} // finish class SdUnoDrawView
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java
new file mode 100644
index 000000000000..74c619841d3a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.drawing.XDrawPages;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+public class SdUnoSlideView extends TestCase {
+ XDesktop the_Desk;
+ XComponent xImpressDoc;
+ XComponent xSecondDrawDoc;
+
+ /**
+ * Creates the instance of the service <code>com.sun.star.frame.Desktop</code>.
+ * @see com.sun.star.frame.Desktop
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop)
+ UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress documents.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing impress documents");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ util.DesktopTools.closeDoc(xSecondDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates two impress documents. After creating of the documents makes short
+ * wait to allow frames to be loaded. Retrieves the collection of the draw pages
+ * from the first document and takes one of them. Inserts some shapes to the
+ * retrieved draw page. Obtains a current controller from the first document
+ * using the interface <code>XModel</code>. The obtained controller is the
+ * instance of the service <code>com.sun.star.presentation.OutlineView</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FirstModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the first created document) </li>
+ * <li> <code>'Frame'</code> for
+ * {@link ifc.frame._XController}(the frame of the created
+ * document) </li>
+ * <li> <code>'SecondModel'</code> for
+ * {@link ifc.frame._XController}(the interface <code>XModel</code> of
+ * the second created document) </li>
+ * <li> <code>'SecondController'</code> for
+ * {@link ifc.frame._XController}(the current controller of the second
+ * created document) </li>
+ * </ul>
+ * @see com.sun.star.frame.XModel
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ XDrawPages xDP = null;
+ try {
+ log.println( "creating a impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);
+ shortWait();
+ xDP = DrawTools.getDrawPages(xImpressDoc);
+ xDP.insertNewByIndex(0);
+ xDP.insertNewByIndex(0);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+
+ XInterface oObj = aModel.getCurrentController();
+
+ //Change to Slide view
+ try {
+ String aSlotID = "slot:27011";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, oObj );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change to slide view");
+ }
+
+ try {
+ log.println( "creating a second impress document" );
+ xSecondDrawDoc = SOF.createImpressDoc(null);
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel2 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
+
+ XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class,aModel2.getCurrentController());
+
+ oObj = aModel.getCurrentController();
+
+ log.println( "creating a new environment for slide view object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ if (anotherWindow != null) {
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ }
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("FirstModel", aModel);
+
+ XFrame the_frame = the_Desk.getCurrentFrame();
+ tEnv.addObjRelation("Frame", the_frame);
+
+ //Adding ObjRelations for XController
+ tEnv.addObjRelation("SecondModel", aModel2);
+
+ XController secondController = aModel2.getCurrentController();
+ tEnv.addObjRelation("SecondController", secondController);
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "slot:27069");
+
+ tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
+
+ //creating obj-relation for the XSelectionSupplier
+ try {
+ Object[] selections =
+ new Object[]{xDP.getByIndex(0),xDP.getByIndex(1),xDP.getByIndex(2)};
+ tEnv.addObjRelation("Selections", selections);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ }
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+
+} // finish class SdUnoOutlineView
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java
new file mode 100644
index 000000000000..ffe835f3e543
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.presentation.CustomPresentation</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNamed</code></li>
+* <li> <code>com::sun::star::container::XIndexContainer</code></li>
+* <li> <code>com::sun::star::container::XIndexAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XIndexReplace</code></li>
+* </ul>
+* @see com.sun.star.presentation.CustomPresentation
+* @see com.sun.star.container.XNamed
+* @see com.sun.star.container.XIndexContainer
+* @see com.sun.star.container.XIndexAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XIndexReplace
+* @see ifc.container._XNamed
+* @see ifc.container._XIndexContainer
+* @see ifc.container._XIndexAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XIndexReplace
+*/
+public class SdXCustomPresentation extends TestCase {
+ XComponent xImpressDoc;
+
+ /**
+ * Creates Impress document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Disposes Impress document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xImpressDoc");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the CustomPresentation from the document
+ * using the interface <code>XCustomPresentationSupplier</code>. Creates and
+ * inserts new instance of the presentation to the collection. The created
+ * instance is the instance of the service
+ * <code>com.sun.star.presentation.CustomPresentation</code>. Obtains
+ * the collection of draw pages from the document and takes one of them.
+ * Inserts the obtained draw page to the created instance. Inserts some new
+ * draw pages.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XIndexContainerINDEX'</code> for
+ * {@link ifc.container._XIndexContainer}(the string representation of
+ * the zero)</li>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XIndexContainer}(the new inserted draw pages)</li>
+ * </ul>
+ * @see com.sun.star.presentation.XCustomPresentationSupplier
+ * @see com.sun.star.presentation.CustomPresentation
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+
+ log.println( "creating a test environment" );
+
+ log.println( "get presentation" );
+ XCustomPresentationSupplier oPS = (XCustomPresentationSupplier)
+ UnoRuntime.queryInterface(
+ XCustomPresentationSupplier.class, xImpressDoc);
+ XInterface oObj = oPS.getCustomPresentations();
+
+ XSingleServiceFactory oSingleMSF = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj);
+
+ XInterface oInstance = null;
+ try {
+ oInstance = (XInterface) oSingleMSF.createInstance();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XNameContainer aContainer = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj);
+
+ try {
+ aContainer.insertByName("FirstPresentation", oInstance);
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Presentation", e);
+ } catch (com.sun.star.container.ElementExistException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Presentation", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Presentation", e);
+ }
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oDPn);
+
+ XDrawPage oDrawPage = null;
+ try {
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ XIndexContainer aIContainer = (XIndexContainer)
+ UnoRuntime.queryInterface(XIndexContainer.class,oInstance);
+
+ try {
+ aIContainer.insertByIndex(0, oDrawPage);
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert DrawPage", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert DrawPage", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert DrawPage", e);
+ }
+
+ log.println( "creating a new environment for XPresentation object" );
+ TestEnvironment tEnv = new TestEnvironment( oInstance );
+
+ int THRCNT=1;
+ if ((String)Param.get("THRCNT") != null) {
+ THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
+ }
+
+ // INDEX : _XNameContainer
+ log.println( "adding XIndexContainerINDEX as mod relation to environment" );
+ tEnv.addObjRelation("XIndexContainerINDEX", "0");
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+ try {
+ for (int n = 1; n < (2*THRCNT+1) ;n++ ) {
+ log.println( "adding INSTANCE" + n
+ +" as mod relation to environment" );
+ oDPn.insertNewByIndex(0);
+ oDrawPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ tEnv.addObjRelation("INSTANCE" + n, oDrawPage);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't adding INSTANCEn", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't adding INSTANCEn", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't adding INSTANCEn", e);
+ }
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SdXCustomPresentation
diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
new file mode 100644
index 000000000000..c34d0c67c5f2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.presentation.CustomPresentationAccess</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::container::XNameReplace</code></li>
+* <li> <code>com::sun::star::lang::XSingleServiceFactory</code></li>
+* <li> <code>com::sun::star::container::XNameContainer</code></li>
+* </ul>
+* @see com.sun.star.presentation.CustomPresentationAccess
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.container.XNameReplace
+* @see com.sun.star.lang.XSingleServiceFactory
+* @see com.sun.star.container.XNameContainer
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.container._XNameReplace
+* @see ifc.lang._XSingleServiceFactory
+* @see ifc.container._XNameContainer
+*/
+public class SdXCustomPresentationAccess extends TestCase {
+ XComponent xImpressDoc;
+
+ /**
+ * Creates Impress document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes Impress document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xImpressDoc");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the CustomPresentation from the document
+ * using the interface <code>XCustomPresentationSupplier</code>.
+ * The retrieved collection is the instance of the servcie
+ * <code>com.sun.star.presentation.CustomPresentationAccess</code>.
+ * Creates two new instances of the custom presentation using the interface
+ * <code>XSingleServiceFactory</code>. Inserts one of them to the
+ * retrieved collection. Creates and inserts several instances of
+ * the presentation.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SecondInstance'</code> for
+ * {@link ifc.container._XNameContainer}(the second created instance
+ * of the custom presentation)</li>
+ * <li> <code>'XNameContainerINDEX'</code> for
+ * {@link ifc.container._XNameContainer}(the number of current running
+ * threads)</li>
+ * <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> for
+ * {@link ifc.container._XNameReplace},
+ * {@link ifc.container._XNameContainer}(the created instances of
+ * the presentation)</li>
+ * </ul>
+ * @see com.sun.star.presentation.XCustomPresentationSupplier
+ * @see com.sun.star.lang.XSingleServiceFactory
+ * @see com.sun.star.presentation.CustomPresentationAccess
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+
+ log.println( "creating a test environment" );
+
+ log.println( "get presentation" );
+ XCustomPresentationSupplier oPS = (XCustomPresentationSupplier)
+ UnoRuntime.queryInterface(
+ XCustomPresentationSupplier.class, xImpressDoc);
+ XInterface oObj = oPS.getCustomPresentations();
+
+
+ XSingleServiceFactory oSingleMSF = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, oObj);
+
+ XInterface oInstance = null;
+ XInterface oSecondInstance = null;
+ try{
+ oInstance = (XInterface) oSingleMSF.createInstance();
+ oSecondInstance = (XInterface) oSingleMSF.createInstance();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XNameContainer aContainer = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj);
+
+ if (aContainer.hasByName("FirstPresentation")) {
+ try {
+ aContainer.removeByName("FirstPresentation");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Exception while removing instance", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Exception while removing instance", e);
+ }
+ }
+
+ try {
+ aContainer.insertByName("FirstPresentation",oInstance);
+ } catch (com.sun.star.lang.WrappedTargetException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ } catch (com.sun.star.container.ElementExistException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e){
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ }
+
+ log.println( "creating a new environment for XPresentation object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding an instance for insertByName ('XNameContainer')
+ tEnv.addObjRelation("SecondInstance", oSecondInstance);
+
+ int THRCNT = 1;
+ if ((String)Param.get("THRCNT") != null) {
+ THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
+ }
+
+ // INDEX : _XNameContainer
+ log.println( "adding XNameContainerINDEX as mod relation to environment" );
+ tEnv.addObjRelation("XNameContainerINDEX",
+ (new Integer(THRCNT)).toString());
+
+ // INSTANCEn : _XNameContainer; _XNameReplace
+ log.println( "adding INSTANCEn as mod relation to environment" );
+ try {
+ for (int n = 1; n < (2*THRCNT+1) ;n++ ) {
+ log.println( "adding INSTANCE" + n
+ +" as mod relation to environment" );
+ oInstance = (XInterface) oSingleMSF.createInstance();
+ tEnv.addObjRelation("INSTANCE" + n, oInstance);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Could't adding INSTANCEn: " + e);
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SdXCustomPresentationAccess
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java
new file mode 100644
index 000000000000..39960d7e63a8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sd;
+
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.view.XSelectionSupplier;
+import ifc.view._XPrintJobBroadcaster;
+import java.io.File;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.presentation.PresentationDocument</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * <li> <code>com::sun::star::drawing::XMasterPagesSupplier</code></li>
+ * <li> <code>com::sun::star::presentation::XCustomPresentationSupplier</code></li>
+ * <li> <code>com::sun::star::document::XLinkTargetSupplier</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::drawing::XLayerSupplier</code></li>
+ * <li> <code>com::sun::star::presentation::XPresentationSupplier</code></li>
+ * <li> <code>com::sun::star::style::XStyleFamiliesSupplier</code></li>
+ * <li> <code>com::sun::star::drawing::DrawingDocument</code></li>
+ * <li> <code>com::sun::star::drawing::XDrawPageDuplicator</code></li>
+ * <li> <code>com::sun::star::drawing::XDrawPagesSupplier</code></li>
+ * </ul>
+ * @see com.sun.star.presentation.PresentationDocument
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see com.sun.star.drawing.XMasterPagesSupplier
+ * @see com.sun.star.presentation.XCustomPresentationSupplier
+ * @see com.sun.star.document.XLinkTargetSupplier
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.drawing.XLayerSupplier
+ * @see com.sun.star.presentation.XPresentationSupplier
+ * @see com.sun.star.style.XStyleFamiliesSupplier
+ * @see com.sun.star.drawing.DrawingDocument
+ * @see com.sun.star.drawing.XDrawPageDuplicator
+ * @see com.sun.star.drawing.XDrawPagesSupplier
+ * @see ifc.lang._XMultiServiceFactory
+ * @see ifc.drawing._XMasterPagesSupplier
+ * @see ifc.presentation._XCustomPresentationSupplier
+ * @see ifc.document._XLinkTargetSupplier
+ * @see ifc.beans._XPropertySet
+ * @see ifc.drawing._XLayerSupplier
+ * @see ifc.presentation._XPresentationSupplier
+ * @see ifc.style._XStyleFamiliesSupplier
+ * @see ifc.drawing._DrawingDocument
+ * @see ifc.drawing._XDrawPageDuplicator
+ * @see ifc.drawing._XDrawPagesSupplier
+ */
+public class SdXImpressDocument extends TestCase {
+ XComponent xImpressDoc;
+ XComponent xImpressDoc2;
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes Impress document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xImpressDoc");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ util.DesktopTools.closeDoc(xImpressDoc2);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates new impress document that is the instance of the service
+ * <code>com.sun.star.presentation.PresentationDocument</code>.
+ * @see com.sun.star.presentation.PresentationDocument
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating two impress documents");
+ xImpressDoc2 = SOF.createImpressDoc(null);
+ xImpressDoc = SOF.createImpressDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create documents", e);
+ }
+
+ XModel xModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xImpressDoc);
+ XModel xModel2 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xImpressDoc2);
+
+ XController cont1 = xModel1.getCurrentController();
+ XController cont2 = xModel2.getCurrentController();
+
+ cont1.getFrame().setName("cont1");
+ cont2.getFrame().setName("cont2");
+
+ XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, cont1);
+
+ XShape aShape = SOF.createShape(xImpressDoc, 5000, 3500, 7500, 5000,
+ "Rectangle");
+
+
+ XPropertySet xShapeProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, aShape);
+
+ try {
+ xShapeProps.setPropertyValue("FillStyle", com.sun.star.drawing.FillStyle.SOLID);
+ xShapeProps.setPropertyValue("FillTransparence", new Integer(50));
+ } catch (UnknownPropertyException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't make shape transparent", ex);
+ } catch (PropertyVetoException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't make shape transparent", ex);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't make shape transparent", ex);
+ } catch (WrappedTargetException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't make shape transparent", ex);
+ }
+
+ DrawTools.getDrawPage(xImpressDoc, 0).add(aShape);
+
+ log.println("creating a new environment for drawpage object");
+
+ TestEnvironment tEnv = new TestEnvironment(xImpressDoc);
+
+ log.println("adding Controller as ObjRelation for XModel");
+ tEnv.addObjRelation("CONT2", cont2);
+
+ log.println("Adding SelectionSupplier and Shape to select for XModel");
+ tEnv.addObjRelation("SELSUPP", sel);
+ tEnv.addObjRelation("TOSELECT", aShape);
+
+ // create object relation for XPrintJobBroadcaster
+ String fileName = utils.getOfficeTempDirSys((XMultiServiceFactory) Param.getMSF())+"printfile.prt" ;
+ File f = new File(fileName);
+ if (f.exists()) {
+ f.delete();
+ }
+ _XPrintJobBroadcaster.MyPrintJobListener listener = new _XPrintJobBroadcaster.MyPrintJobListener(xImpressDoc, fileName);
+ tEnv.addObjRelation("XPrintJobBroadcaster.XPrintJobListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SdDrawPage
diff --git a/qadevOOo/tests/java/mod/_sd/SdXPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java
new file mode 100644
index 000000000000..b30ad68172be
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+import com.sun.star.presentation.XPresentationSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.presentation.Presentation</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::presentation::Presentation</code></li>
+* <li> <code>com::sun::star::presentation::XPresentation</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* </ul>
+* @see com.sun.star.presentation.Presentation
+* @see com.sun.star.presentation.XPresentation
+* @see com.sun.star.beans.XPropertySet
+* @see ifc.presentation._Presentation
+* @see ifc.presentation._XPresentation
+* @see ifc.beans._XPropertySet
+*/
+public class SdXPresentation extends TestCase {
+ XComponent xImpressDoc;
+
+ /**
+ * Creates Impress document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Impress document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xImpressDoc");
+ util.DesktopTools.closeDoc(xImpressDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the presentation from the document using the interface
+ * <code>XPresentationSupplier</code>. The retrieved presentation is the
+ * instance of the service <code>com.sun.star.presentation.Presentation</code>.
+ * Retrieves the collection of the customized presentations from the document
+ * using the interface <code>XCustomPresentationSupplier</code>.
+ * Creates and inserts two new instances of presentation to the retrieved
+ * collection.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Presentation'</code> for
+ * {@link ifc.presentation._Presentation}(the retrieved presentation)</li>
+ * </ul>
+ * @see com.sun.star.presentation.XCustomPresentationSupplier
+ * @see com.sun.star.presentation.Presentation
+ * @see com.sun.star.presentation.XCustomPresentationSupplier
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ log.println( "get presentation" );
+ XPresentationSupplier oPS = (XPresentationSupplier)
+ UnoRuntime.queryInterface(XPresentationSupplier.class, xImpressDoc);
+ XInterface oObj = oPS.getPresentation();
+
+ log.println( "get custom presentation" );
+ XCustomPresentationSupplier oCPS = (XCustomPresentationSupplier)
+ UnoRuntime.queryInterface(
+ XCustomPresentationSupplier.class, xImpressDoc);
+ XNameContainer xCP = oCPS.getCustomPresentations();
+
+ XInterface oInstance = null;
+ XInterface oInstance2 = null;
+
+ XSingleServiceFactory oSingleMSF = (XSingleServiceFactory)
+ UnoRuntime.queryInterface(XSingleServiceFactory.class, xCP);
+
+ try{
+ oInstance = (XInterface) oSingleMSF.createInstance();
+ oInstance2 = (XInterface) oSingleMSF.createInstance();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ try {
+ xCP.insertByName("FirstPresentation",oInstance);
+ xCP.insertByName("SecondPresentation", oInstance2);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ } catch (com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Could't insert Instance", e);
+ }
+
+ log.println( "creating a new environment for XPresentation object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("Presentation",oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SdPresentation
+
diff --git a/qadevOOo/tests/java/mod/_sd/SdXShape.java b/qadevOOo/tests/java/mod/_sd/SdXShape.java
new file mode 100644
index 000000000000..434e7ad6dc07
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXShape.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.drawing.Shape</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::drawing::XShape</code></li>
+* <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::drawing::Shape</code></li>
+* </ul>
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.drawing.XShape
+* @see com.sun.star.drawing.XShapeDescriptor
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.drawing.Shape
+* @see ifc.lang._XComponent
+* @see ifc.drawing._XShape
+* @see ifc.drawing._XShapeDescriptor
+* @see ifc.beans._XPropertySet
+* @see ifc.drawing._Shape
+*/
+public class SdXShape extends TestCase {
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes Drawing document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Retrieves the collection of the draw pages from the drawing document using
+ * the interface <code>XDrawPagesSupplier</code>. Creates a rectangle shape
+ * that is the instance of the service <code>com.sun.star.drawing.Shape</code>.
+ * Creates and adds several new rectangle shapes and one ellipse shape to
+ * the retrieved draw page. Sets and gets some properties of the created
+ * rectangle shape.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1'</code> for
+ * {@link ifc.drawing._XShapeDescriptor}, {@link ifc.drawing._XShape}
+ * (the value of the property 'Style' that was retrived from the created
+ * rectangle shape) </li>
+ * <li> <code>'Style2'</code> for
+ * {@link ifc.drawing._XShapeDescriptor}, {@link ifc.drawing._XShape}
+ * (the value of the property 'Style' that was retrived from the created
+ * ellipse shape) </li>
+ * </ul>
+ * @see com.sun.star.drawing.XDrawPagesSupplier
+ * @see com.sun.star.drawing.Shape
+ */
+ protected synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oDPn);
+ XDrawPage oDP = null;
+ try {
+ oDP = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get by index", e);
+ }
+
+ //get a Shape
+ log.println( "getting Shape" );
+ XShapes oShapes = (XShapes) UnoRuntime.queryInterface
+ (XShapes.class, oDP);
+ XInterface oObj = SOF.createShape
+ (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ for (int i=0; i < 10; i++) {
+ oShapes.add(
+ SOF.createShape(xDrawDoc,
+ 5000, 3500, 7510 + 10 * i, 5010 + 10 * i, "Rectangle"));
+ }
+ XShape oShape = SOF.createShape
+ (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ oShapes.add((XShape) oObj);
+ oShapes.add((XShape) oShape);
+
+ log.println( "creating a new environment for XShape object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ oShapeProps.setPropertyValue("ZOrder", new Integer(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set or get property value", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set or get property value", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set or get property value", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set or get property value", e);
+ }
+
+ tEnv.addObjRelation("Style1", aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property value", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property value", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get property value", e);
+ }
+
+ tEnv.addObjRelation("Style2", aStyle);
+
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SdXShape
diff --git a/qadevOOo/tests/java/mod/_sd/package.html b/qadevOOo/tests/java/mod/_sd/package.html
new file mode 100644
index 000000000000..000df01c68d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'sd'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_servicemgr.uno/OServiceManager.java b/qadevOOo/tests/java/mod/_servicemgr.uno/OServiceManager.java
new file mode 100644
index 000000000000..18315f892b1f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_servicemgr.uno/OServiceManager.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._servicemgr.uno;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XSet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.stoc.OServiceManager</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * <li> <code>com::sun::star::container::XContentEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::container::XSet</code></li>
+ * <li> <code>com::sun::star::lang::XMultiComponentFactory</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see com.sun.star.container.XContentEnumerationAccess
+ * @see com.sun.star.container.XSet
+ * @see com.sun.star.lang.XMultiComponentFactory
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.lang._XMultiServiceFactory
+ * @see ifc.container._XContentEnumerationAccess
+ * @see ifc.container._XSet
+ * @see ifc.lang._XMultiComponentFactory
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.lang._XComponent
+ */
+public class OServiceManager extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.stoc.OServiceManager</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'NewElement'</code> for
+ * {@link ifc.container._XSet} :
+ * element to be inserted into manager. Here
+ * a new <code>ServiceManager</code> implementation is
+ * create using
+ * <code>tools.SOConnect.createSimpleServiceManager()</code>
+ * and one of services contained in it is taken.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.OServiceManager" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("ServiceManager service not available" );
+ }
+
+ // adding a service to the manager
+ Object newElement = null ;
+ XMultiServiceFactory srvMan = null;
+ XComponentContext xContext = null;
+
+ try {
+
+ srvMan = com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();
+
+ } catch ( java.lang.Exception ex) {
+ log.println("Error creating SimpleServiceManager :");
+ ex.printStackTrace(log);
+ }
+
+ try {
+ XSet set = (XSet) UnoRuntime.queryInterface
+ (XSet.class, oInterface) ;
+ XSet set1 = (XSet) UnoRuntime.queryInterface
+ (XSet.class, srvMan) ;
+ XEnumeration oEnum = set1.createEnumeration();
+ Object srv = oEnum.nextElement();
+
+ set.insert(srv) ;
+
+ newElement = oEnum.nextElement();
+
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oInterface);
+ if (xProp != null) {
+ xContext = (XComponentContext) AnyConverter.toObject(
+ new Type(XComponentContext.class),
+ xProp.getPropertyValue("DefaultContext"));
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't insert a service to the ServiceManager") ;
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XSet interface
+ tEnv.addObjRelation("NewElement", newElement) ;
+
+ // adding relation for XPropertySet
+ tEnv.addObjRelation("PTT",new String[]{"DefaultContext","none","none"});
+
+ //adding relation for XMultiComponentFactory
+ if (xContext != null) {
+ tEnv.addObjRelation("DC", xContext);
+ }
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OServiceManager
+
diff --git a/qadevOOo/tests/java/mod/_servicemgr.uno/package.html b/qadevOOo/tests/java/mod/_servicemgr.uno/package.html
new file mode 100644
index 000000000000..3875e8d7dd79
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_servicemgr.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'smgr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java b/qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java
new file mode 100644
index 000000000000..18da8c9431f2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.dbg;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.sfx2.SfxMacroLoader</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::frame::XDispatchProvider</code></li>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.frame.XDispatchProvider
+ * @see com.sun.star.lang.XInitialization
+ * @see ifc.frame._XDispatchProvider
+ * @see ifc.lang._XInitialization
+ */
+public class AppDispatchProvider extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.sfx2.SfxMacroLoader</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FrameLoader.URL"'</code> for
+ * {@link ifc.frame._XFrameLoader} </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.comp.sfx2.AppDispatchProvider") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ System.out.println("ImplName: "+utils.getImplName(oObj));
+ dbg.printInterfaces(oObj);
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for :XDispatchProvider
+ tEnv.addObjRelation("XDispatchProvider.URL", ".uno:BibliographyComponent") ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java b/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java
new file mode 100644
index 000000000000..32b34f507f74
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.frame.DocumentTemplates</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::frame::XDocumentTemplates</code></li>
+ * </ul> <p>
+ *
+ */
+public class DocumentTemplates extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String aURL=util.utils.getFullTestURL("report2.stw");
+ xTextDoc = util.WriterTools.loadTextDoc((XMultiServiceFactory)tParam.getMSF(),aURL);
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.frame.DocumentTemplates</code>.
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+ XStorable store = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.frame.DocumentTemplates");
+ store = (XStorable) UnoRuntime.queryInterface
+ (XStorable.class,xTextDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("Store",store);
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_sfx/FrameLoader.java b/qadevOOo/tests/java/mod/_sfx/FrameLoader.java
new file mode 100644
index 000000000000..217e2509d3a9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/FrameLoader.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.dbg;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.comp.office.FrameLoader</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::frame::XFrameLoader</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.frame.FrameLoader
+* @see com.sun.star.frame.XSynchronousFrameLoader
+*/
+public class FrameLoader extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.office.FrameLoader</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FrameLoader.URL"'</code> for
+ * {@link ifc.frame._XFrameLoader} </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.comp.office.FrameLoader") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException
+ (Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ System.out.println("ImplName: "+utils.getImplName(oObj));
+ dbg.printInterfaces(oObj);
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XFrameLoader
+ tEnv.addObjRelation("FrameLoader.URL","private:factory/swriter");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java b/qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java
new file mode 100644
index 000000000000..7b4725fe98c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.dbg;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.sfx2.SfxMacroLoader</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::frame::XDispatchProvider</code></li>
+ * <li> <code>com::sun::star::lang::XInitialization</code></li>
+ * </ul>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.frame.XDispatchProvider
+ * @see com.sun.star.lang.XInitialization
+ * @see ifc.frame._XDispatchProvider
+ * @see ifc.lang._XInitialization
+ */
+public class SfxMacroLoader extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.sfx2.SfxMacroLoader</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FrameLoader.URL"'</code> for
+ * {@link ifc.frame._XFrameLoader} </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.comp.sfx2.SfxMacroLoader");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get service");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GridControl", e );
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException(Status.failed("Service wasn't created")) ;
+ }
+
+ oObj = (XInterface) oInterface ;
+ System.out.println("ImplName: "+utils.getImplName(oObj));
+ dbg.printInterfaces(oObj);
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XFrameLoader
+ tEnv.addObjRelation("XDispatchProvider.URL",
+ "macro:tools.UCB.CreateFolder(\"" +
+ utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF()) + "/SfxMacroLoader\")") ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java b/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java
new file mode 100644
index 000000000000..b015a858a903
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.document.XStandaloneDocumentInfo;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.document.StandaloneDocumentInfo</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::document::DocumentInfo</code></li>
+ * <li> <code>com::sun::star::document::XDocumentInfo</code></li>
+ * <li> <code>com::sun::star::document::XStandaloneDocumentInfo</code></li>
+ * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> SfxStandaloneDocInfoObject.sdw </b> : is copied
+ * to SOffice temporary directory and is used to load and
+ * save its info. </li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.document.DocumentInfo
+ * @see com.sun.star.document.XDocumentInfo
+ * @see com.sun.star.document.XStandaloneDocumentInfo
+ * @see com.sun.star.beans.XFastPropertySet
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XComponent
+ * @see ifc.document._DocumentInfo
+ * @see ifc.document._XDocumentInfo
+ * @see ifc.document._XStandaloneDocumentInfo
+ * @see ifc.beans._XFastPropertySet
+ * @see ifc.beans._XPropertySet
+ */
+public class StandaloneDocumentInfo extends TestCase {
+
+ String destUrl = null ;
+
+ /**
+ * Copies file 'SfxStandaloneDocInfoObject.sdw' to tempopary
+ * location (overwriting the old file if exists).
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ String srcUrl = utils.getFullTestURL("SfxStandaloneDocInfoObject.sdw") ;
+ destUrl = utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()) +
+ "SfxStandaloneDocInfoObject.sdw";
+
+ utils.doOverwriteFile((XMultiServiceFactory)tParam.getMSF(), srcUrl, destUrl) ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.document.StandaloneDocumentInfo</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DOCURL'</code> for
+ * {@link ifc.document._XStandaloneDocumentInfo} :
+ * the Writer file URL in temporary location. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.document.StandaloneDocumentInfo");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ String Iname = util.utils.getImplName(oObj);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ XStandaloneDocumentInfo the_info = (XStandaloneDocumentInfo)
+ UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oObj);
+ try {
+ the_info.loadFromURL(destUrl);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't load document: " + destUrl,e);
+ }
+ tEnv.addObjRelation("DOCURL",destUrl);
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_shlibloader.uno/DLLComponentLoader.java b/qadevOOo/tests/java/mod/_shlibloader.uno/DLLComponentLoader.java
new file mode 100644
index 000000000000..6992a80d208e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_shlibloader.uno/DLLComponentLoader.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._shlibloader.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+* Test for <code>com.sun.star.comp.stoc.DLLComponentLoader</code> service <p>
+* Files which are used :
+* <ul>
+* <li> <code>XImpReg.dll</code> : DLL which will be loaded in
+* <code>XImplementationLoader</code> interface test. </li>
+* <ul>
+* Multithread testing compilant.
+* @see com.sun.star.loader.XImplementationLoader
+* @see com.sun.star.lang.XServiceInfo
+* @see ifc.loader._XImplementationLoader
+* @see ifc.lang._XServiceInfo
+*/
+public class DLLComponentLoader extends TestCase {
+
+ /**
+ * Does nothing.
+ */
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.comp.stoc.DLLComponentLoader</code>
+ * service. <p>
+ * The following object relations created :
+ * <ul>
+ * <li> <code>'ImplementationLoader'</code> : service which is
+ * responsible for loading DLL implementations. </li>
+ * <li> <code>'ImplementationUrl'</code> : DLL file location. </li>
+ * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.DLLComponentLoader" );
+ }
+ catch( Exception e ) {
+ log.println("DLLComponentLoader Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for DLLComponentLoader object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding object relation for XImplementationLoader ifc test
+ tEnv.addObjRelation("ImplementationLoader",
+ "com.sun.star.loader.SharedLibrary") ;
+ //String fs = System.getProperty("file.separator");
+ String os = (String) Param.get("OS");
+ if (os == null || os == "")
+ throw new StatusException(
+ "Couldn't determine operating system for naming convention.",
+ new NullPointerException());
+ String name = "javaloader.uno";
+ if (!os.equals("wntmsci"))
+ name = name + ".so";
+ else
+ name += ".dll";
+ String implURL = utils.getOfficeURL(xMSF)+"/"+name;
+ tEnv.addObjRelation("ImplementationUrl", implURL) ;
+ log.println("looking for shared lib: " + implURL);
+ tEnv.addObjRelation("ImplementationName",
+ "com.sun.star.comp.stoc.JavaComponentLoader") ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class DLLComponentLoader
+
diff --git a/qadevOOo/tests/java/mod/_shlibloader.uno/package.html b/qadevOOo/tests/java/mod/_shlibloader.uno/package.html
new file mode 100644
index 000000000000..55c1c1ffd2c3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_shlibloader.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'cpld'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_simplereg.uno/SimpleRegistry.java b/qadevOOo/tests/java/mod/_simplereg.uno/SimpleRegistry.java
new file mode 100644
index 000000000000..5c8730b7bcca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_simplereg.uno/SimpleRegistry.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._simplereg.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.registry.SimpleRegistry</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::registry::XSimpleRegistry</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> XSimpleRegistry.rdb </b> : a registry file with
+ * some key set. </li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.registry.XSimpleRegistry
+ * @see ifc.registry._XSimpleRegistry
+ */
+public class SimpleRegistry extends TestCase {
+
+ /**
+ * Creates a temporary copy of file, which is deleted when VM exits.
+ * @param src Source file path.
+ * @param dst Destination file path.
+ * @param log The log writer.
+ * @throws java.io.IOException If any problems occur during copiing.
+ */
+ protected void copyFile(String src, String dst, PrintWriter log)
+ throws java.io.IOException {
+ File srcF = new File(src) ;
+ File dstF = new File(dst) ;
+ System.out.println("H1");
+
+ if (dstF.exists()) dstF.delete() ;
+ System.out.println("H2");
+ dstF.createNewFile() ;
+
+ dstF.deleteOnExit() ;
+ System.out.println("H3");
+
+ FileInputStream fIn = new FileInputStream(srcF) ;
+ System.out.println("H4");
+
+ FileOutputStream fOut = new FileOutputStream(dstF) ;
+
+ byte[] buf = new byte[1024] ;
+ int bytesRead = 0 ;
+ while ((bytesRead = fIn.read(buf)) > 0)
+ fOut.write(buf, 0, bytesRead) ;
+
+ fIn.close() ;
+ fOut.close() ;
+ }
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.registry.SimpleRegistry</code>. Then
+ * makes three copies of a predefined registry file with different
+ * names in a temporary SOffice directory and passes their URLs as
+ * relations. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XSimpleRegistry.open'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * <li> <code>'XSimpleRegistry.merge'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * <li> <code>'XSimpleRegistry.destroy'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+ final String tmpDir = utils.getOfficeTempDirSys(
+ (XMultiServiceFactory)Param.getMSF()) ;
+ final String openF = "XSimpleRegistry_open.rdb" ;
+ final String destroyF = "XSimpleRegistry_destroy.rdb" ;
+ final String mergeF = "XSimpleRegistry_merge.rdb" ;
+
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.registry.SimpleRegistry" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ if (oInterface == null)
+ log.println("Service wasn't created") ;
+
+ oObj = (XInterface) oInterface;
+
+ log.println("creating copies of the registry for XSimpleRegistry");
+ try {
+ String source = utils.getFullTestDocName("XSimpleRegistry.rdb");
+ copyFile(source, tmpDir + openF, log);
+ copyFile(source, tmpDir + destroyF, log);
+ copyFile(source, tmpDir + mergeF, log);
+ } catch (java.io.IOException e) {
+ log.println("Exception occured while copying files");
+ e.printStackTrace(log);
+ }
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XSimpleRegistry.open", tmpDir + openF);
+ tEnv.addObjRelation("XSimpleRegistry.destroy", tmpDir + destroyF);
+ tEnv.addObjRelation("XSimpleRegistry.merge", tmpDir + mergeF);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SimpleRegistry
+
diff --git a/qadevOOo/tests/java/mod/_simplereg.uno/package.html b/qadevOOo/tests/java/mod/_simplereg.uno/package.html
new file mode 100644
index 000000000000..09c65912df6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_simplereg.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'simreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java b/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java
new file mode 100644
index 000000000000..a3c5786f45f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._simreg;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.registry.SimpleRegistry</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::registry::XSimpleRegistry</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> XSimpleRegistry.rdb </b> : a registry file with
+ * some key set. </li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.registry.XSimpleRegistry
+ * @see ifc.registry._XSimpleRegistry
+ */
+public class SimpleRegistry extends TestCase {
+
+ /**
+ * Creates a temporary copy of file, which is deleted when VM exits.
+ * @param src Source file path.
+ * @param dst Destination file path.
+ * @param log The log writer.
+ * @throws java.io.IOException If any problems occur during copiing.
+ */
+ protected void copyFile(String src, String dst, PrintWriter log)
+ throws java.io.IOException {
+ File srcF = new File(src) ;
+ File dstF = new File(dst) ;
+ log.println("H1");
+
+ if (dstF.exists()) dstF.delete() ;
+ log.println("H2");
+ dstF.createNewFile() ;
+
+ dstF.deleteOnExit() ;
+ log.println("H3");
+
+ FileInputStream fIn = new FileInputStream(srcF) ;
+ System.out.println("H4");
+
+ FileOutputStream fOut = new FileOutputStream(dstF) ;
+
+ byte[] buf = new byte[1024] ;
+ int bytesRead = 0 ;
+ while ((bytesRead = fIn.read(buf)) > 0)
+ fOut.write(buf, 0, bytesRead) ;
+
+ fIn.close() ;
+ fOut.close() ;
+ }
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.registry.SimpleRegistry</code>. Then
+ * makes three copies of a predefined registry file with different
+ * names in a temporary SOffice directory and passes their URLs as
+ * relations. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XSimpleRegistry.open'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * <li> <code>'XSimpleRegistry.merge'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * <li> <code>'XSimpleRegistry.destroy'</code> for
+ * {@link ifc.registry._XSimpleRegistry} :
+ * URL of 'XSimpleRegistry.rbd' file copy in the
+ * temp directory. </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ final String tmpDir = utils.getOfficeTempDirSys((XMultiServiceFactory)Param.getMSF()) ;
+ final String openF = "XSimpleRegistry_open.rdb" ;
+ final String destroyF = "XSimpleRegistry_destroy.rdb" ;
+ final String mergeF = "XSimpleRegistry_merge.rdb" ;
+
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.registry.SimpleRegistry" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ if (oInterface == null)
+ log.println("Service wasn't created") ;
+
+ oObj = (XInterface) oInterface;
+
+ log.println("creating copies of the registry for XSimpleRegistry");
+ try {
+ String source = utils.getFullTestDocName("XSimpleRegistry.rdb");
+ copyFile(source, tmpDir + openF, log);
+ copyFile(source, tmpDir + destroyF, log);
+ copyFile(source, tmpDir + mergeF, log);
+ } catch (java.io.IOException e) {
+ log.println("Exception occured while copying files");
+ e.printStackTrace(log);
+ }
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XSimpleRegistry.open", tmpDir + openF);
+ tEnv.addObjRelation("XSimpleRegistry.destroy", tmpDir + destroyF);
+ tEnv.addObjRelation("XSimpleRegistry.merge", tmpDir + mergeF);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SimpleRegistry
+
diff --git a/qadevOOo/tests/java/mod/_simreg/package.html b/qadevOOo/tests/java/mod/_simreg/package.html
new file mode 100644
index 000000000000..09c65912df6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_simreg/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'simreg'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java
new file mode 100644
index 000000000000..9ec1040a110c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessible
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessible
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class SmEditAccessible extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * Creates a <code>StarMath</code> document and obtains an accessibility
+ * component with the role <code>AccessibleRole.PANEL</code>.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.io.IOException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+
+ // setting a formula in document
+ final String expFormula = "sum hat a";
+ final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc);
+ try {
+ xPS.setPropertyValue("Formula", expFormula);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xMathDoc);
+
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PANEL, "", "SmEditAccessible");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("Destroy", new Boolean(true));
+
+ final XAccessibleContext con = (XAccessibleContext) UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ System.out.println("Childs "+con.getAccessibleChildCount());
+ xPS.setPropertyValue("Formula", "sum hat x \n int a \n sum b");
+ shortWait();
+ System.out.println("Childs "+con.getAccessibleChildCount());
+ xPS.setPropertyValue("Formula", expFormula);
+ shortWait();
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Disposes the document created in <code>createTestEnvironment</code>
+ * method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+} // finish class SmModel
diff --git a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java
new file mode 100644
index 000000000000..90e8f6ad3154
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessible
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessible
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class SmGraphicAccessible extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * Creates a <code>StarMath</code> document and obtains an accessibility
+ * component with the role <code>AccessibleRole.PANEL</code>.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.io.IOException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+
+ // setting a formula in document
+ final String expFormula = "sum a cdot b";
+ final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc);
+ try {
+ xPS.setPropertyValue("Formula", expFormula);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ }
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xMathDoc);
+
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.DOCUMENT, "Formula");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ final XAccessibleComponent xAC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ xAC.grabFocus();
+ xPS.setPropertyValue("Formula", "sum hat x");
+ shortWait();
+ xPS.setPropertyValue("Formula", expFormula);
+ shortWait();
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ }
+ }});
+
+ return tEnv;
+ }
+
+ /**
+ * Disposes the document created in <code>createTestEnvironment</code>
+ * method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+} // finish class SmModel
diff --git a/qadevOOo/tests/java/mod/_sm/SmModel.java b/qadevOOo/tests/java/mod/_sm/SmModel.java
new file mode 100644
index 000000000000..6e86243a0fde
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmModel.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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.lang.XMultiServiceFactory;
+
+/**
+ * Test for object which is represented by
+ * <code>'StarMath'</code> document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::formula::FormulaProperties</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.formula.FormulaProperties
+ * @see ifc.formula._FormulaProperties
+ */
+public class SmModel extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates a <code>StarMath</code> document and passes it as
+ * tested component.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.io.IOException ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+
+ String Iname = util.utils.getImplName(xMathDoc);
+ log.println("Implementation Name: "+Iname);
+ TestEnvironment tEnv = new TestEnvironment(xMathDoc);
+ return tEnv;
+ }
+
+ /**
+ * Disposes the document created in <code>createTestEnvironment</code>
+ * method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+
+} // finish class SmModel
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLExporter.java b/qadevOOo/tests/java/mod/_sm/XMLExporter.java
new file mode 100644
index 000000000000..b6f5bcab66d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLExporter.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a math document" );
+ xMathDoc = SOF.createMathDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The math document is set as a source document for exporter
+ * created. A new formula inserted into document. This made
+ * for checking if this formula is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String expFormula = "a - b" ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Math.XMLExporter", new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xMathDoc);
+
+ // setting a formula in document
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc) ;
+ xPS.setPropertyValue("Formula", expFormula) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // checking tags required
+ filter.addTag(new XMLTools.Tag("math:math")) ;
+ filter.addTagEnclosed(new XMLTools.Tag("math:annotation"),
+ new XMLTools.Tag("math:semantics")) ;
+ filter.addCharactersEnclosed(expFormula,
+ new XMLTools.Tag("math:annotation")) ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"smath: StarOffice XML (Math)"}));
+ tEnv.addObjRelation("SourceDocument",xMathDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLImporter.java b/qadevOOo/tests/java/mod/_sm/XMLImporter.java
new file mode 100644
index 000000000000..f598f28f093c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLImporter.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+ XComponent xMathDoc;
+
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLImporter</code><p>
+ *
+ * The chart document is set as a target document for importer.
+ * Imported XML-data contains the tag which specifies a formula
+ * in the document.
+ * After import the formula getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+ final String impFormula = "a - b" ;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance(
+ "com.sun.star.comp.Math.XMLImporter");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("TargetDocument",xMathDoc);
+
+ String[][] xml = new String[][] {
+ {"start", "math:math",
+ "xmlns:math", "CDATA", "http://www.w3.org/1998/Math/MathML"},
+ {"start", "math:semantics"},
+ {"start", "math:annotation",
+ "math:encoding", "CDATA", "StarMath 5.0"},
+ {"chars", impFormula},
+ {"end", "math:annotation"},
+ {"end", "math:semantics"},
+ {"end", "math:math"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+ final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc) ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String gFormula = (String) xPS.getPropertyValue
+ ("Formula") ;
+ logF.println("Formula returned = '" + gFormula + "'") ;
+ return impFormula.equals(gFormula) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
new file mode 100644
index 000000000000..3c721eda6d2b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.document.XDocumentInfo;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLMetaExporter extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a math document" );
+ xMathDoc = SOF.createMathDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The math document is set as a source document for exporter
+ * created. A new user info field inserted into document. This made
+ * for checking if this info field is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String expName = "XMLMetaExporterName" ;
+ final String expValue = "XMLMetaExporterValue" ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Math.XMLMetaExporter", new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xMathDoc);
+
+ // setting a new name and value for user info field
+ XDocumentInfoSupplier xDocInfoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xMathDoc) ;
+ XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
+ xDocInfo.setUserFieldName((short) 0, expName) ;
+ xDocInfo.setUserFieldValue((short) 0, expValue) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // checking tags required
+ filter.addTag(new XMLTools.Tag("office:document-meta")) ;
+ filter.addCharactersEnclosed(expValue,
+ new XMLTools.Tag("meta:user-defined", "meta:name", expName)) ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"smath: StarOffice XML (Math)"}));
+ tEnv.addObjRelation("SourceDocument",xMathDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
new file mode 100644
index 000000000000..2b9b3e8dd8e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfo;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLMetaImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLMetaImporter extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLMetaImporter</code><p>
+ *
+ * The math document is set as a target document for importer.
+ * Imported XML-data contains the tag which specifies new user info
+ * field and a title of document.
+ * After import user fields info and the title of target document
+ * is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+ final String impName = "XMLMetaImporter" ;
+ final String impValue = "XMLMetaImporter_Value" ;
+ final String impTitle = "XMLMetaImporter Title" ;
+
+ final XDocumentInfoSupplier xDocInfoSup ;
+ try {
+ oObj = (XInterface)xMSF.createInstance(
+ "com.sun.star.comp.Math.XMLMetaImporter");
+
+ xDocInfoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xMathDoc) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("TargetDocument",xMathDoc);
+
+ String[][] xml = new String[][] {
+ {"start", "office:document-meta",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:meta", "CDATA", "http://openoffice.org/2000/meta",
+ "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
+ "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"
+ },
+ {"start", "office:meta"},
+ {"start", "dc:title"},
+ {"chars", impTitle},
+ {"end", "dc:title"},
+ {"start", "meta:user-defined",
+ "meta:name", "CDATA", impName},
+ {"chars", impValue},
+ {"end", "meta:user-defined"},
+ {"end", "office:meta"},
+ {"end", "office:document-meta"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
+ XPropertySet xDocInfoProp = (XPropertySet)
+ UnoRuntime.queryInterface
+ (XPropertySet.class, xDocInfo) ;
+ boolean result = false ;
+ for (short i = 0; i < xDocInfo.getUserFieldCount(); i++) {
+ String gName = xDocInfo.getUserFieldName(i) ;
+ String gValue = xDocInfo.getUserFieldValue(i) ;
+ logF.println("Field '" + gName + "' = '"
+ + gValue + "'") ;
+ if (impName.equals(gName) && impValue.equals(gValue))
+ result = true ;
+ }
+ String gTitle = (String) xDocInfoProp.getPropertyValue
+ ("Title");
+ logF.println("Title returned : '" + gTitle + "'");
+ result &= impTitle.equals(gTitle) ;
+
+ return result ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java
new file mode 100644
index 000000000000..9995169a3d37
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLSettingsExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLSettingsExporter extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a math document" );
+ xMathDoc = SOF.createMathDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLSettingsExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The math document is set as a source document for exporter
+ * created. A new value for TopMargin property is set for document.
+ * This made
+ * for checking if this property is successfully exported within
+ * the document settings.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final short expMargin = 67 ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Math.XMLSettingsExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xMathDoc);
+
+ // setting a formula in document
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc) ;
+
+ xPS.setPropertyValue("TopMargin", new Short(expMargin)) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // checking tags required
+
+ filter.addTag(new XMLTools.Tag("office:document-settings")) ;
+ filter.addCharactersEnclosed(String.valueOf(expMargin),
+ new XMLTools.Tag("config:config-item", "config:name", "TopMargin")) ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"smath: StarOffice XML (Math)"}));
+ tEnv.addObjRelation("SourceDocument",xMathDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java
new file mode 100644
index 000000000000..7b4731f13e14
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Math.XMLSettingsImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLSettingsImporter extends TestCase {
+ XComponent xMathDoc;
+
+ /**
+ * New math document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ xMathDoc = SOF.openDoc("smath","_blank");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", ex );
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xMathDoc " );
+ xMathDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Math.XMLSettingsImporter</code><p>
+ *
+ * The math document is set as a target document for importer.
+ * Imported XML-data contains the tag which specifies new
+ * 'TopMargin' property value.
+ * After import 'TopMargin' property value of target document
+ * is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oObj = null;
+ final short impMargin = 67 ;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance(
+ "com.sun.star.comp.Math.XMLSettingsImporter");
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("TargetDocument",xMathDoc);
+
+ String[][] xml = new String[][] {
+ {"start", "office:document-settings",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:config", "CDATA", "http://openoffice.org/2001/config",
+ "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
+ "office:version", "CDATA", "1.0"
+ },
+ {"start", "office:settings"},
+ {"start", "config:config-item-set",
+ "config:name", "CDATA", "configuration-settings"},
+
+ {"start", "config:config-item",
+ "config:name", "CDATA", "TopMargin",
+ "config:type", "CDATA", "short"},
+ {"chars", String.valueOf(impMargin)},
+ {"end", "config:config-item"},
+ {"end", "config:config-item-set"},
+ {"end", "office:settings"},
+ {"end", "office:document-settings"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+ final XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xMathDoc) ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ Short gMargin = (Short) xPS.getPropertyValue
+ ("TopMargin") ;
+ logF.println("Margin returned: " + gMargin);
+ return impMargin == gMargin.shortValue() ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_smgr/OServiceManager.java b/qadevOOo/tests/java/mod/_smgr/OServiceManager.java
new file mode 100644
index 000000000000..062d45db0b24
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_smgr/OServiceManager.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._smgr;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XSet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.stoc.OServiceManager</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XMultiServiceFactory</code></li>
+ * <li> <code>com::sun::star::container::XContentEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::container::XSet</code></li>
+ * <li> <code>com::sun::star::lang::XMultiComponentFactory</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.lang.XMultiServiceFactory
+ * @see com.sun.star.container.XContentEnumerationAccess
+ * @see com.sun.star.container.XSet
+ * @see com.sun.star.lang.XMultiComponentFactory
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.lang._XMultiServiceFactory
+ * @see ifc.container._XContentEnumerationAccess
+ * @see ifc.container._XSet
+ * @see ifc.lang._XMultiComponentFactory
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.lang._XComponent
+ */
+public class OServiceManager extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.stoc.OServiceManager</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'NewElement'</code> for
+ * {@link ifc.container._XSet} :
+ * element to be inserted into manager. Here
+ * a new <code>ServiceManager</code> implementation is
+ * create using
+ * <code>tools.SOConnect.createSimpleServiceManager()</code>
+ * and one of services contained in it is taken.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.stoc.OServiceManager" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("ServiceManager service not available" );
+ }
+
+ // adding a service to the manager
+ Object newElement = null ;
+ XMultiServiceFactory srvMan = null;
+ XComponentContext xContext = null;
+
+ try {
+
+ srvMan = com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();
+
+ } catch ( java.lang.Exception ex) {
+ log.println("Error creating SimpleServiceManager :");
+ ex.printStackTrace(log);
+ }
+
+ try {
+ XSet set = (XSet) UnoRuntime.queryInterface
+ (XSet.class, oInterface) ;
+ XSet set1 = (XSet) UnoRuntime.queryInterface
+ (XSet.class, srvMan) ;
+ XEnumeration oEnum = set1.createEnumeration();
+ Object srv = oEnum.nextElement();
+
+ set.insert(srv) ;
+
+ newElement = oEnum.nextElement();
+
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oInterface);
+ if (xProp != null) {
+ xContext = (XComponentContext) AnyConverter.toObject(
+ new Type(XComponentContext.class),
+ xProp.getPropertyValue("DefaultContext"));
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't insert a service to the ServiceManager") ;
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XSet interface
+ tEnv.addObjRelation("NewElement", newElement) ;
+
+ // adding relation for XPropertySet
+ tEnv.addObjRelation("PTT",new String[]{"DefaultContext","none","none"});
+
+ //adding relation for XMultiComponentFactory
+ if (xContext != null) {
+ tEnv.addObjRelation("DC", xContext);
+ }
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OServiceManager
+
diff --git a/qadevOOo/tests/java/mod/_smgr/package.html b/qadevOOo/tests/java/mod/_smgr/package.html
new file mode 100644
index 000000000000..3875e8d7dd79
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_smgr/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'smgr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java b/qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java
new file mode 100644
index 000000000000..dbd42fbdcb4f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._smplmail;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.system.SimpleSystemMail</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::system::XSimpleMailClientSupplier</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::lang::XTypeProvider</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.system.XSimpleMailClientSupplier
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.lang.XTypeProvider
+ * @see ifc.system._XSimpleMailClientSupplier
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.lang._XTypeProvider
+ */
+public class SimpleSystemMail extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * In case if OS is Win or not specified tries to create an instance
+ * of the service <code>com.sun.star.system.SimpleSystemMail</code>. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'SystemMailExist'</code> for
+ * {@link ifc.system._XSimpleMailClientSupplier} :
+ * the value depends on tested platform and
+ * <code>test.system.mail.isExist</code> INI
+ * parameter.</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ boolean isWinOS = false ;
+ boolean isSystemMailExist = false ;
+
+ // if 'OS' parameter is not defined then by default
+ // Win platform is used. If really not the error will occurs.
+ isWinOS = Param.get("OS") == null ||
+ "wntmsci".equals(Param.get("OS")) ;
+ isSystemMailExist = "true".equalsIgnoreCase
+ ((String) Param.get("test.system.mail.isExist")) ;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ try {
+ if (isWinOS) {
+ log.println("The OS is Win : trying to create service");
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.system.SimpleSystemMail" );
+ } else {
+ log.println("The OS is NOT Win, SKIPPING this component");
+ log.println("Creating Dummy object ...");
+ oInterface = xMSF.createInstance( "com.sun.star.io.Pipe" );
+ }
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("SystemMailExist", new Boolean(isSystemMailExist));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SimpleSystemMail
+
diff --git a/qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java b/qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java
new file mode 100644
index 000000000000..e3af6664183a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._srtrs;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.ucb.SortedDynamicResultSetFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::ucb::XSortedDynamicResultSetFactory</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.ucb.XSortedDynamicResultSetFactory
+ * @see ifc.ucb._XSortedDynamicResultSetFactory
+ */
+public class SortedDynamicResultSetFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.SortedDynamicResultSetFactory</code>.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ oInterface = xMSF.createInstance(
+ "com.sun.star.ucb.SortedDynamicResultSetFactory");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/DataInputStream.java b/qadevOOo/tests/java/mod/_stm/DataInputStream.java
new file mode 100644
index 000000000000..ce2717d787cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/DataInputStream.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XDataOutputStream;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.DataInputStream</code>.
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XDataInputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.DataInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XDataInputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XInputStream
+* @see ifc.io._XDataInputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+*/
+public class DataInputStream extends TestCase {
+
+ /**
+ * Creates a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.io.DataInputStream</code> object,
+ * connects it to <code>com.sun.star.io.DataOutputStream</code>
+ * through <code>com.sun.star.io.Pipe</code>. All of possible data
+ * types are written into <code>DataOutputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XDataInputStream}
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}(another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();;
+ try {
+ oInterface = xMSF.createInstance("com.sun.star.io.DataInputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XInterface oObj = (XInterface) oInterface;
+
+ // creating and connecting DataOutputStream to the
+ // DataInputStream created through the Pipe
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+
+ XInterface oPipe = null;
+ try {
+ oPipe = (XInterface)
+ xMSF.createInstance("com.sun.star.io.Pipe");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XInputStream xPipeInput = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ XOutputStream xPipeOutput = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+
+ XInterface oDataOutput = null;
+ try {
+ oDataOutput = (XInterface)
+ xMSF.createInstance("com.sun.star.io.DataOutputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XDataOutputStream xDataOutput = (XDataOutputStream)
+ UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
+ XActiveDataSource xDataSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
+
+ xDataSource.setOutputStream(xPipeOutput) ;
+ xDataSink.setInputStream(xPipeInput) ;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ // createing a connectable object for XConnectable interface
+ XInterface xConnect = null;
+ try {
+ xConnect = (XInterface)xMSF.createInstance(
+ "com.sun.star.io.DataInputStream") ;
+ } catch (Exception e) {
+ log.println("Can't create DataInputStream");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create DataInputStream", e);
+ }
+
+ // creating an input stream to set in XActiveDataSink
+ XInterface oDataInput = null;
+ try {
+ oDataInput = (XInterface) xMSF.createInstance(
+ "com.sun.star.io.Pipe" );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create new in stream") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create input stream", e) ;
+ }
+
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding sequence of data that must be read
+ // by XDataInputStream interface methods
+ tEnv.addObjRelation("StreamData", data) ;
+ // add a writer
+ tEnv.addObjRelation("StreamWriter", xDataOutput);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ // add an inputStream
+ tEnv.addObjRelation("InputStream", oDataInput);
+ tEnv.addObjRelation("ByteData", byteData);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java
new file mode 100644
index 000000000000..4e7269343cc9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.DataOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XDataOutputStream</code></li>
+* </ul>
+* @see com.sun.star.io.DataOutputStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XDataOutputStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XDataOutputStream
+*/
+public class DataOutputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.io.DataOutputStream</code>
+ * and an instance of the service <code>com.sun.star.io.Pipe</code>.
+ * Plugs the created pipe as output stream for the created DataOutputStream.
+ * @see com.sun.star.io.DataOutputStream
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XInterface oPipe = null;
+ XMultiServiceFactory xMSF = null ;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.io.DataOutputStream");
+ oPipe = (XInterface)xMSF.createInstance("com.sun.star.io.Pipe");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ oObj = (XInterface) oInterface;
+
+ final XOutputStream xPipeOutput = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+
+ XActiveDataSource xDataSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+
+ xDataSource.setOutputStream(xPipeOutput);
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", oPipe);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ final XInputStream xPipeInput = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ xPipeOutput.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.DataInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(xPipeInput);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java
new file mode 100644
index 000000000000..f8f245d87ca0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.MarkableInputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.MarkableInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XInputStream
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+*/
+public class MarkableInputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>.
+ * Plugs the created pipe as output stream for the created
+ * <code>MarkableOutputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>. Writes some data to the
+ * <code>MarkableOutputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}(another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();;
+
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ Object xConnect = null;
+ try {
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance("com.sun.star.io.MarkableOutputStream");
+ xConnect = xMSF.createInstance("com.sun.star.io.DataInputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e) ;
+ }
+
+ // Creating construction :
+ // MarkableOutputStream -> Pipe -> MarkableInputStream
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, aPipe);
+
+ xdSmo.setOutputStream(PipeOut);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+
+ xmSi.setInputStream(PipeIn) ;
+
+ XInterface oObj = (XInterface) mistream;
+
+ byte[] byteData = new byte[] {1,2,3,4,5,6};
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // add a writer
+ tEnv.addObjRelation("StreamWriter", mostream);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ // add an inputStream
+ tEnv.addObjRelation("InputStream", mistream);
+ tEnv.addObjRelation("ByteData", byteData);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java
new file mode 100644
index 000000000000..6b91678c75a7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.MarkableOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* </ul>
+* @see com.sun.star.io.MarkableOutputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XConnectable
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XConnectable
+*/
+public class MarkableOutputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>.
+ * Plugs the created pipe as output stream for the created
+ * <code>MarkableOutputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XOutputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataOutputStream}(the data that should be
+ * written into the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ XInterface aConnect;
+
+ try {
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ aConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataOutputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e) ;
+ }
+
+ // Creating construction :
+ // MarkableOutputStream -> Pipe -> MarkableInputStream
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ final XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class,aPipe);
+
+ xdSmo.setOutputStream(PipeOut);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+
+ xmSi.setInputStream(PipeIn) ;
+
+ oObj = (XInterface) mostream;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", aPipe);
+ tEnv.addObjRelation("Connectable", aConnect);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ PipeOut.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.MarkableInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(PipeIn);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java
new file mode 100644
index 000000000000..59c5e8d5b70e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java
@@ -0,0 +1,299 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XImplementationRegistration;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.ObjectInputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XDataInputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* <li> <code>com::sun::star::io::XObjectInputStream</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> MyPersistObjectImpl.jar </b> : the implementation of the persist
+* object</li>
+* </ul> <p>
+* @see com.sun.star.io.ObjectInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XDataInputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see com.sun.star.io.XObjectInputStream
+* @see ifc.io._XInputStream
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XDataInputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+* @see ifc.io._XObjectInputStream
+*/
+public class ObjectInputStream extends TestCase {
+
+ /**
+ * Register the implementation of service
+ * <code>com.sun.star.cmp.PersistObject</code> if not yet registered.
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public void initialize(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ Object oPersObj = null;
+ // test first if object is already registered
+ try {
+ oPersObj = xMSF.createInstance("com.sun.star.cmp.PersistObject");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Could not create instance of PersistObject");
+ e.printStackTrace(log);
+ log.println("Going on with test...");
+ }
+ if ( oPersObj == null ) {
+ // object is not available: it has to be registered
+ String url = util.utils.getFullTestURL
+ ("qadevlibs/MyPersistObjectImpl.jar");
+ XImplementationRegistration xir;
+ try {
+ Object o = xMSF.createInstance(
+ "com.sun.star.registry.ImplementationRegistration");
+ xir = (XImplementationRegistration)
+ UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
+
+ }
+ catch (com.sun.star.uno.Exception e) {
+ System.err.println(
+ "Couldn't create implementation registration");
+ e.printStackTrace();
+ throw new StatusException("Couldn't create ImplReg", e);
+ }
+
+ XSimpleRegistry xReg = null;
+ try {
+ System.out.println("Register library: " + url);
+ xir.registerImplementation(
+ "com.sun.star.loader.Java2", url, xReg);
+ System.out.println("...done");
+ } catch (CannotRegisterImplementationException e) {
+ System.err.println("Name: " + url + " msg: " +
+ e.getMessage());
+ e.printStackTrace();
+ throw new StatusException(
+ "Couldn't register MyPersistObject", e);
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services
+ * <code>com.sun.star.io.ObjectInputStream</code>,
+ * <code>com.sun.star.io.ObjectOutputStream</code>,
+ * <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>. Plugs the created
+ * markable output stream as output stream for the created
+ * <code>ObjectOutputStream</code>. Plugs the created pipe as output stream
+ * for the created <code>MarkableOutputStream</code>. Plugs the created
+ * markable input stream as input stream for the created
+ * <code>ObjectInputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>. Creates an instance
+ * of the service <code>com.sun.star.cmp.PersistObject</code> and writes
+ * the created object to the object output stream.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PersistObject'</code> for
+ * {@link ifc.io._XObjectInputStream}(the created instance of the
+ * persist object ) </li>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XDataInputStream}
+ * {@link ifc.io._XObjectInputStream}
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ * @see com.sun.star.io.ObjectInputStream
+ * @see com.sun.star.io.ObjectOutputStream
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ System.out.println("create TestEnvironment started.");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object ostream = null;
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ Object istream = null;
+ Object xConnect = null;
+ try {
+ istream = xMSF.createInstance
+ ("com.sun.star.io.ObjectInputStream");
+ ostream = xMSF.createInstance
+ ("com.sun.star.io.ObjectOutputStream");
+ aPipe = xMSF.createInstance
+ ("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ xConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataInputStream") ;
+
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+ // Creating construction :
+ // ObjectOutputStream -> MarkableOutputStream -> Pipe ->
+ // -> MarkableInputStream -> ObjectInputStream
+ XActiveDataSource xdSo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, mostream);
+
+ XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, aPipe);
+
+ xdSo.setOutputStream(moStream);
+ xdSmo.setOutputStream(PipeOut);
+
+ XObjectInputStream iStream = (XObjectInputStream)
+ UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectOutputStream oStream = null;
+ oStream = (XObjectOutputStream)
+ UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XInputStream xmIstream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, mistream);
+
+ XActiveDataSink xdSi = (XActiveDataSink) UnoRuntime.queryInterface
+ (XActiveDataSink.class, istream);
+ xdSi.setInputStream(xmIstream);
+ xmSi.setInputStream(PipeIn);
+
+ // creating Persist object which has to be written
+ XPersistObject xPersObj = null;
+ try {
+ Object oPersObj = xMSF.createInstance
+ ("com.sun.star.cmp.PersistObject");
+ xPersObj = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write persist object.", e);
+ }
+
+
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+
+ System.out.println("create environment");
+ XInterface oObj = iStream;
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding persistent object
+ tEnv.addObjRelation("PersistObject", xPersObj);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ tEnv.addObjRelation("StreamWriter", oStream);
+ // for XActiveDataSink
+ tEnv.addObjRelation("InputStream", aPipe);
+ // adding sequence of data that must be read
+ // by XDataInputStream interface methods
+ tEnv.addObjRelation("StreamData", data) ;
+ // and by XInputStream interface methods
+ tEnv.addObjRelation("ByteData", byteData) ;
+
+ System.out.println("create TestEnvironment finished.");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java
new file mode 100644
index 000000000000..ddefcd878fb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java
@@ -0,0 +1,320 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XImplementationRegistration;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.ObjectOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XDataOutputStream</code></li>
+* <li> <code>com::sun::star::io::XObjectOutputStream</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> MyPersistObjectImpl.jar </b> : the implementation of the persist
+* object</li>
+* </ul> <p>
+* @see com.sun.star.io.ObjectOutputStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XDataOutputStream
+* @see com.sun.star.io.XObjectOutputStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XDataOutputStream
+* @see ifc.io._XObjectOutputStream
+*/
+public class ObjectOutputStream extends TestCase {
+
+ /**
+ * Register the implementation of service
+ * <code>com.sun.star.cmp.PersistObject</code> if not yet registered.
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public void initialize(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ Object oPersObj = null;
+ // test first if object is already registered
+ try {
+ oPersObj = xMSF.createInstance("com.sun.star.cmp.PersistObject");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Could not create instance of PersistObject");
+ e.printStackTrace(log);
+ log.println("Going on with test...");
+ }
+ if ( oPersObj == null ) {
+ // object is not available: it has to be registered
+ String url = util.utils.getFullTestURL
+ ("qadevlibs/MyPersistObjectImpl.jar");
+ XImplementationRegistration xir;
+ try {
+ Object o = xMSF.createInstance(
+ "com.sun.star.registry.ImplementationRegistration");
+ xir = (XImplementationRegistration)
+ UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
+ }
+ catch (com.sun.star.uno.Exception e) {
+ System.err.println(
+ "Couldn't create implementation registration");
+ e.printStackTrace();
+ throw new StatusException("Couldn't create ImplReg", e);
+ }
+
+ XSimpleRegistry xReg = null;
+ try {
+ System.out.println("Register library: " + url);
+ xir.registerImplementation(
+ "com.sun.star.loader.Java2", url, xReg);
+ System.out.println("...done");
+ } catch (CannotRegisterImplementationException e) {
+ System.err.println("Name: " + url + " msg: " +
+ e.getMessage());
+ e.printStackTrace();
+ throw new StatusException(
+ "Couldn't register MyPersistObject", e);
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services
+ * <code>com.sun.star.io.ObjectOutputStream</code>,
+ * <code>com.sun.star.io.Pipe</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>. Plugs the created
+ * markable output stream as output stream for the created
+ * <code>ObjectOutputStream</code>. Plugs the created pipe as output stream
+ * for the created <code>MarkableOutputStream</code>. Creates an instance
+ * of the service <code>com.sun.star.cmp.PersistObject</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataOutputStream}(the data that should
+ * be written into the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XOutputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'PersistObject'</code> for
+ * {@link ifc.io._XObjectOutputStream}(the created instance of the
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XObjectInputStream}(the created instance of the
+ * persist object ) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.ObjectInputStream
+ * @see com.sun.star.io.ObjectOutputStream
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+
+ XObjectOutputStream oStream = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object ostream = null, istream = null;
+ Object aPipe = null;
+ Object mostream = null;
+ XInterface aConnect = null;
+ Object minstream = null;
+
+ try {
+ ostream = xMSF.createInstance
+ ( "com.sun.star.io.ObjectOutputStream" );
+ istream = xMSF.createInstance
+ ("com.sun.star.io.ObjectInputStream");
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ aConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataInputStream");
+ minstream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ // creating the pipe where object has to be written to
+ XActiveDataSource xdSo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, mostream);
+
+ XActiveDataSink markIn = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
+ XActiveDataSink inStream = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, istream);
+ XInputStream markInStream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, minstream);
+
+ final XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class,aPipe);
+
+ markIn.setInputStream(PipeIn);
+ inStream.setInputStream(markInStream);
+ XObjectInputStream objInputStream = (XObjectInputStream)
+ UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ xdSo.setOutputStream(moStream);
+ xdSmo.setOutputStream(PipeOut);
+
+ oStream = (XObjectOutputStream)
+ UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+
+ // creating Persistent object which has to be written
+ XPersistObject xPersObj = null ;
+ try {
+ Object oPersObj = xMSF.createInstance
+ ("com.sun.star.cmp.PersistObject");
+ xPersObj = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write persist object.", e) ;
+ }
+
+ oObj = oStream;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("PersistObject", xPersObj);
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", aPipe);
+ tEnv.addObjRelation("Connectable", aConnect);
+
+ tEnv.addObjRelation("InputStream", objInputStream);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ PipeOut.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.ObjectInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(PipeIn);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/Pipe.java b/qadevOOo/tests/java/mod/_stm/Pipe.java
new file mode 100644
index 000000000000..3dc832a73f7c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/Pipe.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.Pipe</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* </ul>
+* @see com.sun.star.io.Pipe
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XOutputStream
+* @see ifc.io._XInputStream
+* @see ifc.io._XOutputStream
+*/
+public class Pipe extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service <code>com.sun.star.io.Pipe</code>.
+ * Writes some information to the created pipe.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.io.Pipe" );
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ oObj = (XInterface) oInterface;
+
+ // writing some information to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //add relation for io.XOutputStream
+ final XInputStream iStream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oObj);
+
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("StreamWriter", oObj);
+
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream inStream = null;
+ public void resetStreams() {
+ }
+
+ public XInputStream getInStream() {
+ return iStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/Pump.java b/qadevOOo/tests/java/mod/_stm/Pump.java
new file mode 100644
index 000000000000..064932acf625
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/Pump.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.io.NotConnectedException;
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.Pump</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XActiveDataControl</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.Pump
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XActiveDataControl
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XActiveDataControl
+* @see ifc.io._XActiveDataSink
+*/
+public class Pump extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service <code>com.sun.star.io.Pump</code>.
+ * Settings up input and output streams for the created pump.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}(an input stream to set) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}(an output stream to set) </li>
+ * </ul>
+ * @see com.sun.star.io.Pump
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oPipe;
+
+ // creating an instance of stm.Pump
+ try {
+ oInterface = xMSF.createInstance( "com.sun.star.io.Pump" );
+ oPipe = (XInterface) xMSF.createInstance( "com.sun.star.io.Pipe" );
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create the needed objects.", e) ;
+ }
+
+
+ XInterface oObj = (XInterface) oInterface;
+
+ // setting up input and output streams for pump
+ XActiveDataSink xSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSource xSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+
+ XInputStream xInput = new MyInput();
+ XOutputStream xOutput = new MyOutput();
+
+ xSink.setInputStream(xInput);
+ xSource.setOutputStream(xOutput);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // add object relations for ActiveDataSource and XActiveDataSink
+ tEnv.addObjRelation("InputStream", oPipe);
+ tEnv.addObjRelation("OutputStream", oPipe);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * XInputStream implementation to use with the test. It returns bytes of
+ * which a simple string consists.
+ */
+ private static class MyInput implements XInputStream {
+ String str = "Pump tesing string" ;
+
+ public int readBytes(byte[][] bytes, int len)
+ throws NotConnectedException{
+
+ if (str == null)
+ throw new NotConnectedException("Input stream was closed");
+
+ int actual = 0 ;
+ if (len <= str.length()) {
+ String resStr = str.substring(0, len-1) ;
+ bytes[0] = resStr.getBytes() ;
+ actual = len ;
+ str = str.substring(len) ;
+ } else {
+ bytes[0] = str.getBytes() ;
+ actual = str.length() ;
+ }
+
+ return actual;
+ }
+
+ public int readSomeBytes(byte[][] bytes, int len)
+ throws NotConnectedException{
+ return readBytes(bytes, len);
+ }
+
+ public void skipBytes(int len) throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ if (len >= str.length())
+ str = "" ;
+ else
+ str = str.substring(len) ;
+ }
+
+ public void closeInput() throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ str = null ;
+ }
+
+ public int available() throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ return str.length();
+ }
+ }
+
+ /**
+ * Dummy XOutputStream implementation to use with the test. Does nothing.
+ */
+ private static class MyOutput implements XOutputStream {
+ public void writeBytes(byte[] bytes) {
+ }
+
+ public void flush() {
+ }
+
+ public void closeOutput() {
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_stm/package.html b/qadevOOo/tests/java/mod/_stm/package.html
new file mode 100644
index 000000000000..a35afb7a4a5f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'stm'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java
new file mode 100644
index 000000000000..7c69e6a6b461
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XDataOutputStream;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Vector;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.DataInputStream</code>.
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XDataInputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.DataInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XDataInputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XInputStream
+* @see ifc.io._XDataInputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+*/
+public class DataInputStream extends TestCase {
+
+ /**
+ * Creates a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.io.DataInputStream</code> object,
+ * connects it to <code>com.sun.star.io.DataOutputStream</code>
+ * through <code>com.sun.star.io.Pipe</code>. All of possible data
+ * types are written into <code>DataOutputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XDataInputStream}
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}(another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ Object oInterface = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();;
+ try {
+ oInterface = xMSF.createInstance("com.sun.star.io.DataInputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XInterface oObj = (XInterface) oInterface;
+
+ // creating and connecting DataOutputStream to the
+ // DataInputStream created through the Pipe
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+
+ XInterface oPipe = null;
+ try {
+ oPipe = (XInterface)
+ xMSF.createInstance("com.sun.star.io.Pipe");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XInputStream xPipeInput = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ XOutputStream xPipeOutput = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+
+ XInterface oDataOutput = null;
+ try {
+ oDataOutput = (XInterface)
+ xMSF.createInstance("com.sun.star.io.DataOutputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ XDataOutputStream xDataOutput = (XDataOutputStream)
+ UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
+ XActiveDataSource xDataSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
+
+ xDataSource.setOutputStream(xPipeOutput) ;
+ xDataSink.setInputStream(xPipeInput) ;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ // createing a connectable object for XConnectable interface
+ XInterface xConnect = null;
+ try {
+ xConnect = (XInterface)xMSF.createInstance(
+ "com.sun.star.io.DataInputStream") ;
+ } catch (Exception e) {
+ log.println("Can't create DataInputStream");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create DataInputStream", e);
+ }
+
+ // creating an input stream to set in XActiveDataSink
+ XInterface oDataInput = null;
+ try {
+ oDataInput = (XInterface) xMSF.createInstance(
+ "com.sun.star.io.Pipe" );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create new in stream") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create input stream", e) ;
+ }
+
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding sequence of data that must be read
+ // by XDataInputStream interface methods
+ tEnv.addObjRelation("StreamData", data) ;
+ // add a writer
+ tEnv.addObjRelation("StreamWriter", xDataOutput);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ // add an inputStream
+ tEnv.addObjRelation("InputStream", oDataInput);
+ tEnv.addObjRelation("ByteData", byteData);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java
new file mode 100644
index 000000000000..ba2284c587ef
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Vector;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.DataOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XDataOutputStream</code></li>
+* </ul>
+* @see com.sun.star.io.DataOutputStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XDataOutputStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XDataOutputStream
+*/
+public class DataOutputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.io.DataOutputStream</code>
+ * and an instance of the service <code>com.sun.star.io.Pipe</code>.
+ * Plugs the created pipe as output stream for the created DataOutputStream.
+ * @see com.sun.star.io.DataOutputStream
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XInterface oPipe = null;
+ XMultiServiceFactory xMSF = null ;
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.io.DataOutputStream");
+ oPipe = (XInterface)xMSF.createInstance("com.sun.star.io.Pipe");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ oObj = (XInterface) oInterface;
+
+ final XOutputStream xPipeOutput = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+
+ XActiveDataSource xDataSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+
+ xDataSource.setOutputStream(xPipeOutput);
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", oPipe);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ final XInputStream xPipeInput = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ xPipeOutput.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.DataInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(xPipeInput);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java
new file mode 100644
index 000000000000..8365db8f9810
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.MarkableInputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.MarkableInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XInputStream
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+*/
+public class MarkableInputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>.
+ * Plugs the created pipe as output stream for the created
+ * <code>MarkableOutputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>. Writes some data to the
+ * <code>MarkableOutputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}(another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();;
+
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ Object xConnect = null;
+ try {
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance("com.sun.star.io.MarkableOutputStream");
+ xConnect = xMSF.createInstance("com.sun.star.io.DataInputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e) ;
+ }
+
+ // Creating construction :
+ // MarkableOutputStream -> Pipe -> MarkableInputStream
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, aPipe);
+
+ xdSmo.setOutputStream(PipeOut);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+
+ xmSi.setInputStream(PipeIn) ;
+
+ XInterface oObj = (XInterface) mistream;
+
+ byte[] byteData = new byte[] {1,2,3,4,5,6};
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // add a writer
+ tEnv.addObjRelation("StreamWriter", mostream);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ // add an inputStream
+ tEnv.addObjRelation("InputStream", mistream);
+ tEnv.addObjRelation("ByteData", byteData);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
new file mode 100644
index 000000000000..dd61867e0316
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Vector;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.MarkableOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* </ul>
+* @see com.sun.star.io.MarkableOutputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XConnectable
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XConnectable
+*/
+public class MarkableOutputStream extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>.
+ * Plugs the created pipe as output stream for the created
+ * <code>MarkableOutputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XOutputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataOutputStream}(the data that should be
+ * written into the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ XInterface aConnect;
+
+ try {
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ aConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataOutputStream");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e) ;
+ }
+
+ // Creating construction :
+ // MarkableOutputStream -> Pipe -> MarkableInputStream
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ final XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class,aPipe);
+
+ xdSmo.setOutputStream(PipeOut);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+
+ xmSi.setInputStream(PipeIn) ;
+
+ oObj = (XInterface) mostream;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", aPipe);
+ tEnv.addObjRelation("Connectable", aConnect);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ PipeOut.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.MarkableInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(PipeIn);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java
new file mode 100644
index 000000000000..67d251a50b3a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XImplementationRegistration;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Vector;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.ObjectInputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XMarkableStream</code></li>
+* <li> <code>com::sun::star::io::XDataInputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* <li> <code>com::sun::star::io::XObjectInputStream</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> MyPersistObjectImpl.jar </b> : the implementation of the persist
+* object</li>
+* </ul> <p>
+* @see com.sun.star.io.ObjectInputStream
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XMarkableStream
+* @see com.sun.star.io.XDataInputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XActiveDataSink
+* @see com.sun.star.io.XObjectInputStream
+* @see ifc.io._XInputStream
+* @see ifc.io._XMarkableStream
+* @see ifc.io._XDataInputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XActiveDataSink
+* @see ifc.io._XObjectInputStream
+*/
+public class ObjectInputStream extends TestCase {
+
+ /**
+ * Register the implementation of service
+ * <code>com.sun.star.cmp.PersistObject</code> if not yet registered.
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public void initialize(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ Object oPersObj = null;
+ // test first if object is already registered
+ try {
+ oPersObj = xMSF.createInstance("com.sun.star.cmp.PersistObject");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Could not create instance of PersistObject");
+ e.printStackTrace(log);
+ log.println("Going on with test...");
+ }
+ if ( oPersObj == null ) {
+ // object is not available: it has to be registered
+ String url = util.utils.getFullTestURL
+ ("qadevlibs/MyPersistObjectImpl.jar");
+ XImplementationRegistration xir;
+ try {
+ Object o = xMSF.createInstance(
+ "com.sun.star.registry.ImplementationRegistration");
+ xir = (XImplementationRegistration)
+ UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
+
+ }
+ catch (com.sun.star.uno.Exception e) {
+ System.err.println(
+ "Couldn't create implementation registration");
+ e.printStackTrace();
+ throw new StatusException("Couldn't create ImplReg", e);
+ }
+
+ XSimpleRegistry xReg = null;
+ try {
+ System.out.println("Register library: " + url);
+ xir.registerImplementation(
+ "com.sun.star.loader.Java2", url, xReg);
+ System.out.println("...done");
+ } catch (CannotRegisterImplementationException e) {
+ System.err.println("Name: " + url + " msg: " +
+ e.getMessage());
+ e.printStackTrace();
+ throw new StatusException(
+ "Couldn't register MyPersistObject", e);
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services
+ * <code>com.sun.star.io.ObjectInputStream</code>,
+ * <code>com.sun.star.io.ObjectOutputStream</code>,
+ * <code>com.sun.star.io.Pipe</code>,
+ * <code>com.sun.star.io.MarkableInputStream</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>. Plugs the created
+ * markable output stream as output stream for the created
+ * <code>ObjectOutputStream</code>. Plugs the created pipe as output stream
+ * for the created <code>MarkableOutputStream</code>. Plugs the created
+ * markable input stream as input stream for the created
+ * <code>ObjectInputStream</code>. Plugs the created pipe as input stream
+ * for the created <code>MarkableInputStream</code>. Creates an instance
+ * of the service <code>com.sun.star.cmp.PersistObject</code> and writes
+ * the created object to the object output stream.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PersistObject'</code> for
+ * {@link ifc.io._XObjectInputStream}(the created instance of the
+ * persist object ) </li>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XInputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'StreamWriter'</code> for
+ * {@link ifc.io._XDataInputStream}
+ * {@link ifc.io._XObjectInputStream}
+ * {@link ifc.io._XInputStream}(a stream to write data to) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li>
+ * </ul>
+ * @see com.sun.star.io.ObjectInputStream
+ * @see com.sun.star.io.ObjectOutputStream
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ * @see com.sun.star.cmp.PersistObject
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ System.out.println("create TestEnvironment started.");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object ostream = null;
+ Object aPipe = null;
+ Object mostream = null;
+ Object mistream = null;
+ Object istream = null;
+ Object xConnect = null;
+ try {
+ istream = xMSF.createInstance
+ ("com.sun.star.io.ObjectInputStream");
+ ostream = xMSF.createInstance
+ ("com.sun.star.io.ObjectOutputStream");
+ aPipe = xMSF.createInstance
+ ("com.sun.star.io.Pipe");
+ mistream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ xConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataInputStream") ;
+
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+ // Creating construction :
+ // ObjectOutputStream -> MarkableOutputStream -> Pipe ->
+ // -> MarkableInputStream -> ObjectInputStream
+ XActiveDataSource xdSo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, mostream);
+
+ XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, aPipe);
+
+ xdSo.setOutputStream(moStream);
+ xdSmo.setOutputStream(PipeOut);
+
+ XObjectInputStream iStream = (XObjectInputStream)
+ UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectOutputStream oStream = null;
+ oStream = (XObjectOutputStream)
+ UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+
+ XActiveDataSink xmSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XInputStream xmIstream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, mistream);
+
+ XActiveDataSink xdSi = (XActiveDataSink) UnoRuntime.queryInterface
+ (XActiveDataSink.class, istream);
+ xdSi.setInputStream(xmIstream);
+ xmSi.setInputStream(PipeIn);
+
+ // creating Persist object which has to be written
+ XPersistObject xPersObj = null;
+ try {
+ Object oPersObj = xMSF.createInstance
+ ("com.sun.star.cmp.PersistObject");
+ xPersObj = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write persist object.", e);
+ }
+
+
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+
+ System.out.println("create environment");
+ XInterface oObj = iStream;
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding persistent object
+ tEnv.addObjRelation("PersistObject", xPersObj);
+ // add a connectable
+ tEnv.addObjRelation("Connectable", xConnect);
+ tEnv.addObjRelation("StreamWriter", oStream);
+ // for XActiveDataSink
+ tEnv.addObjRelation("InputStream", aPipe);
+ // adding sequence of data that must be read
+ // by XDataInputStream interface methods
+ tEnv.addObjRelation("StreamData", data) ;
+ // and by XInputStream interface methods
+ tEnv.addObjRelation("ByteData", byteData) ;
+
+ System.out.println("create TestEnvironment finished.");
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java
new file mode 100644
index 000000000000..97ee8193c792
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java
@@ -0,0 +1,317 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XImplementationRegistration;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Vector;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.ObjectOutputStream</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* <li> <code>com::sun::star::io::XConnectable</code></li>
+* <li> <code>com::sun::star::io::XDataOutputStream</code></li>
+* <li> <code>com::sun::star::io::XObjectOutputStream</code></li>
+* </ul>
+* The following files used by this test :
+* <ul>
+* <li><b> MyPersistObjectImpl.jar </b> : the implementation of the persist
+* object</li>
+* </ul> <p>
+* @see com.sun.star.io.ObjectOutputStream
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+* @see com.sun.star.io.XConnectable
+* @see com.sun.star.io.XDataOutputStream
+* @see com.sun.star.io.XObjectOutputStream
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XOutputStream
+* @see ifc.io._XConnectable
+* @see ifc.io._XDataOutputStream
+* @see ifc.io._XObjectOutputStream
+*/
+public class ObjectOutputStream extends TestCase {
+
+ /**
+ * Register the implementation of service
+ * <code>com.sun.star.cmp.PersistObject</code> if not yet registered.
+ * @see com.sun.star.cmp.PersistObject
+ */
+ public void initialize(TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ Object oPersObj = null;
+ // test first if object is already registered
+ try {
+ oPersObj = xMSF.createInstance("com.sun.star.cmp.PersistObject");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Could not create instance of PersistObject");
+ e.printStackTrace(log);
+ log.println("Going on with test...");
+ }
+ if ( oPersObj == null ) {
+ // object is not available: it has to be registered
+ String url = util.utils.getFullTestURL
+ ("qadevlibs/MyPersistObjectImpl.jar");
+ XImplementationRegistration xir;
+ try {
+ Object o = xMSF.createInstance(
+ "com.sun.star.registry.ImplementationRegistration");
+ xir = (XImplementationRegistration)
+ UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
+ }
+ catch (com.sun.star.uno.Exception e) {
+ System.err.println(
+ "Couldn't create implementation registration");
+ e.printStackTrace();
+ throw new StatusException("Couldn't create ImplReg", e);
+ }
+
+ XSimpleRegistry xReg = null;
+ try {
+ System.out.println("Register library: " + url);
+ xir.registerImplementation(
+ "com.sun.star.loader.Java2", url, xReg);
+ System.out.println("...done");
+ } catch (CannotRegisterImplementationException e) {
+ System.err.println("Name: " + url + " msg: " +
+ e.getMessage());
+ e.printStackTrace();
+ throw new StatusException(
+ "Couldn't register MyPersistObject", e);
+ }
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of services
+ * <code>com.sun.star.io.ObjectOutputStream</code>,
+ * <code>com.sun.star.io.Pipe</code> and
+ * <code>com.sun.star.io.MarkableOutputStream</code>. Plugs the created
+ * markable output stream as output stream for the created
+ * <code>ObjectOutputStream</code>. Plugs the created pipe as output stream
+ * for the created <code>MarkableOutputStream</code>. Creates an instance
+ * of the service <code>com.sun.star.cmp.PersistObject</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'StreamData'</code> for
+ * {@link ifc.io._XDataOutputStream}(the data that should
+ * be written into the stream) </li>
+ * <li> <code>'ByteData'</code> for
+ * {@link ifc.io._XOutputStream}(the data that should be written into
+ * the stream) </li>
+ * <li> <code>'Connectable'</code> for
+ * {@link ifc.io._XConnectable}
+ * (another object that can be connected) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}
+ * (an input stream to set and get) </li>
+ * <li> <code>'PersistObject'</code> for
+ * {@link ifc.io._XObjectOutputStream}(the created instance of the
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XObjectInputStream}(the created instance of the
+ * persist object ) </li>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.ObjectInputStream
+ * @see com.sun.star.io.ObjectOutputStream
+ * @see com.sun.star.io.Pipe
+ * @see com.sun.star.io.MarkableInputStream
+ * @see com.sun.star.io.MarkableOutputStream
+ * @see com.sun.star.cmp.PersistObject
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XObjectOutputStream oStream = null;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ Object ostream = null, istream = null;
+ Object aPipe = null;
+ Object mostream = null;
+ XInterface aConnect = null;
+ Object minstream = null;
+
+ try {
+ ostream = xMSF.createInstance
+ ( "com.sun.star.io.ObjectOutputStream" );
+ istream = xMSF.createInstance
+ ("com.sun.star.io.ObjectInputStream");
+ aPipe = xMSF.createInstance("com.sun.star.io.Pipe");
+ mostream = xMSF.createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+ aConnect = (XInterface)xMSF.createInstance
+ ("com.sun.star.io.DataInputStream");
+ minstream = xMSF.createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ // creating the pipe where object has to be written to
+ XActiveDataSource xdSo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XOutputStream moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, mostream);
+
+ XActiveDataSink markIn = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
+ XActiveDataSink inStream = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, istream);
+ XInputStream markInStream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, minstream);
+
+ final XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class,aPipe);
+
+ markIn.setInputStream(PipeIn);
+ inStream.setInputStream(markInStream);
+ XObjectInputStream objInputStream = (XObjectInputStream)
+ UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ xdSo.setOutputStream(moStream);
+ xdSmo.setOutputStream(PipeOut);
+
+ oStream = (XObjectOutputStream)
+ UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+
+ // creating Persistent object which has to be written
+ XPersistObject xPersObj = null ;
+ try {
+ Object oPersObj = xMSF.createInstance
+ ("com.sun.star.cmp.PersistObject");
+ xPersObj = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write persist object.", e) ;
+ }
+
+ oObj = oStream;
+
+ // all data types for writing to an XDataInputStream
+ Vector data = new Vector() ;
+ data.add(new Boolean(true)) ;
+ data.add(new Byte((byte)123)) ;
+ data.add(new Character((char)1234)) ;
+ data.add(new Short((short)1234)) ;
+ data.add(new Integer(123456)) ;
+ data.add(new Float(1.234)) ;
+ data.add(new Double(1.23456)) ;
+ data.add("DataInputStream") ;
+ // information for writing to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("PersistObject", xPersObj);
+ tEnv.addObjRelation("StreamData", data);
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("OutputStream", aPipe);
+ tEnv.addObjRelation("Connectable", aConnect);
+
+ tEnv.addObjRelation("InputStream", objInputStream);
+
+ //add relation for io.XOutputStream
+ final XMultiServiceFactory msf = xMSF;
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ XInputStream xInStream = null;
+ public void resetStreams() {
+ if (xInStream != null) {
+ try {
+ xInStream.closeInput();
+ xInStream = null;
+ } catch(com.sun.star.io.IOException e) {
+ }
+ } else {
+ try {
+ PipeOut.closeOutput();
+ } catch(com.sun.star.io.IOException e) {
+ }
+ }
+ }
+
+ public XInputStream getInStream() {
+ resetStreams();
+ try {
+ Object oInStream = msf.createInstance(
+ "com.sun.star.io.ObjectInputStream");
+ xInStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oInStream);
+ } catch(com.sun.star.uno.Exception e) {
+ return null;
+ }
+
+ XActiveDataSink xDataSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
+ xDataSink.setInputStream(PipeIn);
+
+ return xInStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/Pipe.java b/qadevOOo/tests/java/mod/_streams.uno/Pipe.java
new file mode 100644
index 000000000000..482cd7bda3dc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/Pipe.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.Pipe</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XInputStream</code></li>
+* <li> <code>com::sun::star::io::XOutputStream</code></li>
+* </ul>
+* @see com.sun.star.io.Pipe
+* @see com.sun.star.io.XInputStream
+* @see com.sun.star.io.XOutputStream
+* @see ifc.io._XInputStream
+* @see ifc.io._XOutputStream
+*/
+public class Pipe extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service <code>com.sun.star.io.Pipe</code>.
+ * Writes some information to the created pipe.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XOutputStream.StreamChecker'</code> for
+ * {@link ifc.io._XOutputStream}( implementation of the interface
+ * ifc.io._XOutputStream.StreamChecker ) </li>
+ * </ul>
+ * @see com.sun.star.io.Pipe
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.io.Pipe" );
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ oObj = (XInterface) oInterface;
+
+ // writing some information to the pipe
+ byte[] byteData = new byte[] {
+ 1, 2, 3, 4, 5, 6, 7, 8 } ;
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //add relation for io.XOutputStream
+ final XInputStream iStream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, oObj);
+
+ tEnv.addObjRelation("ByteData", byteData);
+ tEnv.addObjRelation("StreamWriter", oObj);
+
+ tEnv.addObjRelation("XOutputStream.StreamChecker",
+ new ifc.io._XOutputStream.StreamChecker() {
+ public void resetStreams() {
+ }
+
+ public XInputStream getInStream() {
+ return iStream;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/Pump.java b/qadevOOo/tests/java/mod/_streams.uno/Pump.java
new file mode 100644
index 000000000000..5e262d470d06
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/Pump.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._streams.uno;
+
+import com.sun.star.io.NotConnectedException;
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.io.Pump</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::io::XActiveDataSource</code></li>
+* <li> <code>com::sun::star::io::XActiveDataControl</code></li>
+* <li> <code>com::sun::star::io::XActiveDataSink</code></li>
+* </ul>
+* @see com.sun.star.io.Pump
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XActiveDataControl
+* @see com.sun.star.io.XActiveDataSink
+* @see ifc.io._XActiveDataSource
+* @see ifc.io._XActiveDataControl
+* @see ifc.io._XActiveDataSink
+*/
+public class Pump extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service <code>com.sun.star.io.Pump</code>.
+ * Settings up input and output streams for the created pump.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'InputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}(an input stream to set) </li>
+ * <li> <code>'OutputStream'</code> for
+ * {@link ifc.io._XActiveDataSource}(an output stream to set) </li>
+ * </ul>
+ * @see com.sun.star.io.Pump
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XInterface oPipe;
+
+ // creating an instance of stm.Pump
+ try {
+ oInterface = xMSF.createInstance( "com.sun.star.io.Pump" );
+ oPipe = (XInterface) xMSF.createInstance( "com.sun.star.io.Pipe" );
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create the needed objects.", e) ;
+ }
+
+
+ XInterface oObj = (XInterface) oInterface;
+
+ // setting up input and output streams for pump
+ XActiveDataSink xSink = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSource xSource = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+
+ XInputStream xInput = new MyInput();
+ XOutputStream xOutput = new MyOutput();
+
+ xSink.setInputStream(xInput);
+ xSource.setOutputStream(xOutput);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // add object relations for ActiveDataSource and XActiveDataSink
+ tEnv.addObjRelation("InputStream", oPipe);
+ tEnv.addObjRelation("OutputStream", oPipe);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * XInputStream implementation to use with the test. It returns bytes of
+ * which a simple string consists.
+ */
+ private static class MyInput implements XInputStream {
+ String str = "Pump tesing string" ;
+
+ public int readBytes(byte[][] bytes, int len)
+ throws NotConnectedException{
+
+ if (str == null)
+ throw new NotConnectedException("Input stream was closed");
+
+ int actual = 0 ;
+ if (len <= str.length()) {
+ String resStr = str.substring(0, len-1) ;
+ bytes[0] = resStr.getBytes() ;
+ actual = len ;
+ str = str.substring(len) ;
+ } else {
+ bytes[0] = str.getBytes() ;
+ actual = str.length() ;
+ }
+
+ return actual;
+ }
+
+ public int readSomeBytes(byte[][] bytes, int len)
+ throws NotConnectedException{
+ return readBytes(bytes, len);
+ }
+
+ public void skipBytes(int len) throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ if (len >= str.length())
+ str = "" ;
+ else
+ str = str.substring(len) ;
+ }
+
+ public void closeInput() throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ str = null ;
+ }
+
+ public int available() throws NotConnectedException {
+ if (str == null)
+ throw new NotConnectedException("Stream was closed.") ;
+
+ return str.length();
+ }
+ }
+
+ /**
+ * Dummy XOutputStream implementation to use with the test. Does nothing.
+ */
+ private static class MyOutput implements XOutputStream {
+ public void writeBytes(byte[] bytes) {
+ }
+
+ public void flush() {
+ }
+
+ public void closeOutput() {
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_streams.uno/package.html b/qadevOOo/tests/java/mod/_streams.uno/package.html
new file mode 100644
index 000000000000..a35afb7a4a5f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_streams.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'stm'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java
new file mode 100644
index 000000000000..f21ac75daaca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.view.XSelectionSupplier;
+
+public class AccessibleBrowseBox extends TestCase {
+
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code> with an
+ * object to test and related objects. Subclasses should implement this
+ * method to provide the implementation and related objects. The method is
+ * called from <code>getTestEnvironment()</code>.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose(); // get a soffice factory object
+ }
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class,
+ secondController);
+
+ XDispatch getting = null;
+
+ log.println("opening DatasourceBrowser");
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = null;
+
+ final XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, the_frame2.getController());
+
+ PropertyValue[] params = new PropertyValue[]{new PropertyValue(), new PropertyValue(), new PropertyValue()};
+ params[0].Name = "DataSourceName";
+ params[0].Value = "Bibliography";
+ params[1].Name = "CommandType";
+ params[1].Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[2].Name = "Command";
+ params[2].Value = "biblio";
+
+ final PropertyValue[] fParams = params;
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "", "AccessibleBrowseBox");
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+
+ public void fireEvent() {
+ try {
+ xSelect.select(fParams);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java
new file mode 100644
index 000000000000..e7efa1769be2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import com.sun.star.view.XSelectionSupplier;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxHeaderBar extends TestCase {
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser.
+ * Creates an instance of the service <code>com.sun.star.awt.Toolkit</code>
+ * and gets active top window. Then obtains an accessible object with
+ * the role <code>AccessibleRole.TABLE</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XDispatch getting = null;
+
+ log.println("opening DatasourceBrowser");
+
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+
+ //am controller ein XSelectionSupplier->mit params rufen
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ PropertyValue[] params = new PropertyValue[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XController xCont = the_frame2.getController();
+
+ XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, xCont);
+
+ try {
+ xSelect.select(params);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ throw new StatusException("Could not select Biblio-Database", ex);
+ }
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ shortWait();
+
+ XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final Point point = accComp.getLocationOnScreen();
+
+ shortWait();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Robot rob = new Robot();
+ rob.mouseMove(point.X + 5, point.Y + 5);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ System.out.println("couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java
new file mode 100644
index 000000000000..a59cf21fd863
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java
@@ -0,0 +1,240 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import com.sun.star.view.XSelectionSupplier;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxHeaderCell extends TestCase {
+
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser and loads
+ * the table. Creates an instance of the service
+ * <code>com.sun.star.awt.Toolkit</code> and gets active top window.
+ * Then obtains an accessible object with the role
+ * <code>AccessibleRole.UNKNOWN</code> and with the name
+ * <code>"Identifier"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * method <code>fireEvent()</code> is empty because object is transient
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.
+ queryInterface(XDispatchProvider.class, secondController);
+
+ XDispatch getting = null;
+
+ log.println( "opening DatasourceBrowser" );
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = null;
+
+ final XInitialization xInit = (XInitialization)
+ UnoRuntime.queryInterface(
+ XInitialization.class, the_frame2.getController());
+
+ PropertyValue[] params = new PropertyValue[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ XController xCont = the_frame2.getController();
+
+ XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, xCont);
+
+ try {
+ xSelect.select(params);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ throw new StatusException("Could not select Biblio-Database", ex);
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.ROW_HEADER);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000); ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java
new file mode 100644
index 000000000000..8ee05967bd5d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import com.sun.star.view.XSelectionSupplier;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxTable extends TestCase {
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory)Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.Toolkit</code> and gets active top window.
+ * Then obtains an accessible object with the role
+ * <code>AccessibleRole.TABLE</code> and with the name
+ * <code>"Table"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * method <code>fireEvent()</code> is empty because object is transient
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XDispatch getting = null;
+
+ log.println("opening DatasourceBrowser");
+
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+ XController xCont = the_frame2.getController();
+
+ the_frame2.setName("DatasourceBrowser");
+
+ final PropertyValue[] params = new PropertyValue[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ final XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, xCont);
+
+
+ final Object[] initArgs = params;
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE,
+ "Table");
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ xSelect.select(params);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java
new file mode 100644
index 000000000000..549ef0a91b9b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxTableCell extends TestCase {
+
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()) );
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser and loads
+ * the table. Creates an instance of the service
+ * <code>com.sun.star.awt.Toolkit</code> and gets active top window.
+ * Then obtains an accessible object with the role
+ * <code>AccessibleRole.TABLE_CELL</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * method <code>fireEvent()</code> is empty because object is transient
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+
+ XDispatchProvider aProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class,secondController);
+
+ XDispatch getting = null;
+
+ log.println( "opening DatasourceBrowser" );
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url,"_beamer",12);
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url,noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer",4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = null;
+
+ final XInitialization xInit = (XInitialization)
+ UnoRuntime.queryInterface(
+ XInitialization.class, the_frame2.getController());
+
+ Object[] params = new Object[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000); ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java
new file mode 100644
index 000000000000..09a5824c2a6d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java
@@ -0,0 +1,287 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ */
+public class AccessibleIconChoiceCtrl extends TestCase {
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+ static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes the Hyperlink dialog.
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("closing HyperlinkDialog");
+
+ try {
+ if (accCloseButton != null) {
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the Hyperlink dialog.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.Toolkit</code> and gets active top window.
+ * Then obtains an accessible object with the role
+ * <code>AccessibleRole.TREE</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * method <code>fireEvent()</code> selects accessible childs
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ( (XMultiServiceFactory) tParam.getMSF())
+ .createInstance("com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ( (XMultiServiceFactory) tParam.getMSF())
+ .createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(true));
+
+ String[] expectedStateNames = new String[] {
+ "com.sun.star.accessibility.AccessibleStateType.ENABLED",
+ "com.sun.star.accessibility.AccessibleStateType.FOCUSABLE",
+ "com.sun.star.accessibility.AccessibleStateType.SHOWING",
+ "com.sun.star.accessibility.AccessibleStateType.VISIBLE",
+ "com.sun.star.accessibility.AccessibleStateType.MANAGES_DESCENDANTS",
+ };
+
+ short[] expectedStates = new short[] {
+ com.sun.star.accessibility.AccessibleStateType.ENABLED,
+ com.sun.star.accessibility.AccessibleStateType.FOCUSABLE,
+ com.sun.star.accessibility.AccessibleStateType.SHOWING,
+ com.sun.star.accessibility.AccessibleStateType.VISIBLE,
+ com.sun.star.accessibility.AccessibleStateType.MANAGES_DESCENDANTS,
+ };
+
+ tEnv.addObjRelation("expectedStateNames", expectedStateNames);
+ tEnv.addObjRelation("expectedStates", expectedStates);
+
+ final XAccessibleSelection selection = (XAccessibleSelection) (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ selection.selectAccessibleChild(1);
+ selection.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java
new file mode 100644
index 000000000000..c27c9eb7209f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleText
+ */
+public class AccessibleIconChoiceCtrlEntry extends TestCase {
+
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+ static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()));
+ }
+
+ /**
+ * Closes the Hyperlink dialog.
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("closing HyperlinkDialog");
+
+ try {
+ if (accCloseButton != null) {
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the Hyperlink dialog.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.Toolkit</code> and gets active top window.
+ * Then obtains an accessible object with the role
+ * <code>AccessibleRole.LABEL</code> and with the name
+ * <code>"Internet"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * method <code>fireEvent()</code> is empty because object is transient
+ * </li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}:
+ * the string representation of the item text
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.
+ queryInterface(XDispatchProvider.class, secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface)((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer)UnoRuntime.queryInterface
+ (XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e );
+ }
+
+ XDispatch getting = null;
+ log.println( "opening HyperlinkDialog" );
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.LABEL, "Internet");
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON, "Close");
+
+ accCloseButton = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Internet");
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+ tEnv.addObjRelation("LimitedBounds",
+ "only delivers senseful values for getCharacterBounds(0,length-1)");
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000); ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java
new file mode 100644
index 000000000000..a6a95185967d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+public class AccessibleTabBar extends TestCase {
+ static XComponent xDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xCalcDoc");
+
+ if (xDoc != null) {
+ closeDoc(xDoc);
+ }
+ }
+
+ /**
+ * Creates a spreadsheet document. Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETAB</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xDoc != null) {
+ closeDoc(xDoc);
+ }
+
+ XMultiServiceFactory msf = (XMultiServiceFactory) tParam.getMSF();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+
+ try {
+ log.println("creating a calc document");
+ xDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ SOF.createCalcDoc(
+ null));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XWindow aWin = xWindow;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ aWin.setPosSize(100,100, 500, 500, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 3 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ protected void closeDoc(XComponent xDoc) {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDoc);
+
+ try {
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ } catch (java.lang.NullPointerException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java
new file mode 100644
index 000000000000..791c27189f2e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleTabBarPage extends TestCase {
+
+ static XComponent xDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xCalcDoc");
+ if (xDoc != null) {
+ util.DesktopTools.closeDoc(xDoc);
+ }
+ }
+
+ /**
+ * Creates a spreadsheet document. Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETAB</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ if (xDoc != null) xDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a calc document" );
+ xDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null));// SOF.createDrawDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class, oObj);
+
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Sheet1");
+ XAccessibleContext acc = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Sheet2");
+ XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ acc);
+ final Point point = accComp.getLocationOnScreen();
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("Destroy","yes");
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ Robot rob = new Robot();
+ rob.mouseMove(point.X + 25, point.Y + 5);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ System.out.println("couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java
new file mode 100644
index 000000000000..6f66b0c9f66a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XLayerSupplier;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li>
+ * <code>::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleTabBarPageList extends TestCase {
+ static XComponent xDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xDoc");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a spreadsheet document. Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETABLIST</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a draw document");
+ xDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ( (XMultiServiceFactory) tParam.getMSF())
+ .createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGE_TAB_LIST);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(true));
+
+ XLayerSupplier oLS = (XLayerSupplier)
+ UnoRuntime.queryInterface(XLayerSupplier.class, xDoc);
+ XInterface oLM = oLS.getLayerManager();
+ final XLayerManager xLM = (XLayerManager) UnoRuntime.queryInterface(XLayerManager.class, oLM);
+
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xLM.insertNewByIndex(0);
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ protected void closeDoc() {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xDoc);
+
+ try {
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java
new file mode 100644
index 000000000000..e393b2c57a2c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java
@@ -0,0 +1,249 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ */
+public class AccessibleTreeListBox extends TestCase {
+
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser.
+ * Creates an instance of the service <code>com.sun.star.awt.Toolkit</code>
+ * and gets active top window. Then obtains an accessible object with
+ * the role <code>AccessibleRole.TREE</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * <li> <code>'XAccessibleSelection.multiSelection'</code>
+ * of type <code>Boolean</code> for
+ * {@link ifc.accessibility._XAccessibleSelection}:
+ * indicates that component supports single selection mode.</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.
+ queryInterface(XDispatchProvider.class, secondController);
+
+ XDispatch getting = null;
+
+ log.println( "opening DatasourceBrowser" );
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XInitialization xInit = (XInitialization)
+ UnoRuntime.queryInterface(
+ XInitialization.class, the_frame2.getController());
+
+ Object[] params = new Object[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.TABLE);
+ params[1] = param2;
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "biblio";
+ params[2] = param3;
+
+ final Object[] fParams = params;
+
+// tEnv.addObjRelation("EventProducer",
+// new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+// public void fireEvent() {
+// fXComp.grabFocus();
+// }
+// });
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ xInit.initialize(fParams);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java
new file mode 100644
index 000000000000..47554e907752
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svtools;
+
+import com.sun.star.view.XSelectionSupplier;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XCloseable;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleAction
+ * </code></li>
+ * <li><code>::com::sun::star::accessibility::XAccessibleText
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleTreeListBoxEntry extends TestCase {
+ static XDesktop the_Desk;
+ static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document. Opens the DataSource browser.
+ * Creates an instance of the service <code>com.sun.star.awt.Toolkit</code>
+ * and gets active top window. Then obtains an accessible object with
+ * the role <code>AccessibleRole.LABEL</code> and with the name
+ * <code>"Bibliography"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * </li>
+ * <li> <code>'XAccessibleSelection.multiSelection'</code>
+ * of type <code>Boolean</code> for
+ * {@link ifc.accessibility._XAccessibleSelection}:
+ * indicates that component supports single selection mode.</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}:
+ * the text of the component</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XDispatch getting = null;
+
+ log.println("opening DatasourceBrowser");
+
+ URL the_url = new URL();
+ the_url.Complete = ".component:DB/DataSourceBrowser";
+ getting = aProv.queryDispatch(the_url, "_beamer", 12);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(the_url, noArgs);
+
+ shortWait();
+
+ XFrame the_frame1 = the_Desk.getCurrentFrame();
+
+ if (the_frame1 == null) {
+ log.println("Current frame was not found !!!");
+ }
+
+ XFrame the_frame2 = the_frame1.findFrame("_beamer", 4);
+
+ the_frame2.setName("DatasourceBrowser");
+
+ XInterface oObj = null;
+
+ XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(
+ XInitialization.class,
+ the_frame2.getController());
+
+ PropertyValue[] params = new PropertyValue[3];
+ PropertyValue param1 = new PropertyValue();
+ param1.Name = "DataSourceName";
+ param1.Value = "Bibliography";
+ params[0] = param1;
+
+ PropertyValue param2 = new PropertyValue();
+ param2.Name = "CommandType";
+ param2.Value = new Integer(com.sun.star.sdb.CommandType.QUERY);
+ params[1] = param2;
+
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "Command";
+ param3.Value = "select * from biblio";
+ params[2] = param3;
+
+ XController xCont = the_frame2.getController();
+
+ XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, xCont);
+
+ try {
+ xSelect.select(params);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ throw new StatusException("Could not select Biblio-Database", ex);
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = secondController.getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.LABEL,
+ "Bibliography");
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ //adding ObjectRelation for XAccessibleText
+ tEnv.addObjRelation("LimitedBounds", "true");
+
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Bibliography");
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ protected void closeDoc() {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+
+ try {
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close document " + e.getMessage());
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
new file mode 100644
index 000000000000..90878c5a0c03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleControlShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+
+ final XShape oShape = FormTools.insertControlShape
+ (xDrawDoc,3000,4500,15000,1000,"CommandButton");
+
+ AccessibilityTools at = new AccessibilityTools();
+ utils.shortWait(5000);
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+// "Button");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "Button");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java
new file mode 100644
index 000000000000..911d057de8c8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class AccessibleEditableTextPara extends TestCase {
+
+ static XComponent xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Obtains accissible object for the spreadsheet document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext InputLine = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME,"Input line");
+ try {
+ oObj = InputLine.getAccessibleChild(0);
+ XAccessibleEditableText et = (XAccessibleEditableText) UnoRuntime.queryInterface(XAccessibleEditableText.class, oObj);
+ et.setText("AccessibleEditablePara");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+
+ }
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleEditableText edText = (XAccessibleEditableText)
+ UnoRuntime.queryInterface(XAccessibleEditableText.class,oObj) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ int l = new String("AccessibleEditablePara").length();
+ edText.deleteText(0, l);
+ edText.setText("Event");
+ edText.setText("AccessibleEditablePara");
+ }catch(com.sun.star.lang.IndexOutOfBoundsException e) {}
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ util.DesktopTools.closeDoc(xSpreadsheetDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null));
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
new file mode 100644
index 000000000000..54126337db9c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleGraphicShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,5000,1500,1000,"GraphicObject");
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "GraphicObject");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "GraphicObject");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java
new file mode 100644
index 000000000000..bf82b3012b51
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleOLEShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape
+ (xDrawDoc,5000,5000,1500,1000,"OLE2");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shape_props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+
+ log.println("Inserting a Chart");
+
+ try {
+ shape_props.
+ setPropertyValue("CLSID","12DCAE26-281F-416F-a234-c3086127382e");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "OLEShape");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "OLEShape");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java
new file mode 100644
index 000000000000..37b4a8dc2599
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePageShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ //XShape oShape = null;
+ XDrawPage oPage = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+// "PageShape");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "PageShape");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //at.getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLLBAR);
+ //final XAccessibleValue xAccVal = (XAccessibleValue)
+ // UnoRuntime.queryInterface
+ // (XAccessibleValue.class, at.SearchedContext) ;
+ oPage = DrawTools.getDrawPage(xDrawDoc,0);
+ final XPropertySet PageProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oPage);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ PageProps.setPropertyValue("Height",new Integer(5000));
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ System.out.println("Don't no the Property Height");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ System.out.println(
+ "PropertyVetoException Exception while changing Height");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ System.out.println(
+ "IllegalArgumentException Exception while changing Height");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ System.out.println(
+ "WrappedTargetException Exception while changing Height");
+ }
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java
new file mode 100644
index 000000000000..fd742e4f9441
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationGraphicShape extends TestCase {
+
+ static XComponent xDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance
+ ("com.sun.star.presentation.GraphicObjectShape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("space-metal.jpg"));
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ //DrawTools.getShapes(DrawTools.getDrawPage(xDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "GraphicObject");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "GraphicObject");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java
new file mode 100644
index 000000000000..3e77577213ef
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationOLEShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance("com.sun.star.presentation.OLE2Shape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+
+ //DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ try {
+ oShapeProps.setPropertyValue(
+ "CLSID","12DCAE26-281F-416F-a234-c3086127382e");
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "ImpressOLE");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "ImpressOLE");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java
new file mode 100644
index 000000000000..7dd6b8fd703b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance
+ ("com.sun.star.presentation.HandoutShape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oShape);
+
+ try {
+ shapeProps.setPropertyValue(
+ "IsEmptyPresentationObject", new Boolean(false));
+ } catch (Exception e) {}
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "ImpressHandout");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "ImpressHandout");
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java
new file mode 100644
index 000000000000..c62ba90f1155
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 3000,4500,15000,1000,"Rectangle");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "Rectangle");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "Rectangle");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java
new file mode 100644
index 000000000000..a2fc8eb611c0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.GraphicExportFilter</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::document::XFilter</code></li>
+ * <li> <code>com::sun::star::document::XMimeTypeInfo</code></li>
+ * <li> <code>com::sun::star::document::XExporter</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> space-metal.jpg </b> : the file used for GraphicObject
+ * creation. This image must be then exported. </li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XMimeTypeInfo
+ * @see com.sun.star.document.XExporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XMimeTypeInfo
+ * @see ifc.document._XExporter
+ */
+public class GraphicExporter extends TestCase {
+ static XComponent xDrawDoc;
+
+ /**
+ * Creates a new draw document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a drawdoc");
+ xDrawDoc = DrawTools.createDrawDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes the draw document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.GraphicExportFilter</code> as
+ * a tested component. Then a <code>GraphicObjectShape</code>
+ * instance is added into the document and its image is obtained
+ * from JPEG file. This shape content is intended to be exported.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} :
+ * descriptor which contains target file name in
+ * the temporary directory, file type (JPEG)
+ * </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} :
+ * checks if the target file exists.
+ * In the case if SOffice is started in 'Hide' mode
+ * ('soapi.test.hidewindows' test parameter is 'true')
+ * the checker always returns <code>true</code>.
+ * </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} :
+ * the <code>GraphicObjectShape</code> component
+ * with loaded image.
+ * </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XShape oShape = null;
+ Object go = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ try {
+ go = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.drawing.GraphicExportFilter");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+ // create testobject here
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc, 5000, 5000, 1500, 1000,
+ "GraphicObject");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc, 0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oShape);
+ XComponent xComp = null;
+
+ try {
+ oShapeProps.setPropertyValue("GraphicURL",
+ util.utils.getFullTestURL(
+ "space-metal.jpg"));
+ xComp = (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ oShape);
+
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface(
+ XExporter.class, (XInterface) go);
+ xEx.setSourceDocument(xComp);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ }
+
+ final URL aURL = new URL();
+ aURL.Complete = util.utils.getOfficeTemp(
+ (XMultiServiceFactory) tParam.getMSF()) +
+ "picture.jpg";
+
+ final XSimpleFileAccess fAcc;
+
+ try {
+ Object oFAcc = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.ucb.SimpleFileAccess");
+ fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface(
+ XSimpleFileAccess.class, oFAcc);
+
+ if (fAcc.exists(aURL.Complete)) {
+ fAcc.kill(aURL.Complete);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error accessing file system :");
+ e.printStackTrace(log);
+ throw new StatusException("Error accessing file system.", e);
+ }
+
+ oObj = (XInterface) go;
+ log.println("ImplName " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("MediaDescriptor",
+ XMLTools.createMediaDescriptor(
+ new String[] {
+ "FilterName", "URL", "MediaType"
+ }, new Object[] { "JPG", aURL, "image/jpeg" }));
+ tEnv.addObjRelation("SourceDocument", xComp);
+
+ log.println("adding ObjRelation for XFilter");
+ log.println("This Component doesn't really support the cancel method");
+ log.println("See #101725");
+ tEnv.addObjRelation("NoFilter.cancel()", new Boolean(true));
+
+ final String hideMode = (String) tParam.get("soapi.test.hidewindows");
+ tEnv.addObjRelation("XFilter.Checker",
+ new ifc.document._XFilter.FilterChecker() {
+ public boolean checkFilter() {
+ try {
+ if ((hideMode != null) && hideMode.equals("true")) {
+ return true;
+ }
+
+ return fAcc.exists(aURL.Complete);
+ } catch (com.sun.star.uno.Exception e) {
+ return false;
+ }
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class GraphicExporter
diff --git a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java
new file mode 100644
index 000000000000..7a227812f4ef
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svx;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+import util.FormTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.DrawPage</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+ * <li> <code>com::sun::star::drawing::XShapes</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::drawing::XMasterPageTarget</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.drawing.GenericDrawPage
+ * @see com.sun.star.drawing.XShapeBinder
+ * @see com.sun.star.drawing.XShapeGrouper
+ * @see com.sun.star.drawing.XShapes
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.drawing.XMasterPageTarget
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.drawing.XShapeCombiner
+ * @see ifc.drawing._GenericDrawPage
+ * @see ifc.drawing._XShapeBinder
+ * @see ifc.drawing._XShapeGrouper
+ * @see ifc.drawing._XShapes
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.drawing._XMasterPageTarget
+ * @see ifc.container._XNamed
+ * @see ifc.drawing._XShapeCombiner
+ */
+public class SvxDrawPage extends TestCase {
+ static XSpreadsheetDocument xDoc = null;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+ util.DesktopTools.closeDoc(xDoc);
+ ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * From the Draw document created a collection of its draw
+ * pages is obtained. Two new pages are inserted. And one
+ * page is obtained as a testing component. A shape is added
+ * to this page. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeGrouper} :
+ * the draw page tested. </li>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes} :
+ * the creator which can create instances of
+ * <code>com.sun.star.drawing.Line</code> service </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XShape oShape = null;
+ XDrawPages oDP = null;
+
+ XComponent xComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xDoc);
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting Drawpages");
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier) UnoRuntime.queryInterface(
+ XDrawPagesSupplier.class, xDoc);
+ oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oObj = (XDrawPage) AnyConverter.toObject(new Type(XDrawPage.class),
+ oDP.getByIndex(0));
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ oShape = SOF.createShape(xComp, 5000, 3500, 7500, 5000,
+ "Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape);
+
+ XShape oShape1 = SOF.createShape(xComp, 5000, 5500, 5000, 5000,
+ "Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape1);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding a controlButton to have a Form
+ FormTools.insertControlShape(
+ (XComponent) UnoRuntime.queryInterface(XComponent.class, xDoc),
+ 3000, 4500, 15000, 1000, "CommandButton");
+
+ // relation for XShapes interface
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Line");
+ tEnv.addObjRelation("Shape", new InstCreator(xDoc, sDsc));
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+
+ // adding relation for XShapeGrouper
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ // adding relation for XMasterPageTarget
+
+ /*XMasterPagesSupplier oMPS = (XMasterPagesSupplier)
+ UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDoc);
+ XDrawPages oGroup = oMPS.getMasterPages();
+ tEnv.addObjRelation("MasterPageSupplier",oGroup); */
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SvxDrawPage
diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java
new file mode 100644
index 000000000000..c6c22727e6f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import com.sun.star.view.XSelectionSupplier;
+
+
+/**
+ *
+ * @author sw93809
+ * @version
+ */
+public class SvxGraphCtrlAccessibleContext extends TestCase{
+
+ static XComponent xDrawDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,5000,1500,1000,"GraphicObject");
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oShape);
+
+ String url = util.utils.getFullTestURL("space-metal.jpg");
+
+ log.println("Inserting Graphic: "+url);
+
+ try {
+ shapeProps.setPropertyValue("GraphicURL", url);
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Property GraphicURL is unknown");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("Property GraphicURL is read only");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("Property GraphicURL tried to set to illegal argument");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("Wrapped Target Exception was thrown while setting Property GraphicURL");
+ }
+
+
+ //Opening ImageMapDialog
+ try {
+ String aSlotID = "slot:10371";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, xController );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ utils.shortWait(Param.getInt(util.PropertyName.SHORT_WAIT));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class,oObj);
+
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //selecting the inserted shape
+ final XSelectionSupplier SelSupp = (XSelectionSupplier)
+ UnoRuntime.queryInterface(XSelectionSupplier.class,xController);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ SelSupp.select(oShape);
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ System.out.println("Couldn't select shape");
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Closing ImageMapDialog
+ try {
+ String aSlotID = "slot:10371";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, xController );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java
new file mode 100644
index 000000000000..a8d7b4feb6c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.awt.XBitmap;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.GraphicObject</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::drawing::GraphicObjectShape</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.drawing.GraphicObjectShape
+ * @see com.sun.star.drawing.Shape
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._XShape
+ * @see ifc.drawing._GraphicObjectShape
+ * @see ifc.drawing._Shape
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.beans._XPropertySet
+ * @see ifc.drawing._TextProperties
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.text._XText
+ * @see ifc.lang._XComponent
+ */
+public class SvxGraphicObject extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.GraphicObject</code> as a tested
+ * component and inserts it to one of draw pages of the document.
+ * <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'Bitmap1', 'Bitmap2'</code> for
+ * {@link ifc.drawing._GraphicObjectShape} :</li>
+ * two bitmap objects which are created by setting
+ * 'GraphicURL' property of component tested and
+ * getting its 'GraphicObjectFillBitmap' property.
+ * <li> <code>'IMAP'</code> for
+ * {@link ifc.drawing._GraphicObjectShape} :
+ * <code>com.sun.star.image.ImageMapRectangleObject</code>
+ * service instance. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+ Object imap=null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,5000,5000,1500,1000,"GraphicObject");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ oObj = oShape;
+
+ TestEnvironment tEnv = new TestEnvironment( oShape );
+
+ // adding two styles as ObjRelation for Shape
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style2",aStyle);
+
+
+ // adding graphic as ObjRelation for GraphicObjectShape
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XBitmap aBitmap = null;
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("space-metal.jpg"));
+ aBitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class),oShapeProps.getPropertyValue
+ ("GraphicObjectFillBitmap"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+
+ tEnv.addObjRelation("Bitmap1",aBitmap);
+
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("crazy-blue.jpg"));
+ aBitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class),oShapeProps.getPropertyValue
+ ("GraphicObjectFillBitmap"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ tEnv.addObjRelation("Bitmap2",aBitmap);
+
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc);
+ imap = oDocMSF.createInstance
+ ( "com.sun.star.image.ImageMapRectangleObject" );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+
+ tEnv.addObjRelation("IMAP",imap);
+ tEnv.addObjRelation("ImapObject",imap);
+
+ // adding relation for XText interface
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ tEnv.addObjRelation("NoShear",new Boolean(true));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SvxGraphicObject
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShape.java b/qadevOOo/tests/java/mod/_svx/SvxShape.java
new file mode 100644
index 000000000000..008fd1602193
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShape.java
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.Shape</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::TextShape</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> SvxShape.sxd </b> : this document is loaded for
+ * adding a shape tested to it. </li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.TextShape
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._TextShape
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShape extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Loads a Draw document with name 'SvxShape.sxd' from test
+ * documents directory
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.EllipseShape</code> as tested component
+ * and adds it to the document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ oObj = oShape ;
+
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oShape );
+
+ // adding relations for Shape service
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShape
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java
new file mode 100644
index 000000000000..ac204c5f277f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.EllipseShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::EllipseShape</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> SvxShape.sxd </b> : this document is loaded for
+ * adding a shape tested to it. </li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.EllipseShape
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._EllipseShape
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapeCircle extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Loads a Draw document with name 'SvxShape.sxd' from test
+ * documents directory
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.EllipseShape</code> as tested component
+ * and adds it to the document. Then the FULL type of circle is set.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,5000,3000,3000,"Ellipse");
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oShape) ;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ try {
+ props.setPropertyValue("CircleKind",
+ com.sun.star.drawing.CircleKind.FULL) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ }
+
+
+ oObj = oShape ;
+
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCircle
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java
new file mode 100644
index 000000000000..2e41e20917f6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeCollection extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+ // adding some shapes for testing.
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ Object col = ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.drawing.ShapeCollection");
+ XShapes shapes = (XShapes) UnoRuntime.queryInterface
+ (XShapes.class,col);
+
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ shapes.add(oShape);
+
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ shapes.add(oShape);
+
+ oObj = (XInterface) col ;
+
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ System.out.println("IName: "+util.utils.getImplName(oObj));
+ ShapeDsc sDsc = new ShapeDsc(5000,3500,7500,10000,"Line");
+ tEnv.addObjRelation("Shape", new InstCreator(xDrawDoc, sDsc)) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCollection
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java
new file mode 100644
index 000000000000..89f8df2391e1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.document.LinkTarget
+ * @see com.sun.star.document.XLinkTargetSupplier
+ * @see com.sun.star.drawing.ConnectorShapeDescriptor
+ * @see com.sun.star.drawing.LineShapeDescriptor
+ * @see com.sun.star.drawing.PolyPolygonDescriptor
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.drawing.ShadowDescriptor
+ * @see com.sun.star.drawing.ShapeDescriptor
+ * @see com.sun.star.drawing.Text
+ * @see com.sun.star.drawing.XConnectorShape
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.text.XTextRange
+ *
+ */
+public class SvxShapeConnector extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc);
+ Object oInt = oDocMSF.createInstance
+ ( "com.sun.star.drawing.ConnectorShape" );
+
+ oShape = (XShape)UnoRuntime.queryInterface( XShape.class, oInt );
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // create testobject here
+ oObj = oShape;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ for (int i=0;i<10;i++) {
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(
+ SOF.createShape(xDrawDoc,
+ 3000,4500,7510+10*i,5010+10*i,"Rectangle"));
+ }
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+ tEnv.addObjRelation("NoSetSize","SvxShapeConnector");
+ // adding relation for XConnectorShape
+ XShape oShape1 = SOF.createShape(xDrawDoc,1000,2000,1500,1000,"Line");
+ XShape oShape2 = SOF.createShape(xDrawDoc,1000,2000,4000,3000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape1);
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape2);
+ tEnv.addObjRelation("XConnectorShape.Shapes",
+ new XShape[] {oShape1, oShape2}) ;
+ System.out.println("IName: "+util.utils.getImplName(oObj));
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeConnector
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java
new file mode 100644
index 000000000000..7a7d6d941977
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.FormTools;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeControl extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ oShape = FormTools.insertControlShape(
+ xDrawDoc,3000,4500,15000,1000,"CommandButton");
+
+ oObj = oShape ;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ log.println( "adding document relation for XControlShape" );
+ tEnv.addObjRelation("xDoc", xDrawDoc) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeControl
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java
new file mode 100644
index 000000000000..f2d0047eae2b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeDimensioning extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,4000,4000,3000,3000,"Measure");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ for (int i=0;i<10;i++) {
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(
+ SOF.createShape(xDrawDoc,
+ 3000,4500,7510+10*i,5010+10*i,"Rectangle"));
+ }
+
+ oObj = oShape ;
+
+ //SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeDimensioning
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java
new file mode 100644
index 000000000000..aa1bba14b7a7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeGrouper;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.drawing._XDrawPage
+ *
+ */
+
+public class SvxShapeGroup extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method initializes the document
+ */
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * in general this method disposes the document
+ */
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ XShapes oShapes = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ try {
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,oDPn);
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get DrawPage", e );
+ }
+
+ if (oObj == null) {
+ System.out.println("**************************");
+ System.out.println(" XDrawPage is NULL");
+ System.out.println("**************************");
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class,oObj);
+ XShape Shape1 = SOF.createShape(xDrawDoc,
+ 3000,4500,15000,1000,"Ellipse");
+ oShapes.add(SOF.createShape(xDrawDoc,
+ 2000,1500,1000,1000,"Line"));
+ oShapes.add(Shape1);
+ XShape Shape2 = SOF.createShape(xDrawDoc,
+ 5000,3500,7500,5000,"Rectangle");
+ oShapes.add(Shape2);
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,Shape1);
+ XStyle aStyle1 = null;
+ try {
+ aStyle1 = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,Shape2);
+ XStyle aStyle2 = null;
+ try {
+ aStyle2 = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+
+ //get the XShapeGrouper
+ try{
+ log.println("get XShapeGroup");
+ XShapeGrouper oSG = (XShapeGrouper)UnoRuntime.queryInterface
+ (XShapeGrouper.class, oObj);
+ oObj = oSG.group(oShapes);
+ } catch ( Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException(" Couldn't get XShapeGroup: ", e);
+ }
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ ShapeDsc sDsc = new ShapeDsc(5000,3500,7500,10000,"Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xDrawDoc, sDsc));
+ //tEnv.addObjRelation("DrawPage", oObj);
+ //tEnv.addObjRelation("MasterPageSupplier",oGroup);
+
+ tEnv.addObjRelation("Style1",aStyle1);
+ tEnv.addObjRelation("Style2",aStyle2);
+ for (int i=0;i<6;i++) {
+ Shape2 = SOF.createShape(xDrawDoc,
+ 5000+100*i,3500+100*i,7500+100*i,5000+100*i,"Rectangle");
+ oShapes.add(Shape2);
+ }
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SvxShapeGroup
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java
new file mode 100644
index 000000000000..f643841d1c59
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java
@@ -0,0 +1,265 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.PolyPolygonShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::PolyPolygonDescriptor</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TransparencyChart.sxs </b> : to load predefined chart
+ * document where two 'automatic' transparency styles exists :
+ * 'Transparency 1' and 'Transparency 2'.</li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.PolyPolygonDescriptor
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._PolyPolygonDescriptor
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapePolyPolygon extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+ // adding some shapes for testing.
+ //SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ //oShape = SOF.createShape(xDrawDoc,6000,6000,5000,5000,"PolyPolygon");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ;
+ XInterface oInst = (XInterface) xMSF.createInstance
+ ("com.sun.star.drawing.PolyPolygonShape") ;
+ oShape = (XShape) UnoRuntime.queryInterface
+ (XShape.class, oInst) ;
+
+ oShape.setSize(new Size(0,0)) ;
+ oShape.setPosition(new Point(0,0)) ;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ Point[] square1 = new Point[] {
+ new Point(5000, 5000),
+ new Point(10000, 5000),
+ new Point(10000, 10000),
+ new Point(5000, 10000)} ;
+
+ Point[] square2 = new Point[] {
+ new Point(6500, 6500),
+ new Point(8500, 6500),
+ new Point(8500, 8500),
+ new Point(6500, 8500)} ;
+
+ Point[][] polygon = new Point[][] {square1, square2};
+
+ ((XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
+ oShape)).setPropertyValue("PolyPolygon", polygon) ;
+
+ oObj = oShape ;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCollection
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java
new file mode 100644
index 000000000000..1e5f98b98604
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.PolyPolygonBezierCoords;
+import com.sun.star.drawing.PolygonFlags;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.ClosedBezierShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::PolyPolygonBezierDescriptor</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TransparencyChart.sxs </b> : to load predefined chart
+ * document where two 'automatic' transparency styles exists :
+ * 'Transparency 1' and 'Transparency 2'.</li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.PolyPolygonBezierDescriptor
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._PolyPolygonBezierDescriptor
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapePolyPolygonBezier extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ;
+
+ XInterface oInst = (XInterface) xMSF.createInstance
+ ("com.sun.star.drawing.ClosedBezierShape") ;
+ oShape = (XShape) UnoRuntime.queryInterface
+ (XShape.class, oInst) ;
+
+ Point[] points = new Point[2];
+ points[0] = new Point();
+ points[0].X = 50;
+ points[0].Y = 50;
+ points[1] = new Point();
+ points[1].X = 5000;
+ points[1].Y = 5000;
+
+ Point[][] the_points = new Point[1][2];
+ the_points[0] = points;
+
+ PolygonFlags[] flags = new PolygonFlags[2];
+ flags[0] = PolygonFlags.NORMAL;
+ flags[1] = PolygonFlags.NORMAL;
+
+ PolygonFlags[][] the_flags = new PolygonFlags[1][2];
+ the_flags[0] = flags;
+
+ PolyPolygonBezierCoords coords = new PolyPolygonBezierCoords();
+ coords.Coordinates=the_points;
+ coords.Flags = the_flags;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ oShape.setSize(new Size(3000,3000)) ;
+ oShape.setPosition(new Point(4000,4000)) ;
+
+ oObj = oShape ;
+
+ XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+
+ shapeProps.setPropertyValue("PolyPolygonBezier",coords);
+
+ //SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ util.DefaultDsc tDsc = new util.DefaultDsc
+ ("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapePolyPolygonBezier
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java
new file mode 100644
index 000000000000..88e72c79d0e4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._svx;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+
+
+public class SvxUnoNumberingRules extends TestCase {
+ static XComponent xDrawDoc;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a drawdoc");
+ xDrawDoc = DrawTools.createDrawDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xDrawDoc);
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) docMSF.createInstance(
+ "com.sun.star.text.NumberingRules");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ Object NewRules=null;
+
+ try{
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oObj);
+ NewRules = xIA.getByIndex(2);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get new Rules for XIndexReplace");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get new Rules for XIndexReplace");
+ }
+
+ tEnv.addObjRelation("INSTANCE1",NewRules);
+
+ return tEnv;
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoText.java b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
new file mode 100644
index 000000000000..ce006623e82b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.text.XText;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoText extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ * Object relations created :
+ * <ul>
+ * <li> <code>'RangeForMove'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range to be moved)</li>
+ * <li> <code>'XTextRange'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range that includes moving
+ * range)</li>
+ * </ul>
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+ XTextRange aRange = null;
+ XShape oShape = null;
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ cursor.setString("TextForMove");
+ aRange = cursor;
+ XTextCursor cursor1 = text.createTextCursorByRange(text.getEnd());
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor1, "Paragraph 2", false);
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor1, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ oObj = text.getText() ;
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.DateTime");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ // adding relation for XTextRangeMover
+ tEnv.addObjRelation("RangeForMove", aRange);
+ tEnv.addObjRelation("XTextRange", oObj);
+
+ // adding relation for XTextRangeComapre
+ tEnv.addObjRelation("TEXT", (XText) UnoRuntime.queryInterface(XText.class, oShape)) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoText
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java
new file mode 100644
index 000000000000..3ff28a8239eb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextContent extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java
new file mode 100644
index 000000000000..36e5a4958399
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextContentEnum extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ oObj = xEA.createEnumeration() ;
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XEnumeration test
+ tEnv.addObjRelation("ENUM", xEA) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java
new file mode 100644
index 000000000000..35bf9287dd28
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextCursor extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XText text = (XText) UnoRuntime.queryInterface(XText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ oObj = cursor ;
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoTextCursor
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java
new file mode 100644
index 000000000000..605ac61fc209
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see ifc._XComponent
+ * @see ifc._TextContent
+ * @see ifc._XTextContent
+ * @see ifc._XTextField
+ *
+ */
+public class SvxUnoTextField extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc( (XMultiServiceFactory) tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ }
+ catch (Exception e) {
+ log.println("Couldn't create Shape");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create Shape ",e);
+ }
+
+ XTextCursor the_Cursor = null;
+
+ // create testobject here
+ try {
+
+ XText the_Text = (XText) UnoRuntime.queryInterface(XText.class,oShape);
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc );
+ the_Cursor = the_Text.createTextCursor();
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.TextField.DateTime" );
+ XTextContent the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+
+ the_Text.insertTextContent(the_Cursor,the_Field,false);
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create Textfield");
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't create TextField ",ex);
+ }
+
+ log.println( "creating a new environment for FieldMaster object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("RANGE", the_Cursor);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoTextField
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java
new file mode 100644
index 000000000000..e5d626bc0c13
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextRange extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ XInterface oTextContent = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, oTextContent) ;
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java
new file mode 100644
index 000000000000..7ea4ebf6ccf6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextRangeEnumeration extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ XInterface oTextContent = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, oTextContent) ;
+
+ oObj = xEA.createEnumeration();
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM", xEA);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/package.html b/qadevOOo/tests/java/mod/_svx/package.html
new file mode 100644
index 000000000000..23cadeba3819
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'svx'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
new file mode 100755
index 000000000000..95c70509306f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.CharacterStyle</code>. <p>
+ * @see com.sun.star.style.CharacterStyle
+ */
+public class CharacterStyle extends TestCase {
+ private XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * At first style families are gotten from a text document using
+ * <code>XStyleFamiliesSupplier</code> interface, then family indexed '0' is
+ * gotten from this style family using <code>XIndexAccess</code> interface.
+ * Next, method creates an instance of the service
+ * <code>com.sun.star.style.CharacterStyle</code> and inserts it to a
+ * previously obtained style family using <code>XNameContainer</code>
+ * interface. Finally, method creates a cursor of a major text of text
+ * document and sets it's property 'CharStyleName' value to the name of
+ * previously created style's name.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PoolStyle'</code> for
+ * {@link ifc.style._XStyle} : style indexed '10' obtained from
+ * StyleFamily indexed '0' from text document using
+ * <code>XIndexAccess</code> interface.</li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ TestEnvironment tEnv = null;
+ XNameAccess oSFNA = null;
+ XStyle oStyle = null;
+ XStyle oMyStyle = null;
+
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ XIndexAccess oSFsIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSF);
+ oSFNA = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,oSFsIA.getByIndex(0));
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = (XStyle) UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(0));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ try {
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.CharacterStyle");
+ oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+
+ if (oMyStyle == null)
+ log.println("FAILED");
+ else
+ log.println("OK");
+ XNameContainer oSFNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+ try {
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCursor);
+
+ try {
+ xProp.setPropertyValue("CharStyleName", oMyStyle.getName());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oMyStyle);
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ XPropertySet xStyleProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+
+ short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY;
+ tEnv.addObjRelation("PropertyNames",utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude));
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
new file mode 100755
index 000000000000..f0903c99e693
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.ConditionalParagraphStyle</code>. <p>
+ * @see com.sun.star.style.ConditionalParagraphStyle
+ */
+public class ConditionalParagraphStyle extends TestCase {
+
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Create a new instance of the conditional
+ * paragraph style, and insert it into the document.
+ * @see com.sun.star.style.ConditionalParagraphStyle
+ * @param tParam The test paramters
+ * @param log The log writer.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XNameAccess oSFNA = null;
+ XStyle oStyle = null;
+ XStyle oMyStyle = null;
+
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("ParagraphStyles"));
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = (XStyle) UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(1));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ try {
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.ConditionalParagraphStyle");
+ oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+
+ if (oMyStyle == null) {
+ log.println("FAILED");
+ throw new StatusException(Status.failed("Couldn't create an own style "));
+ }
+ else {
+ log.println("OK");
+ }
+
+ XNameContainer oSFNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+ try {
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCursor);
+ try {
+ xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oMyStyle);
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ XPropertySet xStyleProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+ short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY;
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+ tEnv.addObjRelation("PropertyNames", names);
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sw/DocumentSettings.java b/qadevOOo/tests/java/mod/_sw/DocumentSettings.java
new file mode 100644
index 000000000000..9d003240d9fe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/DocumentSettings.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+import util.WriterTools;
+
+import java.io.PrintWriter;
+
+
+public class DocumentSettings extends TestCase
+{
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log)
+ {
+ log.println(" opening xTextDoc ");
+ xTextDoc =
+ WriterTools.createTextDoc((XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log)
+ {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log
+ )
+ {
+ SOfficeFactory SOF =
+ SOfficeFactory.getFactory((XMultiServiceFactory) tParam.getMSF());
+ XInterface oObj = null;
+
+ log.println("creating a test environment");
+
+ oObj =
+ (XInterface) SOF.createInstance(
+ xTextDoc, "com.sun.star.text.DocumentSettings"
+ );
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/PageStyle.java b/qadevOOo/tests/java/mod/_sw/PageStyle.java
new file mode 100755
index 000000000000..19a518cf9f67
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/PageStyle.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.PageStyle</code>. <p>
+ * @see com.sun.star.style.PageStyle
+ */
+public class PageStyle extends TestCase {
+
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XNameAccess oSFNA = null;
+ XStyle oStyle = null;
+ XStyle oMyStyle = null;
+
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("PageStyles")); // get the page style
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = (XStyle) UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(0));
+ log.println("Chosen pool style: "+oStyle.getName());
+
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ try {
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.PageStyle");
+// oMSF.createInstanceWithArguments("com.sun.star.style.PageStyle",new Object[]{oStyle});
+ oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+
+ if (oMyStyle == null)
+ log.println("FAILED");
+ else
+ log.println("OK");
+
+ XNameContainer oSFNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+
+ try {
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCursor);
+ Property[] props = xProp.getPropertySetInfo().getProperties();
+ for (int i=0; i<props.length; i++)
+ System.out.println("# Property: " + props[i].Name + " val: " + props[i].Type.toString() + " attr: " + props[i].Attributes);
+ try {
+ xProp.setPropertyValue("PageDescName", oMyStyle.getName());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+// oMyStyle = oStyle;
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oMyStyle);
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ tEnv.addObjRelation("FollowStyle", "Envelope");
+ XPropertySet xStyleProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+
+ short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY;
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+ tEnv.addObjRelation("PropertyNames", names);
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
new file mode 100755
index 000000000000..be55107c94f8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.ParagraphStyle</code>. <p>
+ * @see com.sun.star.style.ParagraphStyle
+ */
+public class ParagraphStyle extends TestCase {
+
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ TestEnvironment tEnv = null;
+ XNameAccess oSFNA = null;
+ XStyle oStyle = null;
+ XStyle oMyStyle = null;
+
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ oSFNA = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess.class,oSF.getByName("ParagraphStyles"));
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ String[] els = oSFNA.getElementNames();
+ oStyle = (XStyle) UnoRuntime.queryInterface(
+ XStyle.class,oSFIA.getByIndex(1));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ try {
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.ParagraphStyle");
+ oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+
+ if (oMyStyle == null)
+ log.println("FAILED");
+ else
+ log.println("OK");
+ XNameContainer oSFNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+ try {
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCursor);
+
+ try {
+ xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oMyStyle);
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ XPropertySet xStyleProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+ short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY;
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+ tEnv.addObjRelation("PropertyNames", names);
+
+ return tEnv;
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
new file mode 100644
index 000000000000..e29891766ff0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+public class SwAccessibleDocumentPageView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the document page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting some lines" );
+ try {
+ for (int i=0; i<25; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwAccessibleDocumentPageView",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwAccessibleDocumentPageView",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't insert lines", e );
+ }
+
+ XController xController = xTextDoc.getCurrentController();
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ //switch to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT );
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XText the_text = oText;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ String oldText = the_text.getString();
+ the_text.setString("EVENT FIRED");
+ shortWait();
+ the_text.setString(oldText);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+
+ /**
+ * Sleeps for 1 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) Param.getMSF());
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
new file mode 100644
index 000000000000..07d517003cd8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test of accessible object for the text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleDocumentView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects. The method is called from
+ * <code>getTestEnvironment()</code>. Obtains accissible object for
+ * text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting some lines" );
+ try {
+ for (int i=0; i<5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't insert lines", e );
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR);
+ final XAccessibleValue xAccVal = (XAccessibleValue) UnoRuntime.queryInterface
+ (XAccessibleValue.class, SearchedContext) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xAccVal.setCurrentValue(xAccVal.getMinimumValue());
+ xAccVal.setCurrentValue(xAccVal.getMaximumValue());
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ public static boolean first = false;
+ public static XAccessibleContext SearchedContext = null;
+
+ public static void getAccessibleObjectForRole(XAccessible xacc,short role) {
+ XAccessibleContext ac = xacc.getAccessibleContext();
+ if (ac.getAccessibleRole()==role) {
+ if (first) SearchedContext = ac;
+ else first=true;
+ } else {
+ int k = ac.getAccessibleChildCount();
+ for (int i=0;i<k;i++) {
+ try {
+ getAccessibleObjectForRole(ac.getAccessibleChild(i),role);
+ if (SearchedContext != null) return ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't get Child");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
new file mode 100644
index 000000000000..1761aabdf3a2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+public class SwAccessibleEndnoteView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Inserts the created endnote to the document.
+ * Changes zoom value to 10%(endnote must be in vissible area of the document).
+ * Obtains accessible object for the inserted endnote.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface oEndnote = null;
+
+ log.println( "Creating a test environment" );
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a endnote");
+ try {
+ oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class,
+ msf.createInstance("com.sun.star.text.Endnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create endnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ XTextContent xTC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oEndnote);
+ try {
+ oText.insertTextContent(oCursor, xTC, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the endnote", e);
+ }
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+ XPropertySet xPropSet = xViewSetSup.getViewSettings();
+
+ try {
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ xPropSet.setPropertyValue("ZoomValue", new Short("10"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.END_NOTE);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 130%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 10%
+ PropSet.setPropertyValue("ZoomValue", new Short("10"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
new file mode 100644
index 000000000000..c355b5d17d92
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+* Test of accessible object for a footer of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleFooterView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects. Obtains style
+ * <code>Standard</code> from style family <code>PageStyles</code>.
+ * Changes values of property <code>FooterIsOn</code> by <code>true</code>.
+ * Changes zoom value to 10%(footer must be in vissible area of the document).
+ * Obtains accessible component for the footer.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+
+ // obtains style 'Standard' from style family 'PageStyles'
+ try {
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error, no such style name! ", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ }
+
+ final XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
+
+ // changing/getting some properties
+ try {
+ log.println( "Switching on footer" );
+ PropSet.setPropertyValue("FooterIsOn", new Boolean(true));
+
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+ XPropertySet xPropSet = xViewSetSup.getViewSettings();
+ xPropSet.setPropertyValue("ZoomValue", new Short("20"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTER);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ PropSet.setPropertyValue("FooterLeftMargin",
+ new Integer(1000));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ throw new StatusException("Cann't change footer.", e);
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
new file mode 100644
index 000000000000..0a8ba7c23b0d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnote;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+public class SwAccessibleFootnoteView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Inserts the created footnote to the document.
+ * Changes zoom value to 10%(endnote must be in vissible area of the document).
+ * Obtains accessible object for the inserted footnote.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XFootnote oFootnote = null;
+
+ log.println( "Creating a test environment" );
+ // get a soffice factory object
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a footnote");
+
+ try {
+ oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create footnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ try {
+ oText.insertTextContent(oCursor, oFootnote, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the footnote", e);
+ }
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+ XPropertySet xPropSet = xViewSetSup.getViewSettings();
+
+ try {
+ //change zoom value to 10%
+ //footer should be in the vissible area of the document
+ xPropSet.setPropertyValue("ZoomValue", new Short("10"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTNOTE);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 130%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 10%
+ PropSet.setPropertyValue("ZoomValue", new Short("10"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
new file mode 100644
index 000000000000..db817c4b260b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test of accessible object for a header of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleHeaderView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects. Obtains style
+ * <code>Standard</code> from style family <code>PageStyles</code>.
+ * Changes values of properties <code>HeaderIsOn</code> and
+ * <code>FooterIsOn</code> by <code>true</code>. Obtains accessible component
+ * for header.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+
+ // obtains style 'Standatd' from style family 'PageStyles'
+ try {
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error, no such style name! ", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ }
+
+ final XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
+
+ // changing/getting some properties
+ try {
+ log.println( "Switching on header" );
+ PropSet.setPropertyValue("HeaderIsOn", new Boolean(true));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set propertyValue...", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.HEADER);
+
+ oObj = AccessibilityTools.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ PropSet.setPropertyValue("HeaderLeftMargin",
+ new Integer(1000));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ throw new StatusException("Cann't change footer.", e);
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
new file mode 100644
index 000000000000..d99a6dcfa4f1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+public class SwAccessiblePageView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface port = null;
+ XInterface para = null;
+ XPropertySet paraP = null;
+ XPropertySet portP = null;
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting some lines" );
+ try {
+ for (int i=0; i<2; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't insert lines", e );
+ }
+
+ // Enumeration
+ XEnumerationAccess oEnumA = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, oText );
+ XEnumeration oEnum = oEnumA.createEnumeration();
+
+ try {
+ para = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ XEnumerationAccess oEnumB = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, para );
+ XEnumeration oEnum2 = oEnumB.createEnumeration();
+ port = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum2.nextElement());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ }
+
+ try {
+ portP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, port);
+ paraP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, para);
+ paraP.setPropertyValue("BreakType",com.sun.star.style.BreakType.PAGE_AFTER);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ }
+
+ shortWait();
+
+ XController xController = xTextDoc.getCurrentController();
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ //switch to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ throw new StatusException(Status.failed("Couldn't change mode"));
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ System.out.println("Panel: "+AccessibleRole.PANEL);
+ System.out.println("ScrollPane: "+AccessibleRole.SCROLL_PANE);
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL,"Page");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR);
+ final XAccessibleValue xAccVal = (XAccessibleValue) UnoRuntime.queryInterface
+ (XAccessibleValue.class, SearchedContext) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Integer old = (Integer) xAccVal.getCurrentValue();
+ Integer newValue = new Integer(old.intValue()+10);
+ xAccVal.setCurrentValue(newValue);
+ xAccVal.setCurrentValue(old);
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ public static boolean first = false;
+ public static XAccessibleContext SearchedContext = null;
+
+ public static void getAccessibleObjectForRole(XAccessible xacc,short role) {
+ XAccessibleContext ac = xacc.getAccessibleContext();
+ if (ac.getAccessibleRole()==role) {
+ if (first) SearchedContext = ac;
+ else first=true;
+ } else {
+ int k = ac.getAccessibleChildCount();
+ for (int i=0;i<k;i++) {
+ try {
+ getAccessibleObjectForRole(ac.getAccessibleChild(i),role);
+ if (SearchedContext != null) return ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't get Child");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
new file mode 100644
index 000000000000..9e32d3ae5aa0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test of accessible object for paragraph of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleParagraphView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects. Obtains accessible object
+ * for one of document paragraph.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XText oText = xTextDoc.getText();
+ oText.setString("XAccessibleText");
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.PARAGRAPH);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XText paraText = xTextDoc.getText();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ String old = paraText.getString();
+ paraText.setString("Just a line");
+ paraText.setString(old);
+ }
+ });
+
+ final String text = "XAccessibleText";
+
+ tEnv.addObjRelation("XAccessibleText.Text", text);
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) Param.getMSF());
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
new file mode 100644
index 000000000000..f9f511398691
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Test of accessible object for the table cell of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleTableCellView extends TestCase {
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Creates a text table and inserts it to document. Then obtains accessible
+ * object for one of table cell.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ oTable = SOF.createTextTable(xTextDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create TextTable : " +
+ e.getMessage(), e);
+ }
+
+ try {
+ SOF.insertTextContent(xTextDoc, oTable);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert text content :" +
+ e.getMessage(), e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleSelection accSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ at.SearchedContext.getAccessibleParent());
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ accSel.selectAllAccessibleChildren();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println("creating a text document");
+ xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) Param.getMSF());
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
new file mode 100644
index 000000000000..e74ceaa7f315
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+* Test of accessible object for the table of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleTableView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Creates a text table and inserts it into the document.
+ * Then obtains accessible object for the table.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : " +
+ e.getMessage(), e);
+ }
+
+ try {
+ SOF.insertTextContent(xTextDoc, oTable );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't insert text content :"
+ + e.getMessage(), e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 15%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 100%
+ PropSet.setPropertyValue("ZoomValue", new Short("100"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
new file mode 100644
index 000000000000..8114d24b84f1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+* Test of accessible object for the text embedded object of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleTextEmbeddedObject extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Obtains accessible object for the embedded object.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.EMBEDDED_OBJECT);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 15%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 100%
+ PropSet.setPropertyValue("ZoomValue", new Short("100"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Loads the text document <code>SwXTextEmbeddedObject.sxw</code>
+ * with a text embedded object.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "open a text document" );
+ String testdoc = utils.getFullTestURL("SwXTextEmbeddedObject.sxw");
+ log.println(testdoc);
+ xTextDoc = WriterTools.loadTextDoc((XMultiServiceFactory)Param.getMSF(),testdoc);
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
new file mode 100644
index 000000000000..a6af6f769d00
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.TextContentAnchorType;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+* Test of accessible object for the text frame of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleTextFrameView extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Creates a frame and inserts it into document.
+ * Obtains accessible object for the inserted text frame.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XTextFrame oFrame1 = null;
+ XPropertySet oPropSet = null;
+ XText oText = null;
+ XTextCursor oCursor = null;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ // creating Frames
+ log.println( "creating Frames" );
+ try {
+ oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500);
+ oPropSet = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oFrame1 );
+ oPropSet.setPropertyValue("AnchorType",
+ TextContentAnchorType.AS_CHARACTER);
+ oText = xTextDoc.getText();
+ oCursor = oText.createTextCursor();
+
+ log.println( "inserting Frame1" );
+ XTextContent the_content = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oFrame1);
+ oText.insertTextContent(oCursor, the_content, true);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert TextFrame", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 15%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 100%
+ PropSet.setPropertyValue("ZoomValue", new Short("100"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
new file mode 100644
index 000000000000..ab5c19e6d9b2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+* Test of accessible object for the graphic object of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see com.sun.star.accessibility.XAccessible
+*/
+public class SwAccessibleTextGraphicObject extends TestCase {
+
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Creates a graphic object and inserts it into the document.
+ * Obtains accessible object for graphic object.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
+ Object oGraphObj = SOF.createInstance(
+ xTextDoc, "com.sun.star.text.GraphicObject");
+
+ XText the_text = xTextDoc.getText();
+ XTextCursor the_cursor = the_text.createTextCursor();
+ XTextContent the_content = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oGraphObj);
+
+ log.println( "inserting graphic" );
+ try {
+ the_text.insertTextContent(the_cursor, the_content, true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't insert Content", e);
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.GRAPHIC);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+
+ final XPropertySet PropSet = xViewSetSup.getViewSettings();
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ //change zoom value to 15%
+ PropSet.setPropertyValue("ZoomValue", new Short("15"));
+ //and back to 100%
+ PropSet.setPropertyValue("ZoomValue", new Short("100"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+
+ }
+ }
+ });
+
+
+ return tEnv;
+
+ }
+
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println("dispose text document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization.
+ * Creates a text document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)Param.getMSF());
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
new file mode 100644
index 000000000000..978ea5b54176
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XAutoTextContainer;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.AutoTextContainer</code>.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::container::XNameAccess</code></li>
+* <li> <code>com::sun::star::container::XElementAccess</code></li>
+* <li> <code>com::sun::star::text::XAutoTextContainer</code></li>
+* </ul>
+* @see com.sun.star.container.XNameAccess
+* @see com.sun.star.container.XElementAccess
+* @see com.sun.star.text.XAutoTextContainer
+* @see com.sun.star.text.AutoTextContainer
+* @see ifc.container._XNameAccess
+* @see ifc.container._XElementAccess
+* @see ifc.text._XAutoTextContainer
+*/
+public class SwXAutoTextContainer extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.AutoTextContainer</code>.<p>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XAutoTextContainer oContainer = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a AutoTextContainer");
+ try {
+ XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF();
+ Object oInst = myMSF.createInstance
+ ("com.sun.star.text.AutoTextContainer");
+ oContainer = (XAutoTextContainer)UnoRuntime.queryInterface
+ (XAutoTextContainer.class,oInst);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create AutoTextContainer", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oContainer);
+
+ return tEnv;
+ }
+
+} // finish class SwXAutoTextcontainer
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
new file mode 100644
index 000000000000..55befb374caf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.InstCreator;
+import util.SOfficeFactory;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XAutoTextContainer;
+import com.sun.star.text.XAutoTextEntry;
+import com.sun.star.text.XAutoTextGroup;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.AutoTextEntry</code>.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::XAutoTextEntry</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.AutoTextEntry
+ * @see com.sun.star.text.AutoTextContainer
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XAutoTextEntry
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._XAutoTextEntry
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XText
+ */
+public class SwXAutoTextEntry extends TestCase {
+ XTextDocument xTextDoc;
+ XAutoTextGroup oGroup;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ XMultiServiceFactory msf = (XMultiServiceFactory) tParam.getMSF();
+ SOfficeFactory SOF = SOfficeFactory.getFactory( msf );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Removes added element from AutoTextGroup
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ try {
+ if ( oGroup.hasByName("NewEntryName") ) {
+ log.println("Removing 'NewEntryName' element");
+ oGroup.removeByName("NewEntryName");
+ }
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Cannot remove TextEntry from group...");
+ e.printStackTrace(log);
+ }
+ log.println( "disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.AutoTextContainer</code>, then selects the 'mytexts'
+ * group from the given container using <code>XNameAccess</code> interface,
+ * and inserts some text entry to this group. Then entry passed as test
+ * component.<p>
+ * Object relations created :
+ * <ul>
+ * <li><code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} : creates tables 6x4</li>
+ * <li><code>'TEXTDOC'</code> for
+ * {@link ifc.text._XAutoTextEntry} : text document</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XAutoTextEntry oEntry = null;
+ XAutoTextContainer oContainer;
+ XInterface oObj = null;
+ int n = 0;
+ int nCount = 0;
+
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF();
+ Object oInst = myMSF.createInstance
+ ("com.sun.star.text.AutoTextContainer");
+ oContainer = (XAutoTextContainer)
+ UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create AutoTextContainer", e);
+ }
+
+ XNameAccess oContNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oContainer);
+
+ String contNames[] = oContNames.getElementNames();
+ for (int i =0; i < contNames.length; i++){
+ log.println("ContainerNames[ "+ i + "]: " + contNames[i]);
+ }
+
+ try{
+ oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName("mytexts"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get AutoTextGroup", e);
+ }
+
+ oGroup = (XAutoTextGroup) UnoRuntime.queryInterface
+ (XAutoTextGroup.class, oObj);
+ String[] oENames = oGroup.getElementNames();
+ for (int i=0; i<oENames.length; i++) {
+ log.println("AutoTextEntryNames[" + i + "]: " + oENames[i]);
+ }
+
+ XText oText = xTextDoc.getText();
+ oText.insertString(oText.getStart(), "New AutoText", true);
+ XTextRange oTextRange = (XTextRange) oText;
+ try {
+ if ( oGroup.hasByName("NewEntryName") ) {
+ oGroup.removeByName("NewEntryName");
+ log.println("Element 'NewEntryName' exists, removing...");
+ }
+ log.println("Adding new element 'NewEntryName' to group...");
+ oGroup.insertNewByName("NewEntryName", "NewEntryTitle", oTextRange);
+ oEntry = (XAutoTextEntry) AnyConverter.toObject(
+ new Type(XAutoTextEntry.class),oGroup.getByName("NewEntryName"));
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ }
+
+ oObj = oEntry;
+
+ log.println("Trying to use XText as TextRange in the method applyTo");
+ oEntry.applyTo(oTextRange);
+
+ oTextRange = oText.createTextCursor();
+ log.println("Trying to use XTextCursor as TextRange in the method applyTo");
+ oEntry.applyTo(oTextRange);
+
+ log.println( "creating a new environment for AutoTextEntry object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.DateTime");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXAutoTextEntry
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
new file mode 100644
index 000000000000..4095e19e3725
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.ElementExistException;
+import com.sun.star.container.XNameAccess;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XAutoTextContainer;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.AutoTextGroup</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::text::XAutoTextGroup</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.text.XAutoTextGroup
+ * @see com.sun.star.text.AutoTextContainer
+ * @see ifc.container._XNamed
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.text._XAutoTextGroup
+ */
+public class SwXAutoTextGroup extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.AutoTextContainer</code>, then creates a new
+ * group into the container.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TextRange'</code> for
+ * {@link ifc.text._XAutoTextGroup} range of text</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XAutoTextContainer oContainer;
+
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF();
+ Object oInst = myMSF.createInstance("com.sun.star.text.AutoTextContainer");
+ oContainer = (XAutoTextContainer) UnoRuntime.queryInterface(XAutoTextContainer.class,oInst);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create AutoTextContainer", e);
+ }
+ String myGroupName="myNewGroup2*1";
+
+ XAutoTextContainer xATC = (XAutoTextContainer) UnoRuntime.queryInterface(XAutoTextContainer.class, oContainer);
+
+ try {
+ log.println("removing element with name '" + myGroupName + "'");
+ xATC.removeByName(myGroupName);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ }
+
+ try {
+ log.println("adding element with name '" + myGroupName + "'");
+ xATC.insertNewByName(myGroupName);
+ } catch (ElementExistException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("could not insert '"+myGroupName+"' into container",ex);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace(log);
+ throw new StatusException("could not insert '"+myGroupName+"' into container",ex);
+ }
+
+
+ XNameAccess oContNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oContainer);
+
+ if (Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)){
+ String contNames[] = oContNames.getElementNames();
+ for (int i =0; i < contNames.length; i++){
+ log.println("ContainerNames[ "+ i + "]: " + contNames[i]);
+ }
+ }
+
+ try{
+ oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName(myGroupName));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get AutoTextGroup '"+myGroupName + "'", e);
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ log.println( "creating a new environment for AutoTextGroup object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XText oText = xTextDoc.getText();
+ oText.insertString(oText.getStart(), "New AutoText", true);
+
+ log.println( "adding TextRange as mod relation to environment" );
+ tEnv.addObjRelation("TextRange", oText);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXAutoTextGroup
diff --git a/qadevOOo/tests/java/mod/_sw/SwXBodyText.java b/qadevOOo/tests/java/mod/_sw/SwXBodyText.java
new file mode 100644
index 000000000000..adc5595d58fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBodyText.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Text</code>.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextRangeMover</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XRelativeTextContentInsert</code></li>
+ * <li> <code>com::sun::star::text::XTextRangeCompare</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextRangeMover
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XRelativeTextContentInsert
+ * @see com.sun.star.text.XTextRangeCompare
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XTextRangeMover
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XRelativeTextContentInsert
+ * @see ifc.text._XTextRangeCompare
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.text._XText
+ */
+public class SwXBodyText extends TestCase {
+ XTextDocument xTextDoc = null;;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains body text from text document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TEXT'</code> for
+ * {@link ifc.text._XTextRangeCompare} : text</li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert},
+ * {@link ifc.text._XText} : creates 6x4 tables</li>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert} : paragraph creator</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+
+ // get the bodytext of textdocument here
+ log.println( " getting the bodytext of textdocument with getText()" );
+ oObj = xTextDoc.getText();
+
+ log.println( " creating a new environment for bodytext object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println(" adding Text as ObjRelation");
+ tEnv.addObjRelation("TEXT", oObj );
+
+ log.println( " adding InstDescriptor object" );
+ TableDsc tDsc = new TableDsc( 6, 4 );
+
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ log.println( " adding Paragraph" );
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator( xTextDoc, pDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXBodyText
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXBookmark.java b/qadevOOo/tests/java/mod/_sw/SwXBookmark.java
new file mode 100644
index 000000000000..feb3f8dabbb6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBookmark.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Bookmark</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * <li> <code>com::sun::star::text::TextContent</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.TextContent
+ * @see ifc.container._XNamed
+ * @see ifc.lang._XComponent
+ * @see ifc.text._XTextContent
+ * @see ifc.text._TextContent
+ */
+public class SwXBookmark extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After creating
+ * a bookmark, it is inserted to the text document.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ XInterface oObj = null;
+ Object instance = null;
+ log.println( "creating a test environment" );
+ try {
+ oObj = SOF.createBookmark( xTextDoc );
+ SOF.insertTextContent( xTextDoc, (XTextContent) oObj );
+ instance = SOF.createInstance(xTextDoc,"com.sun.star.text.Bookmark");
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create Bookmark", e );
+ }
+ log.println( "creating a new environment for bodytext object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ util.dbg.printInterfaces((XInterface) instance);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXBookmark
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java b/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java
new file mode 100644
index 000000000000..cec8afee207a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XBookmarksSupplier;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Bookmarks</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ */
+public class SwXBookmarks extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. Method
+ * creates two bookmarks and inserts them to the text document. Then bookmarks
+ * are gotten from text document using <code>XBookmarksSupplier</code>
+ * interface.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+ try {
+ oObj = SOF.createBookmark( xTextDoc );
+ SOF.insertTextContent( xTextDoc, (XTextContent) oObj );
+ oObj = SOF.createBookmark( xTextDoc );
+ SOF.insertTextContent( xTextDoc, (XTextContent) oObj );
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create Bookmark", e );
+ }
+
+ XBookmarksSupplier oBSupp = (XBookmarksSupplier)
+ UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc);
+ XNameAccess oBookNA = oBSupp.getBookmarks();
+ oObj = oBookNA;
+ log.println( "creating a new environment for Bookmarks object" );
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXBookmarks
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXCell.java b/qadevOOo/tests/java/mod/_sw/SwXCell.java
new file mode 100644
index 000000000000..f05a79f1eb1d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXCell.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is a cell of the table in a text document, and
+ * represented by service <code>com.sun.star.table.Cell</code><p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::CellProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.table.Cell
+ * @see com.sun.star.text.CellProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.text._CellProperties
+ * @see ifc.beans._XPropertySet
+ */
+public class SwXCell extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After creating
+ * a text table, it is inserted to the text document. Finally, first cell of
+ * this table is gotten.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CellProperties.TextSection'</code> for
+ * {@link ifc.text._CellProperties} : range of complete paragraphs
+ * within a text</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XTextContent oTable = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ log.println( "creating a test environment" );
+ try {
+ oTable = SOF.createTextTable(xTextDoc, 3, 4);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Unable to create TextTable...");
+ e.printStackTrace(log);
+ }
+ try {
+ SOF.insertTextContent( xTextDoc, oTable );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Unable to insert TextContent...");
+ e.printStackTrace(log);
+ }
+ oObj = SOF.getFirstTableCell( oTable );
+
+ log.println( " creating a new environment for bodytext object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ try {
+ XInterface oTS = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.TextSection");
+ log.println(" adding TextSection object");
+ tEnv.addObjRelation("CellProperties.TextSection", oTS);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Could not get instance of TextSection");
+ e.printStackTrace(log);
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXCell
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
new file mode 100644
index 000000000000..7610618877e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.table.CellRange</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::CellProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.table.CellRange
+ * @see com.sun.star.text.CellProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.text._CellProperties
+ * @see ifc.beans._XPropertySet
+ */
+public class SwXCellRange extends TestCase {
+ SOfficeFactory SOF;
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. At first
+ * method creates and initializes the table, then if text document has no
+ * tables, previously created table is inserted to text document. Finally,
+ * custom cell range is gotten from the table created.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'CellProperties.TextSection'</code> for
+ * {@link ifc.text._CellProperties} : range of complete paragraphs
+ * within a text</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XTextTable the_table = null;
+ XInterface oObj = null;
+ try {
+ the_table = SOF.createTextTable( xTextDoc );
+ the_table.initialize(5, 5);
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create testobj: "
+ +e.getMessage(),e);
+ }
+
+ if( SOF.getTableCollection( xTextDoc ).getCount() == 0 ) {
+ try {
+ SOF.insertTextContent(xTextDoc, the_table );
+ } catch( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : "
+ + e.getMessage(), e);
+ }
+ }
+ try {
+ XCellRange the_Range = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, the_table);
+ oObj = the_Range.getCellRangeByPosition(0, 0, 3, 4);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't get CellRange : "
+ + e.getMessage(), e);
+ }
+
+ log.println("Creating instance...");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ log.println("ImplName: " + util.utils.getImplName(oObj));
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ try {
+ XInterface oTS = (XInterface)
+ oDocMSF.createInstance("com.sun.star.text.TextSection");
+ log.println(" adding TextSection object");
+ tEnv.addObjRelation("CellProperties.TextSection", oTS);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Could not get instance of TextSection");
+ e.printStackTrace(log);
+ }
+
+ Object[][] NewData = new Object[5][];
+ NewData[0] = new Double[]
+ {new Double(2.5),new Double(5),new Double(2.5),new Double(5)};
+ NewData[1] = new Double[]
+ {new Double(4),new Double(9),new Double(2.5),new Double(5)};
+ NewData[2] = new Double[]
+ {new Double(2.5),new Double(5),new Double(2.5),new Double(5)};
+ NewData[3] = new Double[]
+ {new Double(2.5),new Double(5),new Double(2.5),new Double(5)};
+ NewData[4] = new Double[]
+ {new Double(4),new Double(9),new Double(2.5),new Double(5)};
+ tEnv.addObjRelation("NewData",NewData);
+
+ // com::sun::star::chart::XChartDataArray
+ tEnv.addObjRelation("CRDESC",
+ "Column and RowDescriptions can't be changed for this Object");
+
+
+ return tEnv;
+ }
+} // finish class SwXCellRange
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java b/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java
new file mode 100644
index 000000000000..544ec015dda2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.PropertyValue;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XChapterNumberingSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object, which is a collection of chapter numbering rules of document.
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::text::NumberingRules</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.text.NumberingRules
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.text._NumberingRules
+ */
+public class SwXChapterNumbering extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. Chapter
+ * numbering rules are gotten from text document using interface
+ * <code>XChapterNumberingSupplier</code>.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ XChapterNumberingSupplier oCNSupp = (XChapterNumberingSupplier)
+ UnoRuntime.queryInterface(XChapterNumberingSupplier.class,xTextDoc);
+ oObj = oCNSupp.getChapterNumberingRules();
+
+ PropertyValue[] instance1 = null;
+ try {
+ instance1 = (PropertyValue[]) oCNSupp.getChapterNumberingRules().getByIndex(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ }
+
+ //instance1[0].Value = new Short((short)5);
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("INSTANCE1", instance1);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXChapterNumbering
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
new file mode 100644
index 000000000000..ec42193e731e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.DocumentIndex</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::text::XDocumentIndex</code></li>
+ * <li> <code>com::sun::star::text::BaseIndex</code></li>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * <li> <code>com::sun::star::text::DocumentIndex</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.XDocumentIndex
+ * @see com.sun.star.text.BaseIndex
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.DocumentIndex
+ * @see ifc.lang._XComponent
+ * @see ifc.text._XDocumentIndex
+ * @see ifc.text._BaseIndex
+ * @see ifc.text._XTextContent
+ * @see ifc.text._DocumentIndex
+ */
+public class SwXDocumentIndex extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.DocumentIndex</code>, then created document index
+ * is inserted to the text of the document as content.
+ *
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XTextContent xTC = null;
+ Object instance = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF());
+ log.println( "creating a test environment" );
+ try {
+ xTC = SOF.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
+ instance = SOF.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
+ }
+ catch ( com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create the Index", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the Index into text document");
+ try {
+ oText.insertTextContent(oCursor, xTC, false);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the Index", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(xTC);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ oCursor.gotoEnd(false);
+ tEnv.addObjRelation("RANGE", (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, oCursor));
+
+ // relation for XDocumentIndex
+ tEnv.addObjRelation("TextDoc", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXDocumentIndex
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
new file mode 100644
index 000000000000..0fb1f22e78d5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XDocumentIndexMark;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.DocumentIndexMark</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::text::BaseIndexMark</code></li>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * <li> <code>com::sun::star::text::TextContent</code></li>
+ * <li> <code>com::sun::star::text::DocumentIndexMark</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.BaseIndexMark
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.TextContent
+ * @see com.sun.star.text.DocumentIndexMark
+ * @see ifc.lang._XComponent
+ * @see ifc.text._BaseIndexMark
+ * @see ifc.text._XTextContent
+ * @see ifc.text._TextContent
+ * @see ifc.text._DocumentIndexMark
+ */
+public class SwXDocumentIndexMark extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.DocumentIndexMark</code>, attaches text to
+ * created DocumentIndexMark, and inserts DocumentIndexMark to the
+ * text document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ Object oDIM = null;
+ Object instance = null;
+ try {
+ oDIM = oDocMSF.createInstance
+ ("com.sun.star.text.DocumentIndexMark");
+ instance = oDocMSF.createInstance
+ ("com.sun.star.text.DocumentIndexMark");
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error:" + e);
+ }
+
+ XDocumentIndexMark xDIM = (XDocumentIndexMark)
+ UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM);
+
+ try {
+ oText.insertTextContent(oCursor, xDIM, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Couldn't insert the DocumentIndexMark", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(xDIM);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ } // finish class SwXDocumentIndexMark
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
new file mode 100644
index 000000000000..fbe2156932e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XDocumentIndexesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for the object, which is represented by collection of document indexes.
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ */
+public class SwXDocumentIndexes extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.ContentIndex</code>, then created content index is
+ * inserted to the text document, and finally all document indexes are gotten
+ * from a text document using <code>XDocumentIndexesSupplier</code> interface.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ log.println( "creating a test environment" );
+ XTextContent xTC = null;
+
+ try {
+ xTC = SOF.createIndex(xTextDoc,"com.sun.star.text.ContentIndex");
+ }
+ catch ( com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create the Index", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the Index into text document");
+ try {
+ oText.insertTextContent(oCursor, xTC, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the Index", e);
+ }
+
+ XDocumentIndexesSupplier xDocInd = (XDocumentIndexesSupplier)
+ UnoRuntime.queryInterface(XDocumentIndexesSupplier.class,xTextDoc);
+
+ oObj = xDocInd.getDocumentIndexes();
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXDocumentIndexes
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java b/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java
new file mode 100644
index 000000000000..306d8956737e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.DrawPage</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+ * <li> <code>com::sun::star::drawing::XShapes</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::drawing::XMasterPageTarget</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.drawing.GenericDrawPage
+ * @see com.sun.star.drawing.XShapeBinder
+ * @see com.sun.star.drawing.XShapeGrouper
+ * @see com.sun.star.drawing.XShapes
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.drawing.XMasterPageTarget
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.drawing.XShapeCombiner
+ * @see ifc.drawing._GenericDrawPage
+ * @see ifc.drawing._XShapeBinder
+ * @see ifc.drawing._XShapeGrouper
+ * @see ifc.drawing._XShapes
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.drawing._XMasterPageTarget
+ * @see ifc.container._XNamed
+ * @see ifc.drawing._XShapeCombiner
+ */
+public class SwXDrawPage extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After
+ * obtaining DrawPage object several shapes are inserted to it.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes} : shape creator. </li>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeBinder},
+ * {@link ifc.drawing._XShapeCombiner},
+ * {@link ifc.drawing._XShapeGrouper} : DrawPage component we are
+ * testing.</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XDrawPageSupplier XDPSupp;
+ XDrawPage xDP = null;
+ XShapes oShapes = null;
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ XDPSupp = (XDrawPageSupplier) UnoRuntime.queryInterface
+ (XDrawPageSupplier.class, xTextDoc);
+ xDP = XDPSupp.getDrawPage();
+ oObj = xDP;
+
+ //dbg.printInterfaces(oObj);
+ //System.exit(0);
+
+ log.println( "inserting some Shapes" );
+ oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oObj);
+ oShapes.add(SOF.createShape(xTextDoc,2000,1500,1000,1000,"Line"));
+ oShapes.add(SOF.createShape(xTextDoc,3000,4500,15000,1000,"Ellipse"));
+ oShapes.add(SOF.createShape(xTextDoc,5000,3500,7500,5000,"Rectangle"));
+
+ log.println( "creating a new environment for bodytext object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ ShapeDsc sDsc = new ShapeDsc(15000,13500,7500,10000,"Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xTextDoc, sDsc));
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXDrawPage
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
new file mode 100644
index 000000000000..603a01d53677
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.dbg;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XEndnotesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.FootnoteSettings</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::FootnoteSettings</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.FootnoteSettings
+ * @see ifc.text._FootnoteSettings
+ */
+public class SwXEndnoteProperties extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.Endnote</code>. Then created endnote is inserted
+ * to the text document, and finally endnote settings are gotten from text
+ * document using <code>XEndnotesSupplier</code> interface.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XEndnotesSupplier oInterface = null;
+ XInterface oObj = null;
+ XInterface oEndnote;
+
+ log.println( "Creating a test environment" );
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a endnote");
+ try {
+ oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class,
+ msf.createInstance("com.sun.star.text.Endnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create endnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ XTextContent xTC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oEndnote);
+ try {
+ oText.insertTextContent(oCursor, xTC, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the endnote", e);
+ }
+
+ oInterface = (XEndnotesSupplier)
+ UnoRuntime.queryInterface(XEndnotesSupplier.class, xTextDoc);
+ oObj = oInterface.getEndnoteSettings();
+ dbg.printPropertiesNames((XPropertySet) oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
new file mode 100644
index 000000000000..83cef6f8fc4d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XDependentTextField;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XEnumeration</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XEnumeration
+ * @see ifc.container._XEnumeration
+ */
+public class SwXFieldEnumeration extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. FieldMaster
+ * object is created and attached to Bibliography database. After setting
+ * properties of created FieldMaster object, it is attached to the TextField
+ * object. Then TextField is inserted as TextContent to the text document.
+ * At the end, TextFields of text document are obtained and
+ * enumeration of these fields is created.<br>
+ * Creates instances of the services:
+ * <code>com.sun.star.text.FieldMaster.Database</code>,
+ * <code>com.sun.star.text.TextField.Database</code>.<br>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ENUM'</code> for
+ * {@link ifc.container._XEnumeration} : text fields</li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ Object FieldMaster = null;
+ XPropertySet PFieldMaster = null;
+ XDependentTextField xTF = null;
+ XEnumerationAccess xFEA = null;
+ XText the_Text;
+ XTextCursor the_Cursor;
+ XTextContent the_Field;
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc );
+
+ try {
+ FieldMaster = oDocMSF.createInstance
+ ( "com.sun.star.text.FieldMaster.Database" );
+ PFieldMaster = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class,(XInterface) FieldMaster);
+ oObj = (XInterface)
+ oDocMSF.createInstance("com.sun.star.text.TextField.Database");
+ xTF = (XDependentTextField)
+ UnoRuntime.queryInterface(XDependentTextField.class,oObj);
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ }
+
+ try {
+ PFieldMaster.setPropertyValue("DataBaseName","Bibliography");
+ PFieldMaster.setPropertyValue("DataTableName","biblio");
+ PFieldMaster.setPropertyValue("DataColumnName","Address");
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: can't set PropertyValue to a FieldMaster");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error: can't set PropertyValue to a FieldMaster");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ log.println("Error: can't set PropertyValue to a FieldMaster");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ log.println("Error: can't set PropertyValue to a FieldMaster");
+ e.printStackTrace(log);
+ }
+
+ the_Text = xTextDoc.getText();
+ the_Cursor = the_Text.createTextCursor();
+ the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oObj);
+
+ try {
+ xTF.attachTextFieldMaster(PFieldMaster);
+ the_Text.insertTextContent(the_Cursor,the_Field,false);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create TextField", e );
+ }
+
+ // create testobject here
+ XTextFieldsSupplier oTFS = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc );
+ xFEA = oTFS.getTextFields();
+ oObj = oTFS.getTextFields().createEnumeration();
+
+ log.println( "creating a new environment for FieldEnumeration object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM", xFEA);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXFieldEnumeration
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java b/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java
new file mode 100644
index 000000000000..8d4a14b2759b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.FieldMaster.Database</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::TextFieldMaster</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.TextFieldMaster
+ * @see com.sun.star.text.FieldMaster.Database
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.text._TextFieldMaster
+ * @see ifc.beans._XPropertySet
+ */
+public class SwXFieldMaster extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.FieldMaster.Database</code>.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc );
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.FieldMaster.Database" );
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+ log.println( "creating a new environment for FieldMaster object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXFieldMaster
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnote.java b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
new file mode 100644
index 000000000000..1a21ad5cc25f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FrameDsc;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnote;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Footnote</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XFootnote</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::Footnote</code></li>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XFootnote
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.Footnote
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XFootnote
+ * @see ifc.lang._XComponent
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._Footnote
+ * @see ifc.text._XTextContent
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XText
+ */
+public class SwXFootnote extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.Footnote</code>. Then inserts created footnote
+ * to a text of document as content.
+ * Object relations created :
+ * <ul>
+ * <li><code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XFootnote oFootnote;
+
+ log.println( "Creating a test environment" );
+ // get a soffice factory object
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a footnote");
+ Object instance = null;
+ try {
+ oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ instance = msf.createInstance("com.sun.star.text.Footnote");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create footnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ try {
+ oText.insertTextContent(oCursor, oFootnote, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the footnote", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oFootnote);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ log.println( "adding InstDescriptor object" );
+ FrameDsc tDsc = new FrameDsc( 3000, 6000 );
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ return tEnv;
+ }
+
+} // finish class SwXFootnote
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
new file mode 100644
index 000000000000..95c73e4d1249
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnote;
+import com.sun.star.text.XFootnotesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for the object, which is represented as set of footnote properties
+ * (instance of <code>com.sun.star.text.FootnoteSettings</code> service).
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::FootnoteSettings</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.FootnoteSettings
+ * @see ifc.text._FootnoteSettings
+ */
+public class SwXFootnoteProperties extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.Footnote</code>. Then inserts created Footnote
+ * to the text document, and finally gets footnote settings from text
+ * document through <code>XFootnotesSupplier</code> interface.<br>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XFootnotesSupplier oInterface = null;
+ XInterface oObj = null;
+ XFootnote oFootnote;
+
+ log.println( "Creating a test environment" );
+ // get a soffice factory object
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a footnote");
+
+ try {
+ oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create footnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ try {
+ oText.insertTextContent(oCursor, oFootnote, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the footnote", e);
+ }
+
+ oInterface = (XFootnotesSupplier)
+ UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc);
+ oObj = oInterface.getFootnoteSettings();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
new file mode 100644
index 000000000000..a9c7ee4908d1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TextSectionDsc;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnote;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextRangeMover</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XRelativeTextContentInsert</code></li>
+ * <li> <code>com::sun::star::text::XTextRangeCompare</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextRangeMover
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XRelativeTextContentInsert
+ * @see com.sun.star.text.XTextRangeCompare
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XTextRangeMover
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XRelativeTextContentInsert
+ * @see ifc.text._XTextRangeCompare
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.text._XText
+ */
+public class SwXFootnoteText extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.Footnote</code>. Then inserts created Footnote
+ * to the text, and finally sets a string to the footnote. Then the text
+ * gotten from the footnote is returned as tested component.<br>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TEXT'</code> for
+ * {@link ifc.text._XTextRangeCompare} : footnote text</li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert},
+ * {@link ifc.text._XText} : text section creator</li>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert} : paragraph creator</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XFootnote oFootnote;
+
+ log.println( "creating a test environment" );
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a footnote");
+
+ try {
+ oFootnote = (XFootnote)UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create footnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ try {
+ oText.insertTextContent(oCursor, oFootnote, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the footnote", e);
+ }
+
+ XSimpleText oFootText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, oFootnote);
+ oFootText.setString("SwXFootnoteText");
+
+ oObj = oFootText.getText();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXT", (XText) oObj);
+
+ TextSectionDsc tDsc = new TextSectionDsc();
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ log.println( " adding Paragraph" );
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator( xTextDoc, pDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXFootnoteText
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
new file mode 100644
index 000000000000..ecb9b6494550
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnote;
+import com.sun.star.text.XFootnotesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Footnotes</code>.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ */
+public class SwXFootnotes extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.Footnote</code>. Then inserts created Footnote
+ * to the text, and finally gets all footnotes of text document
+ * through <code>XFootnotesSupplier</code> interface.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XFootnotesSupplier oInterface = null;
+ XInterface oObj = null;
+
+ log.println( "Creating a test environment" );
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ log.println("creating a footnote");
+ XFootnote oFootnote;
+
+ try {
+ oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class,
+ msf.createInstance("com.sun.star.text.Footnote"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create footnote", e);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting the footnote into text document");
+ try {
+ oText.insertTextContent(oCursor, oFootnote, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert the footnote", e);
+ }
+ oInterface = (XFootnotesSupplier)
+ UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc);
+ oObj = oInterface.getFootnotes();
+
+ log.println( "creating a new environment for Foontnotes object" );
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ }
+
+} // finish class SwXFootnote
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXFrames.java b/qadevOOo/tests/java/mod/_sw/SwXFrames.java
new file mode 100644
index 000000000000..320ca60cd2cd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFrames.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.text.XTextFramesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XContainer</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XContainer
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see ifc.container._XContainer
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ */
+public class SwXFrames extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.TextFrame</code>. Then inserts created text frame
+ * to the text, and finally gets all frames of text document using
+ * <code>XTextFramesSupplier</code> interface.<br>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XTextFrame oFrame1 = null;
+ XText oText = null;
+ XTextCursor oCursor = null;
+ XMultiServiceFactory oDocMSF = null;
+ XTextFramesSupplier oInterface = null;
+
+ log.println( "creating a test environment" );
+ try {
+ oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ Object oInt = oDocMSF.createInstance("com.sun.star.text.TextFrame");
+ oFrame1 = (XTextFrame)
+ UnoRuntime.queryInterface( XTextFrame.class, oInt );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Couldn't create instance of TextFrame", e);
+ }
+
+ oText = xTextDoc.getText();
+ oCursor = oText.createTextCursor();
+
+ try {
+ oText.insertTextContent(oCursor, oFrame1, false);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Error: can't insert text content to text document", e);
+ }
+
+ oInterface = (XTextFramesSupplier)
+ UnoRuntime.queryInterface( XTextFramesSupplier.class, xTextDoc );
+
+ oObj = oInterface.getTextFrames();
+
+ log.println( "creating a new environment for Frame object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXFrames
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
new file mode 100644
index 000000000000..371e125780c3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextRangeMover</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XRelativeTextContentInsert</code></li>
+ * <li> <code>com::sun::star::text::XTextRangeCompare</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextRangeMover
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XRelativeTextContentInsert
+ * @see com.sun.star.text.XTextRangeCompare
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XTextRangeMover
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XRelativeTextContentInsert
+ * @see ifc.text._XTextRangeCompare
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.text._XText
+ */
+public class SwXHeadFootText extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. At first
+ * style families are obtained from text document, then style 'Standard' has
+ * gotten from style family 'PageStyles'. At the end, document header and
+ * footer are switched on and document text is obtained.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert},
+ * {@link ifc.text._XText} : creates tables 6x4</li>
+ * <li> <code>'TEXTDOC'</code> for
+ * {@link ifc.text._XTextRangeCompare} : text document</li>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert} : paragraph creator</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ log.println( "creating a test environment" );
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+
+ // obtains style 'Standatd' from style family 'PageStyles'
+ try {
+ PageStyles = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
+ StdStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),PageStyles.getByName("Standard"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error, no such style name! ", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Error getting style by name!", e);
+ }
+
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, StdStyle);
+
+ // changing/getting some properties
+ try {
+ log.println( "Switching on header" );
+ PropSet.setPropertyValue("HeaderIsOn", new Boolean(true));
+ log.println( "Switching on footer" );
+ PropSet.setPropertyValue("FooterIsOn", new Boolean(true));
+ log.println( "Get header text" );
+ oObj = (XText) UnoRuntime.queryInterface(
+ XText.class, PropSet.getPropertyValue("HeaderText"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set/get propertyValue...", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set/get propertyValue...", e);
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set/get propertyValue...", e);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set/get propertyValue...", e);
+ }
+
+ log.println( "creating a new environment for bodytext object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( " adding Paragraph" );
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator( xTextDoc, pDsc ) );
+
+ log.println( "adding InstDescriptor object" );
+ TableDsc tDsc = new TableDsc( 6, 4 );
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ tEnv.addObjRelation( "TEXT", oObj);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXHeadFootText
diff --git a/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java b/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java
new file mode 100644
index 000000000000..1fac0d2747d0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.dbg;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XLineNumberingProperties;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.LineNumberingProperties</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::LineNumberingProperties</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.LineNumberingProperties
+ * @see ifc.text._LineNumberingProperties
+ */
+public class SwXLineNumberingProperties extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After inserting
+ * string and control character to the text document, line numbering
+ * properties are gotten using <code>XLineNumberingProperties</code> interface.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ // insert some Text
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ try {
+ for (int i=0; i<5; i++) {
+ oText.insertString(oCursor, "The quick brown fox jumps "+
+ "over the lazy Dog", false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ log.println("Exception occured: " + e);
+ }
+
+ XLineNumberingProperties oLNP = (XLineNumberingProperties)
+ UnoRuntime.queryInterface(XLineNumberingProperties.class,xTextDoc);
+ XPropertySet lineNumProps = oLNP.getLineNumberingProperties();
+ dbg.printPropertiesNames(lineNumProps);
+ TestEnvironment tEnv = new TestEnvironment(lineNumProps);
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXLineNumberingProperties
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
new file mode 100644
index 000000000000..b97baff7ec72
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
@@ -0,0 +1,439 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.NamedValue;
+
+import util.DBTools;
+import util.utils;
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdbc.*;
+import com.sun.star.sdbcx.XRowLocate;
+import com.sun.star.task.XJob;
+import com.sun.star.text.MailMergeType;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+* Here <code>com.sun.star.text.MailMerge</code> service is tested.<p>
+* @see com.sun.star.text.MailMerge
+* @see com.sun.star.task.XJob
+* @see com.sun.star.text.XMailMergeBroadcaster
+*/
+public class SwXMailMerge extends TestCase {
+
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ if (! Param.containsKey("uniqueSuffix")){
+ Param.put("uniqueSuffix", new Integer(0));
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. <p>
+ * Creates <code>MailMerge</code> service * Object relations created :
+ * <ul>
+ * <li> <code>'executeArgs'</code> for
+ * {@link ifc.text._XMailMergeBroadcaster} : NamedValue[]</li>
+ * <li> <code>'Job'</code> for
+ * {@link ifc.text._XMailMergeBroadcaster} : XJob</li>
+ * <li> <code>'XJobArgs'</code> for
+ * {@link ifc.task._XJob} : Object[]</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface oRowSet = null;
+ Object oConnection = null;
+ XJob Job = null;
+
+ log.println(" instantiate MailMerge service");
+ try {
+ oObj = (XInterface) ( (XMultiServiceFactory) Param.getMSF()).createInstance
+ ("com.sun.star.text.MailMerge");
+ } catch (Exception e) {
+ throw new StatusException("Can't create object environment", e) ;
+ }
+
+ // <set some variables>
+ String cTestDoc = utils.getFullTestURL("MailMerge.sxw");
+ //cMailMerge_DocumentURL = cTestDoc
+ String cOutputURL = utils.getOfficeTemp( (XMultiServiceFactory) Param.getMSF());
+ String cDataSourceName = "Bibliography";
+ String cDataCommand = "biblio";
+ Object[] sel = new Object[2];
+ sel[0] = new int[2];
+ sel[1] = new int[5];
+ Object[] myBookMarks = new Object[2];
+ // </set some variables>
+
+ // <create XResultSet>
+ log.println("create a XResultSet");
+ try {
+ oRowSet = (XInterface) ( (XMultiServiceFactory) Param.getMSF()).createInstance
+ ("com.sun.star.sdb.RowSet");
+ } catch (Exception e) {
+ throw new StatusException("Can't create com.sun.star.sdb.RowSet", e);
+ }
+ XPropertySet oRowSetProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oRowSet);
+ XRowSet xRowSet = (XRowSet)
+ UnoRuntime.queryInterface(XRowSet.class, oRowSet);
+ try {
+ oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName);
+ oRowSetProps.setPropertyValue("Command",cDataCommand);
+ oRowSetProps.setPropertyValue("CommandType", new Integer(CommandType.TABLE));
+ } catch (UnknownPropertyException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (PropertyVetoException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (IllegalArgumentException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (WrappedTargetException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ }
+ try {
+ xRowSet.execute();
+ } catch (SQLException e) {
+ throw new StatusException("Can't execute oRowSet", e);
+ }
+
+ XResultSet oResultSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oRowSet);
+
+
+
+
+ // <create Bookmarks>
+ log.println("create bookmarks");
+ try {
+ XRowLocate oRowLocate = (XRowLocate) UnoRuntime.queryInterface(
+ XRowLocate.class, oResultSet);
+ oResultSet.first();
+ myBookMarks[0] = oRowLocate.getBookmark();
+ oResultSet.next();
+ myBookMarks[1] = oRowLocate.getBookmark();
+ } catch (SQLException e) {
+ throw new StatusException("Cant get Bookmarks", e);
+ }
+ // </create Bookmarks>
+
+ // <fill object with values>
+
+ log.println("fill MailMerge with default connection");
+
+ XPropertySet oObjProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ try {
+ oObjProps.setPropertyValue("ActiveConnection", getLocalXConnection(Param));
+ oObjProps.setPropertyValue("DataSourceName", cDataSourceName);
+ oObjProps.setPropertyValue("Command", cDataCommand);
+ oObjProps.setPropertyValue("CommandType", new Integer(CommandType.TABLE));
+ oObjProps.setPropertyValue("OutputType", new Short(MailMergeType.FILE));
+ oObjProps.setPropertyValue("DocumentURL", cTestDoc);
+ oObjProps.setPropertyValue("OutputURL", cOutputURL);
+ oObjProps.setPropertyValue("FileNamePrefix", "Author");
+ oObjProps.setPropertyValue("FileNameFromColumn", new Boolean(false));
+ oObjProps.setPropertyValue("Selection", new Object[0]);
+
+ } catch (UnknownPropertyException e) {
+ throw new StatusException("Can't set properties on oObj", e);
+ } catch (PropertyVetoException e) {
+ throw new StatusException("Can't set properties on oObj", e);
+ } catch (IllegalArgumentException e) {
+ throw new StatusException("Can't set properties on oObj", e);
+ } catch (WrappedTargetException e) {
+ throw new StatusException("Can't set properties on oObj", e);
+ }
+ // </fill object with values>
+
+
+ // <create object relations>
+ Object[] vXJobArgs = new Object[4];
+ NamedValue[] vXJobArg0 = new NamedValue[8];
+ NamedValue[] vXJobArg1 = new NamedValue[7];
+ NamedValue[] vXJobArg2 = new NamedValue[10];
+ NamedValue[] vXJobArg3 = new NamedValue[0];
+
+ // first Arguments
+ vXJobArg0[0] = new NamedValue("DataSourceName", cDataSourceName);
+ vXJobArg0[1] = new NamedValue("Command", cDataCommand);
+ vXJobArg0[2] = new NamedValue("CommandType",new Integer(CommandType.TABLE));
+ vXJobArg0[3] = new NamedValue("OutputType",new Short(MailMergeType.FILE));
+ vXJobArg0[4] = new NamedValue("DocumentURL", cTestDoc);
+ vXJobArg0[5] = new NamedValue("OutputURL", cOutputURL);
+ vXJobArg0[6] = new NamedValue("FileNamePrefix", "Identifier");
+ vXJobArg0[7] = new NamedValue("FileNameFromColumn", new Boolean(true));
+
+ //second Arguments
+ vXJobArg1[0] = new NamedValue("DataSourceName", cDataSourceName);
+ vXJobArg1[1] = new NamedValue("Command", cDataCommand);
+ vXJobArg1[2] = new NamedValue("CommandType",new Integer(CommandType.TABLE));
+ vXJobArg1[3] = new NamedValue("OutputType",
+ new Short(MailMergeType.PRINTER));
+ vXJobArg1[4] = new NamedValue("DocumentURL", cTestDoc);
+ vXJobArg1[5] = new NamedValue("FileNamePrefix", "Author");
+ vXJobArg1[6] = new NamedValue("FileNameFromColumn", new Boolean(true));
+
+ // third Arguments
+ vXJobArg2[0] = new NamedValue("ActiveConnection", getLocalXConnection(Param));
+ vXJobArg2[1] = new NamedValue("DataSourceName", cDataSourceName);
+ vXJobArg2[2] = new NamedValue("Command", cDataCommand);
+ vXJobArg2[3] = new NamedValue("CommandType",new Integer(CommandType.TABLE));
+ vXJobArg2[4] = new NamedValue("OutputType",
+ new Short(MailMergeType.FILE));
+ vXJobArg2[5] = new NamedValue("ResultSet", oResultSet);
+ vXJobArg2[6] = new NamedValue("OutputURL", cOutputURL);
+ vXJobArg2[7] = new NamedValue("FileNamePrefix", "Identifier");
+ vXJobArg2[8] = new NamedValue("FileNameFromColumn", new Boolean(true));
+ vXJobArg2[9] = new NamedValue("Selection", myBookMarks);
+
+ vXJobArgs[0] = vXJobArg0;
+ vXJobArgs[1] = vXJobArg1;
+ vXJobArgs[2] = vXJobArg2;
+ vXJobArgs[3] = vXJobArg3;
+
+
+ Job = (XJob) UnoRuntime.queryInterface(XJob.class, oObj);
+ try{
+ Job.execute(vXJobArg2);
+ } catch ( IllegalArgumentException e){
+ System.out.println(e.toString());
+ } catch ( Exception e){
+ System.out.println(e.toString());
+ }
+
+
+ // <create XResultSet>
+ log.println("create XResultSet");
+
+ try {
+ oRowSet = (XInterface) ( (XMultiServiceFactory) Param.getMSF()).createInstance
+ ("com.sun.star.sdb.RowSet");
+ } catch (Exception e) {
+ throw new StatusException("Can't create com.sun.star.sdb.RowSet", e);
+ }
+ oRowSetProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRowSet);
+
+ xRowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, oRowSet);
+
+ try {
+ oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName);
+ oRowSetProps.setPropertyValue("Command",cDataCommand);
+ oRowSetProps.setPropertyValue("CommandType", new Integer(CommandType.TABLE));
+ } catch (UnknownPropertyException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (PropertyVetoException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (IllegalArgumentException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ } catch (WrappedTargetException e) {
+ throw new StatusException("Can't set properties on oRowSet", e);
+ }
+ try {
+ xRowSet.execute();
+ } catch (SQLException e) {
+ throw new StatusException("Can't execute oRowSet", e);
+ }
+
+ oResultSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oRowSet);
+
+ XResultSet oMMXResultSet = null;
+ try {
+ oMMXResultSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class,
+ ( (XInterface)
+ ( (XMultiServiceFactory)
+ Param.getMSF()).createInstance("com.sun.star.sdb.RowSet")));
+
+ } catch (Exception e) {
+ throw new StatusException("Can't create com.sun.star.sdb.RowSet", e);
+ }
+ // </create object relations>
+
+ TestEnvironment tEnv = new TestEnvironment(oObj) ;
+
+ // <adding object relations>
+
+ // com.sun.star.sdb.DataAccessDescriptor
+ tEnv.addObjRelation("DataAccessDescriptor.XResultSet", oResultSet);
+ tEnv.addObjRelation("DataAccessDescriptor.XConnection", getRemoteXConnection(Param));
+
+ // com.sun.star.text.MailMaerge
+ tEnv.addObjRelation("MailMerge.XConnection", getRemoteXConnection(Param));
+ tEnv.addObjRelation("MailMerge.XResultSet", oMMXResultSet);
+
+ // com.sun.star.text.XMailMergeBroadcaster
+ tEnv.addObjRelation( "executeArgs", vXJobArg0);
+ tEnv.addObjRelation( "Job", Job);
+
+ // com.sun.star.task.XJob
+ tEnv.addObjRelation("XJobArgs", vXJobArgs);
+
+ // </adding object relations>
+
+ return tEnv ;
+ }
+
+ private XConnection getRemoteXConnection(TestParameters Param){
+
+ log.println("create remote connection");
+
+ String databaseName = null ;
+ XDataSource oXDataSource = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+ int uniqueSuffix = Param.getInt("uniqueSuffix");
+
+ try {
+ xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+
+ // retrieving temp directory for database
+ String tmpDatabaseUrl = utils.getOfficeTempDir((XMultiServiceFactory)Param.getMSF());
+
+ databaseName = "NewDatabaseSource" + uniqueSuffix ;
+
+ String tmpDatabaseFile = tmpDatabaseUrl + databaseName + ".odb";
+ System.out.println("try to delete '"+tmpDatabaseFile+"'");
+ utils.deleteFile(((XMultiServiceFactory) Param.getMSF()), tmpDatabaseFile);
+
+
+ tmpDatabaseUrl = "sdbc:dbase:file:///" + tmpDatabaseUrl ;
+
+ // Creating new DBase data source in the TEMP directory
+ XInterface newSource = (XInterface) xMSF.createInstance
+ ("com.sun.star.sdb.DataSource") ;
+
+ XPropertySet xSrcProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, newSource);
+
+ xSrcProp.setPropertyValue("URL", tmpDatabaseUrl) ;
+
+ DBTools dbt = new DBTools( (XMultiServiceFactory)Param.getMSF(), log );
+ // registering source in DatabaseContext
+ log.println("register database '"+tmpDatabaseUrl+"' as '"+databaseName+"'" );
+ dbt.reRegisterDB(databaseName, newSource) ;
+
+ uniqueSuffix++;
+ Param.put("uniqueSuffix", new Integer(uniqueSuffix));
+
+ return dbt.connectToSource(newSource);
+ }
+ catch( Exception e ) {
+ uniqueSuffix++;
+ Param.put("uniqueSuffix", new Integer(uniqueSuffix));
+ log.println("could not register new database" );
+ e.printStackTrace();
+ throw new StatusException("could not register new database", e) ;
+ }
+ }
+
+ private XConnection getLocalXConnection(TestParameters Param){
+
+ log.println("create local connection");
+
+ XInterface oDataCont = null;
+ try {
+ oDataCont = (XInterface)( (XMultiServiceFactory) Param.getMSF()).createInstance
+ ("com.sun.star.sdb.DatabaseContext");
+ } catch(Exception e) {
+ throw new StatusException("Couldn't create instance of 'com.sun.star.sdb.DatabaseContext'", e);
+ }
+ XNameAccess xNADataCont = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oDataCont);
+
+ String[] dataNames = xNADataCont.getElementNames();
+
+ String dataName="";
+ for (int i = 0; i < dataNames.length; i++){
+ if (dataNames[i].startsWith("Biblio")) dataName=dataNames[i];
+ }
+
+ try{
+
+ Object oDataBase = xNADataCont.getByName(dataName);
+ XDataSource xDataSource = (XDataSource)
+ UnoRuntime.queryInterface(XDataSource.class, oDataBase);
+
+ return xDataSource.getConnection("","");
+
+ } catch ( NoSuchElementException e){
+ throw new StatusException("Couldn't get registered data base", e);
+ } catch ( WrappedTargetException e){
+ throw new StatusException("Couldn't get registered data base", e);
+ } catch ( SQLException e){
+ throw new StatusException("Couldn't get XConnection from registered data base", e);
+ }
+
+ }
+
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("closing connections...");
+ XMultiServiceFactory xMsf = (XMultiServiceFactory) Param.getMSF();
+ DBTools dbt = new DBTools( xMsf, log );
+
+ if (Param.containsKey("uniqueSuffix")){
+ int uniqueSuffix = Param.getInt("uniqueSuffix");
+ uniqueSuffix--;
+ String databaseName = "";
+ while (uniqueSuffix >= 0){
+
+ databaseName = "NewDatabaseSource" + uniqueSuffix ;
+
+ log.println("revoke '"+databaseName+"'");
+
+ try{
+ dbt.revokeDB(databaseName);
+ } catch (com.sun.star.uno.Exception e){
+ }
+
+ uniqueSuffix--;
+ }
+ }
+
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXModule.java b/qadevOOo/tests/java/mod/_sw/SwXModule.java
new file mode 100644
index 000000000000..c8398b9d7b9d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXModule.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.GlobalSettings</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::view::XPrintSettingsSupplier</code></li>
+ * <li> <code>com::sun::star::view::XViewSettingsSupplier</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.view.XPrintSettingsSupplier
+ * @see com.sun.star.view.XViewSettingsSupplier
+ * @see ifc.view._XPrintSettingsSupplier
+ * @see ifc.view._XViewSettingsSupplier
+ */
+public class SwXModule extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.GlobalSettings</code>.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance(
+ "com.sun.star.text.GlobalSettings" );
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ throw new StatusException("Service not available", e) ;
+ }
+
+ if (oInterface == null) {
+ log.println("Service wasn't created") ;
+ throw new StatusException("Service wasn't created",
+ new NullPointerException()) ;
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXModule
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java
new file mode 100644
index 000000000000..30dbe80c7810
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.NumberingRules</code>.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::text::NumberingRules</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.text.NumberingRules
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.text._NumberingRules
+ */
+public class SwXNumberingRules extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * At first some strings are inserted to a text document, then style families
+ * are gotten from text document using <code>XStyleFamiliesSupplier</code>.
+ * Then style family 'NuberingRules' is retrieved, then style indexed '0'
+ * is obtained. At the end property value 'NumberingRules' is obtained from
+ * given style.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XInterface oObj = null;
+ XIndexAccess NumStyleI = null;
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ try {
+ for (int i=0; i<5; i++) {
+ oText.insertString(oCursor, "The quick brown fox jumps "+
+ "over the lazy Dog", false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ }
+
+ XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+
+ try {
+ XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies();
+ XNameContainer NumStyles = (XNameContainer) AnyConverter.toObject(
+ new Type(XNameContainer.class),
+ oStyleFamilies.getByName("NumberingStyles"));
+ NumStyleI = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,NumStyles);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Error, no such style family...");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ }
+
+ Object instance1 = null;
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),NumStyleI.getByIndex(0));
+ XPropertySet props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),props.getPropertyValue("NumberingRules"));
+ XIndexAccess nRules = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, props.getPropertyValue("NumberingRules"));
+ instance1 = nRules.getByIndex(0);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("INSTANCE1", instance1);
+ return tEnv;
+ }
+
+} // finish class SwXNumberingRules
diff --git a/qadevOOo/tests/java/mod/_sw/SwXParagraph.java b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java
new file mode 100644
index 000000000000..6bb88deb14b3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Paragraph</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * <li> <code>com::sun::star::text::TextContent</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.TextContent
+ * @see com.sun.star.style.CharacterPropertiesComplex
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.style.CharacterPropertiesAsian
+ * @see com.sun.star.text.Paragraph
+ * @see ifc.text._XTextContent
+ * @see ifc.text._TextContent
+ * @see ifc.style._CharacterPropertiesComplex
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.beans._XPropertyState
+ * @see ifc.style._CharacterProperties
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.lang._XComponent
+ * @see ifc.style._CharacterPropertiesAsian
+ */
+public class SwXParagraph extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. To obtain
+ * test component, at first several paragraphs are inserted to a major text
+ * of text document. Then enumeration of text paragraphs is created, and
+ * some paragraph is gotten using <code>XEnumeration</code> interface.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.style._CharacterProperties} : paragraph </li>
+ * <li> <code>'PORTION'</code> for
+ * {@link ifc.style._CharacterProperties} : some text portion of
+ * paragraph. To obtain text portion, enumeration of paragraph text portions is
+ * created, and some text portion is gotten using <code>XEnumeration</code>
+ * interface. </li>
+ * <li> <code>'NRULES'</code> for
+ * {@link ifc.style._ParagraphProperties} : value of property
+ * 'NumberingRules' of paragraph. Method changes property
+ * 'NumberingStyleName' of previously obtained paragraph, and gets value of
+ * a property 'NumberingRules'. </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ if (xTextDoc != null) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ XInterface oObj = null;
+ XPropertySet paraP = null;
+ XPropertySet portP = null;
+ Object nRules = null;
+ XInterface port = null;
+ XInterface para = null;
+
+ log.println( "creating a test environment" );
+
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting some lines" );
+ try {
+ for (int i=0; i<5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't insert lines", e );
+ }
+
+ // Enumeration
+ XEnumerationAccess oEnumA = (XEnumerationAccess)
+ UnoRuntime.queryInterface(XEnumerationAccess.class, oText );
+ XEnumeration oEnum = oEnumA.createEnumeration();
+
+ try {
+ para = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ XEnumerationAccess oEnumB = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, para );
+ XEnumeration oEnum2 = oEnumB.createEnumeration();
+ port = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum2.nextElement());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ log.println("Error: exception occured...");
+ }
+
+ try {
+ portP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, port);
+ paraP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, para);
+ paraP.setPropertyValue("NumberingStyleName","Numbering 4");
+ nRules = paraP.getPropertyValue("NumberingRules");
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ }
+
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ } catch ( Exception e) {
+ log.println("Error, exception occured...");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ }
+
+
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println("adding ObjectRelation 'PARA' for CharacterProperties");
+ tEnv.addObjRelation("PARA", paraP);
+
+ log.println("adding ObjectRelation 'PORTION' for CharacterProperties");
+ tEnv.addObjRelation("PORTION", portP);
+
+ log.println("adding ObjectRelation 'NRULES' for ParagraphProperties");
+ tEnv.addObjRelation("NRULES", nRules);
+
+ tEnv.addObjRelation("NoAttach","SwXParagraph");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXParagraph
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java
new file mode 100644
index 000000000000..144b76dcb151
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.ParagraphEnumeration</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XEnumeration</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XEnumeration
+ * @see ifc.container._XEnumeration
+ */
+public class SwXParagraphEnumeration extends TestCase {
+ XTextDocument xTextDoc = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After major
+ * text is gotten from a text document, three paragraphs (each of them
+ * filled by 5 strings) are inserted to major text. Finally, paragraph
+ * enumeration is created using <code>XEnumeration</code> interface.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'ENUM'</code> for
+ * {@link ifc.container._XEnumeration} : major text of text document
+ * with several paragraphs inserted, queried to
+ * <code>XEnumerationAccess</code> interface.</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ for (int i=0; i<3; i++) {
+ try {
+ oText.insertString( oCursor, "Paragraph Number: " + i, false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.LINE_BREAK, false );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ log.println( "EXCEPTION: " + e);
+ }
+
+ for (int j=0; j<5; j++){
+ try {
+ oText.insertString( oCursor,"The quick brown fox jumps"+
+ " over the lazy Dog: SwXParagraph", false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.LINE_BREAK, false );
+ oText.insertString( oCursor, "THE QUICK BROWN FOX JUMPS"+
+ " OVER THE LAZY DOG: SwXParagraph", false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.LINE_BREAK, false );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ log.println( "EXCEPTION: " + e);
+ }
+ }
+
+ try {
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ log.println( "EXCEPTION: " + e);
+ }
+ }
+
+ // Enumeration
+ XEnumerationAccess oEnumA = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, oText );
+ XEnumeration oEnum = oEnumA.createEnumeration();
+
+ oObj = oEnum;
+
+ log.println("creating a new environment for ParagraphEnumeration object");
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM", oEnumA);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXParagraphEnumeration
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java b/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java
new file mode 100644
index 000000000000..b95661e2308f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XPrintSettingsSupplier;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.PrintSettings</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::PrintSettings</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.PrintSettings
+ * @see ifc.text._PrintSettings
+ */
+public class SwXPrintSettings extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.GlobalSettings</code>, then print settings are
+ * gotten using <code>XPrintSettingsSupplier</code> interface.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ Object oInst = null;
+
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory myMSF = (XMultiServiceFactory)tParam.getMSF();
+ oInst = myMSF.createInstance("com.sun.star.text.GlobalSettings");
+ } catch ( com.sun.star.uno.Exception e ){
+ log.println("Couldn't create instance!" + e);
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create instance!", e );
+ }
+ XPrintSettingsSupplier xPSS = (XPrintSettingsSupplier)
+ UnoRuntime.queryInterface(XPrintSettingsSupplier.class, oInst);
+ oObj = xPSS.getPrintSettings();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXPrintSettings
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXPropertySet.java b/qadevOOo/tests/java/mod/_sw/SwXPropertySet.java
new file mode 100644
index 000000000000..ca2fb30118c2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPropertySet.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+
+/**
+ * Test for object which is represented by text document.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.beans._XPropertySet
+ */
+public class SwXPropertySet extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Method creates text document as a test component.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create text document", e );
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( xTextDoc );
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXPropertySet
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java b/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java
new file mode 100644
index 000000000000..a07d6993cadc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by PropertySetInfo of
+ * text document.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::beans::XPropertySetInfo</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.beans.XPropertySetInfo
+ * @see ifc.beans._XPropertySetInfo
+ */
+public class SwXPropertySetInfo extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. Method
+ * creates text document, then obtains PropertySetInfo of created text
+ * document using <code>XPropertySet</code> interface.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ log.println( " getting the XPropertySetInfo" );
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xTextDoc);
+ oObj = xProp.getPropertySetInfo();
+ log.println( " creating a new environment for PropertySetInfo object" );
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXPropertySetInfo
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java
new file mode 100644
index 000000000000..bc5ff71ca784
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.ReferenceMark</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::text::XTextContent</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.ReferenceMark
+ * @see ifc.container._XNamed
+ * @see ifc.lang._XComponent
+ * @see ifc.text._XTextContent
+ */
+public class SwXReferenceMark extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.ReferenceMark</code>, then sets new
+ * name of created ReferenceMark using <code>XNamed</code> interface.
+ * Finally, renamed ReferenceMark is inserted to a major text of text
+ * document as a text content.
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ XText oText = null;
+ String Name = "SwXReferenceMark";
+
+ log.println( "creating a test environment" );
+ oText = xTextDoc.getText();
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ Object instance = null;
+ try {
+ oObj = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.ReferenceMark");
+ instance = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.ReferenceMark");
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get ReferenceMark", e);
+ }
+
+ XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
+ oObjN.setName(Name);
+ XTextContent oObjTC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oObj);
+
+ XTextCursor oCursor = oText.createTextCursor();
+ try {
+ oText.insertTextContent(oCursor, oObjTC, false);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace( log );
+ throw new StatusException(" Couldn't insert ReferenceMark", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXReferenceMark
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java b/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java
new file mode 100644
index 000000000000..13afc17e67ba
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XReferenceMarksSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.ReferenceMarks</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.text.ReferenceMarks
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ */
+public class SwXReferenceMarks extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instances of the service
+ * <code>com.sun.star.text.ReferenceMark</code>, then sets new names to
+ * created ReferenceMark's using <code>XNamed</code> interface. Then renamed
+ * ReferenceMark's are inserted to a major text of text document. Finally,
+ * ReferenceMarks are gotten from text document using
+ * <code>XReferenceMarksSupplier</code> interface.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XText oText = null;
+ String Name = "SwXReferenceMark01";
+ String Name2 = "SwXReferenceMark02";
+
+ log.println( "creating a test environment" );
+ oText = xTextDoc.getText();
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ // Creation and insertion of ReferenceMark01
+ try {
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.ReferenceMark" );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get ReferenceMark", e);
+ }
+ XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
+ oObjN.setName(Name);
+ XTextContent oObjTC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oObj);
+ XTextCursor oCursor = oText.createTextCursor();
+ try {
+ oText.insertTextContent(oCursor, oObjTC, false);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace( log );
+ throw new StatusException(" Couldn't insert ReferenceMark01", e);
+ }
+
+ // Creation and insertion of ReferenceMark02
+ try {
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.ReferenceMark" );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get ReferenceMark", e);
+ }
+ XNamed oObjN2 = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
+ oObjN2.setName(Name2);
+
+ XTextContent oObjTC2 = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oObj);
+ try {
+ oText.insertTextContent(oCursor, oObjTC2, false);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ e.printStackTrace( log );
+ throw new StatusException(" Couldn't insert ReferenceMark02", e);
+ }
+
+ // getting ReferenceMarks from text document
+ XReferenceMarksSupplier oRefSupp = (XReferenceMarksSupplier)
+ UnoRuntime.queryInterface(XReferenceMarksSupplier.class, xTextDoc);
+ oObj = oRefSupp.getReferenceMarks();
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXReferenceMarks
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXShape.java b/qadevOOo/tests/java/mod/_sw/SwXShape.java
new file mode 100644
index 000000000000..6ea0f8041574
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXShape.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.Shape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._XShape
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.beans._XPropertySet
+ * @see ifc.drawing._Shape
+ */
+public class SwXShape extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. At first,
+ * DrawPage is gotten from text document using <code>XDrawPageSupplier</code>
+ * interface. Then shape (rectangle) is created and added to DrawPage
+ * obtained before, then returned as a test component.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XDrawPage oDP = null;
+ XShapes oShapes = null;
+
+ log.println( "creating a test environment" );
+ log.println( "getting Drawpage" );
+ XDrawPageSupplier oDPS = (XDrawPageSupplier)
+ UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDoc);
+ oDP = oDPS.getDrawPage();
+
+ log.println( "getting Shape" );
+ oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oDP);
+ oObj = SOF.createShape(xTextDoc,5000,3500,7500,5000,"Rectangle");
+ oShapes.add((XShape) oObj);
+
+ for ( int i = 0; i < 9; i++){
+ XInterface oShape = SOF.createShape(xTextDoc,
+ 5000 + 100*i,3500,7500,5000,"Rectangle");
+ oShapes.add((XShape) oShape);
+ }
+
+ log.println( "creating a new environment for XShape object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXShape
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyle.java b/qadevOOo/tests/java/mod/_sw/SwXStyle.java
new file mode 100644
index 000000000000..417080e22780
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyle.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.Style</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::style::Style</code></li>
+ * <li> <code>com::sun::star::style::XStyle</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.style.Style
+ * @see com.sun.star.style.XStyle
+ * @see ifc.container._XNamed
+ * @see ifc.style._Style
+ * @see ifc.style._XStyle
+ */
+public class SwXStyle extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * At first style families are gotten from a text document using
+ * <code>XStyleFamiliesSupplier</code> interface, then family indexed '0' is
+ * gotten from this style family using <code>XIndexAccess</code> interface.
+ * Next, method creates an instance of the service
+ * <code>com.sun.star.style.CharacterStyle</code> and inserts it to a
+ * previously obtained style family using <code>XNameContainer</code>
+ * interface. Finally, method creates a cursor of a major text of text
+ * document and sets it's property 'CharStyleName' value to the name of
+ * previously created style's name.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'PoolStyle'</code> for
+ * {@link ifc.style._XStyle} : slyle indexed '10' obtained from
+ * StyleFamily indexed '0' from text document using
+ * <code>XIndexAccess</code> interface.</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ TestEnvironment tEnv = null;
+ XNameAccess oSFNA = null;
+ XStyle oStyle = null;
+ XStyle oMyStyle = null;
+
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting style");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ XIndexAccess oSFsIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSF);
+ oSFNA = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),oSFsIA.getByIndex(0));
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oSFIA.getByIndex(10));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ try {
+ log.print("Creating a user-defined style... ");
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XInterface oInt = (XInterface)
+ oMSF.createInstance("com.sun.star.style.CharacterStyle");
+ oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt);
+ } catch ( com.sun.star.uno.Exception e ) {
+ log.println("Error: exception occured.");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+
+ if (oMyStyle == null)
+ log.println("FAILED");
+ else
+ log.println("OK");
+ XNameContainer oSFNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+ try {
+ if ( oSFNC.hasByName("My Style") )
+ oSFNC.removeByName("My Style");
+ oSFNC.insertByName("My Style", oMyStyle);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XPropertySet xProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCursor);
+
+ try {
+ xProp.setPropertyValue("CharStyleName", oMyStyle.getName());
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.PropertyVetoException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create environment ", e );
+ }
+
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oMyStyle);
+ tEnv.addObjRelation("PoolStyle", oStyle);
+
+ XPropertySet xStyleProp = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+ tEnv.addObjRelation("PropertyNames",getPropertyNames(xStyleProp));
+
+ return tEnv;
+ }
+
+ public String[] getPropertyNames(XPropertySet props) {
+ Property[] the_props = props.getPropertySetInfo().getProperties();
+ String[] names = new String[the_props.length];
+ String placebo = "";
+ for (int i=0;i<the_props.length;i++) {
+ boolean isWritable =
+ ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0);
+ if (isWritable) placebo=the_props[i].Name;
+ }
+ for (int i=0;i<the_props.length;i++) {
+ boolean isWritable =
+ ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0);
+ if (isWritable) {
+ names[i]=the_props[i].Name;
+ } else {
+ names[i] = placebo;
+ }
+ }
+ return names;
+ }
+
+} // finish class SwXStyle
diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java b/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java
new file mode 100644
index 000000000000..b9cce4d65048
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.StyleFamilies</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.style.StyleFamilies
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XIndexAccess
+ */
+public class SwXStyleFamilies extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. Style families
+ * are gotten from text document using <code>XStyleFamiliesSupplier</code>
+ * interface and returned as a test component.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+
+ log.println( "Creating a test environment" );
+ XTextDocument xArea = (XTextDocument)
+ UnoRuntime.queryInterface(XTextDocument.class, xTextDoc);
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xArea);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+
+ TestEnvironment tEnv = new TestEnvironment(oSF);
+ return tEnv;
+ }
+
+
+} // finish class SwXStyle
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java
new file mode 100644
index 000000000000..436427b1fc27
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.style.StyleFamily</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XNameContainer</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XNameReplace</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XNameContainer
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XNameReplace
+ * @see ifc.container._XNameContainer
+ * @see ifc.container._XNameAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XNameReplace
+ */
+public class SwXStyleFamily extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. At first,
+ * style families of text document are gotten using
+ * <code>XStyleFamiliesSupplier</code> interface, then family indexed '0' is
+ * gotten from previously obtained style families collection using
+ * <code>XIndexAccess</code> interface. Finally, method creates an instance
+ * of the service <code>com.sun.star.style.CharacterStyle</code> and inserts
+ * it to a gotten style family as 'SwXStyleFamily' using
+ * <code>XNameContainer</code> interface.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XNameReplaceINDEX'</code> for
+ * {@link ifc.container._XNameReplace} : number of last taken instance
+ * of <code>com.sun.star.style.CharacterStyle</code>, when multithread
+ * testing is going.</li>
+ * <li> <code>'NAMEREPLACE'</code> for
+ * {@link ifc.container._XNameReplace} : name of style family, inserted
+ * to style families of a text document.</li>
+ * <li> <code>'INSTANCEn'</code> for
+ * {@link ifc.container._XIndexContainer},
+ * {@link ifc.container._XIndexReplace},
+ * {@link ifc.container._XNameContainer},
+ * {@link ifc.container._XNameReplace} : several relations, which are
+ * represented by instances of service
+ * <code>com.sun.star.style.CharacterStyle</code>.</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XNameAccess oSFNA = null;
+
+ log.println( "Creating Test Environment..." );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ XComponent xComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xTextDoc);
+ XInterface oInstance = (XInterface)
+ SOF.createInstance(xComp, "com.sun.star.style.CharacterStyle");
+ XStyleFamiliesSupplier oSFsS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+ XNameAccess oSF = oSFsS.getStyleFamilies();
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSF);
+
+ try {
+ oSFNA = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),oSFIA.getByIndex(0));
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception. ", e);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception. ", e);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception. ", e);
+ }
+
+ XNameContainer oContainer = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oSFNA);
+
+ // insert a Style which can be replaced by name
+ try {
+ oContainer.insertByName("SwXStyleFamily",oInstance);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Could not insert style family.");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Could not insert style family.");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ log.println("Could not insert style family.");
+ e.printStackTrace(log);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oSFNA);
+
+ int THRCNT = 1;
+ if ((String)Param.get("THRCNT") != null) {
+ THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
+ }
+ String nr = new Integer(THRCNT+1).toString();
+
+ log.println( "adding NameReplaceIndex as mod relation to environment" );
+ tEnv.addObjRelation("XNameReplaceINDEX", nr);
+
+ for (int n=1; n<(THRCNT+3); n++ ) {
+ log.println( "adding INSTANCE"+n+" as mod relation to environment");
+ tEnv.addObjRelation("INSTANCE"+n,
+ SOF.createInstance(xComp,"com.sun.star.style.CharacterStyle"));
+ }
+
+ log.println("adding NAMEREPLACE as mod relation to environment");
+ tEnv.addObjRelation("NAMEREPLACE", "SwXStyleFamily");
+
+ return tEnv;
+ }
+
+} // finish class SwXStyleFamily
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java
new file mode 100644
index 000000000000..eed656ee997a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TextSectionDsc;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by cell text of the text table.<p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextRangeMover</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::text::XRelativeTextContentInsert</code></li>
+ * <li> <code>com::sun::star::text::XTextRangeCompare</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextRangeMover
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XRelativeTextContentInsert
+ * @see com.sun.star.text.XTextRangeCompare
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.text.XText
+ * @see ifc.text._XTextRangeMover
+ * @see ifc.text._XSimpleText
+ * @see ifc.text._XTextRange
+ * @see ifc.text._XRelativeTextContentInsert
+ * @see ifc.text._XTextRangeCompare
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XEnumerationAccess
+ * @see ifc.text._XText
+ */
+public class SwXTableCellText extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After creation
+ * of text table, it is inserted to a text document. Then cell named 'A1' is
+ * obtained from table, string 'SwXTableCellText' is set to this cell, then
+ * cell text is gotten from cell obtained before and returned as a test
+ * component.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TEXT'</code> for
+ * {@link ifc.text._XTextRangeCompare} : table cell text</li>
+ * <li> <code>'PARA'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert} : paragraph creator</li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XRelativeTextContentInsert},
+ * {@link ifc.text._XText} : creates text sections</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+ log.println( "Creating a test environment" );
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : "
+ +e.getMessage(),e);
+ }
+
+ try {
+ SOF.insertTextContent(xTextDoc, oTable );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't insert text content : "
+ +e.getMessage(),e);
+ }
+
+ XCell oCell = oTable.getCellByName("A1");
+ XSimpleText oCellText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, oCell);
+ oCellText.setString("SwXTableCellText");
+ oObj = oCellText.getText();
+
+ log.println( "creating a new environment for Cell object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXT", (XText) oObj);
+
+ log.println( " adding InstCreator object" );
+ TextSectionDsc tDsc = new TextSectionDsc();
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ log.println( " adding Paragraph" );
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator( xTextDoc, pDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXTableCellText
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableColumns.java b/qadevOOo/tests/java/mod/_sw/SwXTableColumns.java
new file mode 100644
index 000000000000..c4a970d4c1d2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableColumns.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.table.TableColumns</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::container::XNameAccess</code></li>
+ * <li> <code>com::sun::star::table::XTableColumns</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.table.XTableColumns
+ * @see com.sun.star.table.TableColumns
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.container._XNameAccess
+ * @see ifc.table._XTableColumns
+ */
+public class SwXTableColumns extends TestCase {
+ XTextDocument xTextDoc;
+ SOfficeFactory SOF;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After creation
+ * of text table, it is inserted to text document, then columns are gotten
+ * from table.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+ log.println( "creating a test environment" );
+
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable: "
+ +e.getMessage(),e);
+ }
+
+ try {
+ SOF.insertTextContent(xTextDoc, oTable );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't insert text content: "
+ +e.getMessage(),e);
+ }
+
+ oObj = oTable.getColumns();
+
+ log.println( "creating a new environment for TableColumns object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XTableColumns
+ tEnv.addObjRelation("XTableColumns.XCellRange",
+ UnoRuntime.queryInterface(XCellRange.class, oTable));
+
+ tEnv.addObjRelation("XIndexAccess.getByIndex.mustBeNull", new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTableColumns
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableRows.java b/qadevOOo/tests/java/mod/_sw/SwXTableRows.java
new file mode 100644
index 000000000000..69b06940d419
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableRows.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.table.TableRows</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::table::XTableRows</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.table.XTableRows
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.table._XTableRows
+ */
+public class SwXTableRows extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After creation
+ * of text table, it is inserted to text document, then rows are gotten
+ * from table.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable: "
+ +e.getMessage(),e);
+ }
+
+ try {
+ SOF.insertTextContent(xTextDoc, oTable );
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ e.printStackTrace( log );
+ throw new StatusException("Couldn't insert text content: "
+ +e.getMessage(),e);
+ }
+ oObj = oTable.getRows();
+
+ log.println( "creating a new environment for TableColumns object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XTableColumns
+ tEnv.addObjRelation("XTableRows.XCellRange",
+ UnoRuntime.queryInterface(XCellRange.class, oTable));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTableRows
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java
new file mode 100644
index 000000000000..f5ec370614db
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextColumns;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.TextColumns</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextColumns</code></li>
+ * <li> <code>com::sun::star::text::TextColumns</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextColumns
+ * @see com.sun.star.text.TextColumns
+ * @see ifc.text._XTextColumns
+ * @see ifc.text._TextColumns
+ */
+public class SwXTextColumns extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After style
+ * families are gotten from text document using
+ * <code>XStyleFamiliesSupplier</code> interface, style family indexed '2'
+ * is obtained using <code>XIndexAccess</code> interface. Then style
+ * named 'Standard' is gotten from previously obtained style family using
+ * <code>XNameAccess</code> interface, and 'TextColumns' property value
+ * of this style is returned as a test component. Finally, several
+ * paragraphs within the text are inserted to a text document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XInterface oObj = null;
+ TestEnvironment tEnv = null;
+ XStyle oStyle = null;
+
+ log.println( "creating a test environment" );
+ log.println("getting PageStyle");
+ XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
+ XNameAccess oSF = oSFS.getStyleFamilies();
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSF);
+
+ try {
+ XNameAccess oSFNA = (XNameAccess) AnyConverter.toObject(
+ new Type(XNameAccess.class),oSFIA.getByIndex(2));
+ oStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oSFNA.getByName("Standard"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Error, exception occured while getting style.");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Error, exception occured while getting style.");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.container.NoSuchElementException e ) {
+ log.println("Error, exception occured while getting style.");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error, exception occured while getting style.");
+ e.printStackTrace(log);
+ }
+
+ try {
+ log.println("Getting property ('TextColumns') value of style "
+ + oStyle.getName());
+ XPropertySet xProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oStyle);
+ oObj = (XTextColumns) AnyConverter.toObject(
+ new Type(XTextColumns.class),xProps.getPropertyValue("TextColumns"));
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Exception occured while getting style property");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.beans.UnknownPropertyException e ) {
+ log.println("Exception occured while getting style property");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Exception occured while getting style property");
+ e.printStackTrace(log);
+ }
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting some text to text document..." );
+ try {
+ for (int i =0; i < 5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertString( oCursor,
+ "The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.LINE_BREAK, false );
+ }
+ } catch ( com.sun.star.lang.IllegalArgumentException e ){
+ log.println("Exception occured while inserting Text");
+ e.printStackTrace(log);
+ }
+
+ log.println("creating a new environment for object");
+ tEnv = new TestEnvironment(oObj);
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextColumns
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
new file mode 100644
index 000000000000..8d4cfd6a81f8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
@@ -0,0 +1,316 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XParagraphCursor;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.TextCursor</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::text::XTextCursor</code></li>
+ * <li> <code>com::sun::star::text::XWordCursor</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XContentEnumerationAccess</code></li>
+ * <li> <code>com::sun::star::beans::XPropertyState</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::text::XSentenceCursor</code></li>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::text::XParagraphCursor</code></li>
+ * <li> <code>com::sun::star::document::XDocumentInsertable</code></li>
+ * <li> <code>com::sun::star::util::XSortable</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ * @see com.sun.star.text.XTextCursor
+ * @see com.sun.star.text.XWordCursor
+ * @see com.sun.star.style.CharacterPropertiesComplex
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XContentEnumerationAccess
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.text.XSentenceCursor
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XParagraphCursor
+ * @see com.sun.star.document.XDocumentInsertable
+ * @see com.sun.star.util.XSortable
+ * @see com.sun.star.style.CharacterPropertiesAsian
+ * @see ifc.text._XTextCursor
+ * @see ifc.text._XWordCursor
+ * @see ifc.style._CharacterPropertiesComplex
+ * @see ifc.text._XTextRange
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XContentEnumerationAccess
+ * @see ifc.beans._XPropertyState
+ * @see ifc.style._CharacterProperties
+ * @see ifc.text._XSentenceCursor
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.text._XParagraphCursor
+ * @see ifc.document._XDocumentInsertable
+ * @see ifc.util._XSortable
+ * @see ifc.style._CharacterPropertiesAsian
+ */
+public class SwXTextCursor extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested. After major
+ * text of text document is obtained, text cursor is created and several
+ * paragraphs within the text are inserted to a text document. Finally,
+ * text cursor is returned as a test component.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XTEXT'</code> for
+ * {@link ifc.text._XTextRange} : major text of text document</li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ log.println("creating a test environment");
+
+
+ // get the bodytext of textdocument here
+ log.println("getting the TextCursor");
+
+ final XSimpleText aText = xTextDoc.getText();
+ final XTextCursor textCursor = aText.createTextCursor();
+ oObj = textCursor;
+
+ log.println("inserting some text");
+
+ try {
+ for (int i = 0; i < 3; i++) {
+ aText.insertString(textCursor, "" + (3 - i), false);
+
+ for (int j = 0; j < 5; j++) {
+ aText.insertString(textCursor, "XTextCursor,XTextCursor",
+ false);
+ aText.insertString(textCursor, "The quick brown fox ",
+ false);
+ aText.insertString(textCursor, "jumps over the lazy dog ",
+ false);
+ }
+
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.LINE_BREAK,
+ false);
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Error, insert text to text document.");
+ e.printStackTrace(log);
+ }
+
+ log.println("creating a new environment for SwXTextCursor object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XTEXT", xTextDoc.getText());
+
+ XPropertySet xCursorProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropertyNames", getPropertyNames(xCursorProp));
+
+ //Adding relation for util.XSortable
+ final XParagraphCursor paragrCursor = (XParagraphCursor) UnoRuntime.queryInterface(
+ XParagraphCursor.class,
+ oObj);
+ final PrintWriter finalLog = log;
+
+ tEnv.addObjRelation("SORTCHECKER",
+ new ifc.util._XSortable.XSortChecker() {
+ PrintWriter out = finalLog;
+
+ public void setPrintWriter(PrintWriter log) {
+ out = log;
+ }
+
+ public void prepareToSort() {
+ textCursor.gotoEnd(false);
+
+ try {
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "4", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "b", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "3", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "a", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "23", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ aText.insertString(textCursor, "ab", false);
+ aText.insertControlCharacter(textCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ out.println("Unexpected exception:" + e);
+ }
+
+ out.println(
+ "Preparing cursor to sorting. Text before sorting:");
+ paragrCursor.gotoEnd(true);
+
+ for (int i = 0; i < 6; i++) {
+ paragrCursor.gotoPreviousParagraph(true);
+ }
+
+ out.println(textCursor.getString());
+ }
+
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending) {
+ out.println("Sort checking...");
+
+ String ls = System.getProperty("line.separator");
+
+ String text = paragrCursor.getString();
+ out.println("Text after sorting:\n" + text);
+
+ boolean res = false;
+
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ res = text.endsWith(ls+"3"+ls+"4"+ls+"23");
+
+ if (!res) {
+ out.println("Text must ends by:\n" + "\r\n3\r\n4\r\n23\r\n");
+ }
+ } else {
+ res = text.startsWith("23"+ls+"4"+ls+"3"+ls);
+
+ if (!res) {
+ out.println("Text must starts with:\n" + "23\r\n4\r\n3\r\n");
+ }
+ }
+ } else {
+ if (isSortAscending) {
+ res = text.equals(ls+"23"+ls+"3"+ls+"4"+ls+"a"+ls+"ab"+ls+"b");
+
+ if (!res) {
+ out.println("Text must be equal to:\n" + "\r\n23\r\n3\r\n4\r\na\r\nab\r\nb\r\n");
+ }
+ } else {
+ res = text.endsWith("b"+ls+"ab"+ls+"a"+ls+"4"+ls+"3"+ls+"23"+ls);
+
+ if (!res) {
+ out.println("Text must be equal to:\n" + "b\r\nab\r\na\r\n4\r\n3\r\n23\r\n");
+ }
+ }
+ }
+
+ if (res) {
+ out.println("Sorted correctly");
+ }
+
+ return res;
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ public String[] getPropertyNames(XPropertySet props) {
+ Property[] the_props = props.getPropertySetInfo().getProperties();
+ Vector names = new Vector();
+
+ for (int i = 0; i < the_props.length; i++) {
+ boolean isWritable = ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0);
+
+ if (isWritable) {
+ names.add(the_props[i].Name);
+ }
+ }
+
+ return (String[]) names.toArray(new String[names.size()]);
+ }
+} // finish class SwXTextCursor
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java b/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java
new file mode 100644
index 000000000000..2630b5b2da88
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+//API Interfaces
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.text.Defaults</code> created by a writer
+ * document's <code>XMultiServiceFactory</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
+ * <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
+ * <li> <code>com::sun::star::text::Defaults</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::style::ParagraphPropertiesComplex</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.style.CharacterPropertiesComplex
+ * @see com.sun.star.style.CharacterPropertiesAsian
+ * @see com.sun.star.text.Defaults
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.style.ParagraphPropertiesComplex
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.style._CharacterPropertiesComplex
+ * @see ifc.style._CharacterPropertiesAsian
+ * @see ifc.text._Defaults
+ * @see ifc.style._CharacterProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.style._ParagraphPropertiesComplex
+ */
+public class SwXTextDefaults extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates the service <code>com.sun.star.text.Defaults</code>
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,xTextDoc);
+
+ try {
+ oObj = (XInterface)
+ docMSF.createInstance("com.sun.star.text.Defaults");
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Couldn't create Object",e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ return tEnv;
+ }
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
new file mode 100644
index 000000000000..f8e5a5d4881b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
@@ -0,0 +1,268 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.text.XTextSection;
+import com.sun.star.text.XTextSectionsSupplier;
+import com.sun.star.text.XTextTable;
+import com.sun.star.text.XWordCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XSelectionSupplier;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+
+import util.SOfficeFactory;
+import util.WriterTools;
+
+
+public class SwXTextDocument extends TestCase {
+ XTextDocument xTextDoc;
+ XTextDocument xSecondTextDoc;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ DesktopTools.closeDoc(xSecondTextDoc);
+ DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ TestEnvironment tEnv = null;
+ XTextTable the_table = null;
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println("inserting some lines");
+
+ try {
+ for (int i = 0; i < 5; i++) {
+ oText.insertString(oCursor, "Paragraph Number: " + i,
+ false);
+ oText.insertString(oCursor,
+ " The quick brown fox jumps over the lazy Dog: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ oText.insertString(oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.PARAGRAPH_BREAK,
+ false);
+ oText.insertControlCharacter(oCursor,
+ ControlCharacter.LINE_BREAK,
+ false);
+ }
+ for (int i = 0; i < 11; i++) {
+ oText.insertString(oCursor, "xTextDoc ", false);
+
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't insert lines", e);
+ }
+
+ //insert two sections parent and child
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xTextDoc);
+
+ XInterface oTS;
+ XTextSection xTS;
+
+ XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier) UnoRuntime.queryInterface(
+ XTextSectionsSupplier.class,
+ xTextDoc);
+ XNameAccess oTSSuppName = oTSSupp.getTextSections();
+
+ oTS = (XInterface) oDocMSF.createInstance(
+ "com.sun.star.text.TextSection");
+
+ XTextContent oTSC = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, oTS);
+ oText.insertTextContent(oCursor, oTSC, false);
+
+ XWordCursor oWordC = (XWordCursor) UnoRuntime.queryInterface(
+ XWordCursor.class, oCursor);
+ oCursor.setString("End of TextSection");
+ oCursor.gotoStart(false);
+ oCursor.setString("Start of TextSection ");
+ oWordC.gotoEndOfWord(false);
+
+ XInterface oTS2 = (XInterface) oDocMSF.createInstance(
+ "com.sun.star.text.TextSection");
+ oTSC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class,
+ oTS2);
+ oText.insertTextContent(oCursor, oTSC, false);
+
+ XIndexAccess oTSSuppIndex = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class,
+ oTSSuppName);
+ log.println(
+ "getting a TextSection with the XTextSectionSupplier()");
+ xTS = (XTextSection) UnoRuntime.queryInterface(XTextSection.class,
+ oTSSuppIndex.getByIndex(0));
+
+ XNamed xTSName = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ xTS);
+ xTSName.setName("SwXTextSection");
+
+ log.println(" adding TextTable");
+ the_table = SOfficeFactory.createTextTable(xTextDoc, 6, 4);
+
+ XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,
+ the_table);
+ the_name.setName("SwXTextDocument");
+ SOfficeFactory.insertTextContent(xTextDoc,
+ (XTextContent) the_table);
+
+ log.println(" adding ReferenceMark");
+
+ XInterface aMark = (XInterface) oDocMSF.createInstance(
+ "com.sun.star.text.ReferenceMark");
+ the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class, aMark);
+ the_name.setName("SwXTextDocument");
+
+ XTextContent oTC = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, aMark);
+ SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC);
+
+ log.println(" adding TextGraphic");
+ WriterTools.insertTextGraphic(xTextDoc, oDocMSF, 5200, 4200, 4400,
+ 4000, "space-metal.jpg",
+ "SwXTextDocument");
+
+ log.println(" adding EndNote");
+
+ XInterface aEndNote = (XInterface) oDocMSF.createInstance(
+ "com.sun.star.text.Endnote");
+ oTC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class,
+ aEndNote);
+ SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC);
+
+ log.println(" adding Bookmark");
+ SOfficeFactory.insertTextContent(xTextDoc,
+ (XTextContent) SOfficeFactory.createBookmark(
+ xTextDoc));
+
+ log.println(" adding DocumentIndex");
+ oTC = SOfficeFactory.createIndex(xTextDoc,
+ "com.sun.star.text.DocumentIndex");
+ SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC);
+
+ log.println(" adding TextFrame");
+
+ XTextFrame frame = SOfficeFactory.createTextFrame(xTextDoc, 500,
+ 500);
+ oTC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class,
+ frame);
+ SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC);
+
+ log.println("creating a second textdocument");
+ xSecondTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ if (xTextDoc != null) {
+ log.println("Creating instance...");
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oTextCursor = oText.createTextCursor();
+
+ for (int i = 0; i < 11; i++) {
+ oText.insertString(oTextCursor, "xTextDoc ", false);
+ }
+
+ tEnv = new TestEnvironment(xTextDoc);
+ } else {
+ log.println("Failed to create instance.");
+
+ return tEnv;
+ }
+
+ XModel model1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+ XModel model2 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xSecondTextDoc);
+
+ XController cont1 = model1.getCurrentController();
+ XController cont2 = model2.getCurrentController();
+
+ cont1.getFrame().setName("cont1");
+ cont2.getFrame().setName("cont2");
+
+ XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
+ XSelectionSupplier.class, cont1);
+
+ log.println("Adding SelectionSupplier and Shape to select for XModel");
+ tEnv.addObjRelation("SELSUPP", sel);
+ tEnv.addObjRelation("TOSELECT", the_table);
+
+ log.println("adding Controller as ObjRelation for XModel");
+ tEnv.addObjRelation("CONT1", cont1);
+ tEnv.addObjRelation("CONT2", cont2);
+
+ return tEnv;
+ }
+} // finish class SwXTextDocument
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java
new file mode 100644
index 000000000000..9df3327e13a4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextEmbeddedObjectsSupplier;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.document.XEmbeddedObjectSupplier
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.TextEmbeddedObject
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.XTextEmbeddedObject
+ *
+ */
+public class SwXTextEmbeddedObject extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ // create testobject here
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+ try {
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't open document", e);
+ }
+
+ XTextCursor xCursor = xTextDoc.getText().createTextCursor();
+ try {
+ XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" );
+ XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, o);
+ String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e";
+ XPropertySet xPropertySet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xTextContent);
+ xPropertySet.setPropertyValue( "CLSID", sChartClassID );
+
+ xTextDoc.getText().insertTextContent( xCursor, xTextContent, false );
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ }
+
+ XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier) UnoRuntime.queryInterface(
+ XTextEmbeddedObjectsSupplier.class,
+ xTextDoc);
+
+ XNameAccess oEmObj = oTEOS.getEmbeddedObjects();
+ XIndexAccess oEmIn = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, oEmObj);
+
+ try {
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class), oEmIn.getByIndex(0));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get Object", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("NoAttach", "SwXTextEmbeddedObject");
+
+ XTextFrame aFrame = SOF.createTextFrame(xTextDoc, 500, 500);
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ XTextContent the_content = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, aFrame);
+
+ try {
+ oText.insertTextContent(oCursor, the_content, true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't insert frame " + e.getMessage());
+ }
+
+ tEnv.addObjRelation("TextFrame", aFrame);
+
+ tEnv.addObjRelation("NoSetSize", "SwXTextEmbeddedObject");
+ tEnv.addObjRelation("NoPos", "SwXTextEmbeddedObject");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXTextEmbeddedObject
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java
new file mode 100644
index 000000000000..342390180a54
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextEmbeddedObjectsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class SwXTextEmbeddedObjects extends TestCase {
+
+ XTextDocument oDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ oDoc = SOF.createTextDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn?t create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(oDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+
+ // create testobject here
+ XTextCursor xCursor = oDoc.getText().createTextCursor();
+ try {
+ XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc);
+ Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" );
+ XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, o);
+ String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e";
+ XPropertySet xPropertySet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xTextContent);
+ xPropertySet.setPropertyValue( "CLSID", sChartClassID );
+
+ oDoc.getText().insertTextContent( xCursor, xTextContent, false );
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ }
+
+ XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier)
+ UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, oDoc);
+
+ oObj = oTEOS.getEmbeddedObjects();
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextEmbeddedObjects
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextField.java b/qadevOOo/tests/java/mod/_sw/SwXTextField.java
new file mode 100644
index 000000000000..0b280929eedc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextField.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XDependentTextField;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.TextContent
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.XTextField
+ *
+ */
+public class SwXTextField extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ Object instance = null;
+
+ // create testobject here
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ Object FieldMaster = oDocMSF.createInstance
+ ( "com.sun.star.text.FieldMaster.Database" );
+ XPropertySet PFieldMaster = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class,(XInterface) FieldMaster);
+ oObj = (XInterface) oDocMSF.createInstance
+ ( "com.sun.star.text.TextField.Database" );
+
+ instance = (XInterface) oDocMSF.createInstance
+ ( "com.sun.star.text.TextField.DateTime" );
+
+ XDependentTextField xTF = (XDependentTextField)
+ UnoRuntime.queryInterface(XDependentTextField.class,oObj);
+
+ PFieldMaster.setPropertyValue("DataBaseName","Address Book File");
+ PFieldMaster.setPropertyValue("DataTableName","address");
+ PFieldMaster.setPropertyValue("DataColumnName","FIRSTNAME");
+ XText the_Text = xTextDoc.getText();
+ XTextCursor the_Cursor = the_Text.createTextCursor();
+ XTextContent the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+ xTF.attachTextFieldMaster(PFieldMaster);
+ the_Text.insertTextContent(the_Cursor,the_Field,false);
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create instance");
+ ex.printStackTrace(log);
+ }
+
+ log.println( "creating a new environment for FieldMaster object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXTextField
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java b/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java
new file mode 100644
index 000000000000..009f50e570f5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XContainer
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XNameAccess
+ * @see com.sun.star.container.XNameContainer
+ * @see com.sun.star.container.XNameReplace
+ *
+ */
+public class SwXTextFieldMasters extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ 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" );
+
+
+ // create testobject here
+ try {
+ XTextFieldsSupplier oTFS = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc );
+
+ oObj = oTFS.getTextFieldMasters();
+
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create instance");
+ ex.printStackTrace(log);
+ }
+
+ log.println( "creating a new environment for FieldMasters object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXTextFieldMasters
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java b/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java
new file mode 100644
index 000000000000..3c10f9b3cabf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XContainer
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ *
+ */
+public class SwXTextFieldTypes extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ 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" );
+
+
+ // create testobject here
+ try {
+ XTextFieldsSupplier oTFS = (XTextFieldsSupplier)
+ UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc );
+
+ oObj = oTFS.getTextFields();
+
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create instance");
+ ex.printStackTrace(log);
+ }
+
+ log.println( "creating a new environment for FieldTypes object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXTextFieldTypes
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java
new file mode 100644
index 000000000000..425faf20ef50
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.TextContentAnchorType;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.XText
+ *
+ */
+public class SwXTextFrame extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XTextFrame oFrame1 = null;
+ XTextFrame oFrame2 = null;
+ XPropertySet oPropSet = null;
+ XText oText = null;
+ XTextCursor oCursor = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+
+ // creating Frames
+ log.println("creating Frames");
+
+
+ Object instance = null;
+
+ try {
+ oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500);
+ oFrame2 = SOF.createTextFrame(xTextDoc, 1500, 1500);
+ oPropSet = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oFrame1);
+
+
+ // AnchorTypes: 0 = paragraph, 1 = as char, 2 = page,
+ // 3 = frame/paragraph 4= at char
+ oPropSet.setPropertyValue("AnchorType",
+ TextContentAnchorType.AS_CHARACTER);
+ oText = xTextDoc.getText();
+ oCursor = oText.createTextCursor();
+
+ log.println("inserting Frame1");
+
+ XTextContent the_content = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, oFrame1);
+ oText.insertTextContent(oCursor, the_content, true);
+
+ log.println("inserting Frame2");
+ the_content = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, oFrame2);
+ oText.insertTextContent(oCursor, the_content, true);
+
+ XText oFrameText = oFrame1.getText();
+ oFrameText.insertString(oFrameText.getStart(), "The FrameText",
+ true);
+
+ instance = SOF.createInstance(xTextDoc,
+ "com.sun.star.text.TextFrame");
+ } catch (Exception Ex) {
+ Ex.printStackTrace(log);
+ throw new StatusException("Couldn't insert TextFrame ", Ex);
+ }
+
+ oObj = oFrame1;
+
+ log.println("creating a new environment for TextFrame object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("CONTENT",
+ (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ log.println("adding ObjRelation for XShape " +
+ "(get/setPosition won't work there)");
+ tEnv.addObjRelation("NoPos", "SwXTextFrame");
+ tEnv.addObjRelation("NoSetSize", "SwXTextFrame");
+
+ tEnv.addObjRelation("TextFrame", oFrame2);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SwXTextFrame
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java
new file mode 100644
index 000000000000..b79b4448e580
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XEnumerationAccess
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XTextRangeMover
+ *
+ */
+public class SwXTextFrameText extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) {
+
+ XInterface oObj = null;
+ XTextFrame oFrame1 = null;
+ XPropertySet oPropSet = null;
+ XText oText = null;
+ XTextCursor oCursor = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ // create testobject here
+ ////////////////////////////////////
+
+ try {
+ oFrame1 = SOF.createTextFrame(xTextDoc, 500, 500);
+ oPropSet = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oFrame1 );
+ //AnchorTypes: 0 = paragraph, 1 = as char, 2 = page,
+ // 3 = frame/paragraph 4= at char
+ oPropSet.setPropertyValue("AnchorType", new Integer(2));
+ oText = xTextDoc.getText();
+ oCursor = oText.createTextCursor();
+
+ log.println( "inserting Frame1" );
+ oText.insertTextContent(oCursor,oFrame1, false);
+
+ } catch (Exception Ex ) {
+ Ex.printStackTrace(log);
+ throw new StatusException("Couldn't insert TextFrame ", Ex);
+ }
+
+ XText oFText = (XText)UnoRuntime.queryInterface(XText.class, oFrame1);
+ XTextCursor oFCursor = oFText.createTextCursor();
+ oFText.insertString(oFCursor, "SwXTextFrameText", false);
+
+ oObj = oFText.getText();
+
+ log.println( "creating a new environment for TextFrameText object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXT", (XText) oObj);
+
+ log.println( "adding InstDescriptor object" );
+ TableDsc tDsc = new TableDsc( 6, 4 );
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ log.println( " adding Paragraph" );
+ ParagraphDsc pDsc = new ParagraphDsc();
+ tEnv.addObjRelation( "PARA", new InstCreator( xTextDoc, pDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextFrameText
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java
new file mode 100644
index 000000000000..b95cd8ba4eb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.TextContentAnchorType;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SwXTextGraphicObject extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdoc" );
+ xTextDoc = SOF.createTextDoc( null );;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oGObject = null;
+ Object xTextFrame = null;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ Object instance = null;
+
+ try {
+ oGObject = SOF.createInstance
+ (xTextDoc,"com.sun.star.text.GraphicObject");
+ instance = SOF.createInstance
+ (xTextDoc,"com.sun.star.text.GraphicObject");
+ xTextFrame = SOF.createTextFrame(xTextDoc, 500, 500);
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create instance");
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", ex );
+ }
+
+ oObj = (XInterface) oGObject;
+
+ XText the_text = xTextDoc.getText();
+ XTextCursor the_cursor = the_text.createTextCursor();
+ XTextContent the_content = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+ log.println("inserting Frame");
+ try{
+ XTextContent Framecontent = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, xTextFrame);
+ the_text.insertTextContent(the_cursor, Framecontent, true);
+ } catch (Exception e) {
+ System.out.println("Couldn't insert text frame");
+ e.printStackTrace();
+ throw new StatusException("Couldn't insert text frame", e );
+ }
+
+
+ log.println( "inserting graphic" );
+ try {
+ the_text.insertTextContent(the_cursor,the_content,true);
+ } catch (Exception e) {
+ System.out.println("Couldn't insert Content");
+ e.printStackTrace();
+ throw new StatusException("Couldn't insert Content", e );
+ }
+
+ log.println( "adding graphic" );
+ XPropertySet oProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ try {
+ String wat = util.utils.getFullTestURL("space-metal.jpg");
+ oProps.setPropertyValue("AnchorType",
+ TextContentAnchorType.AT_PARAGRAPH);
+ oProps.setPropertyValue("GraphicURL",wat);
+ oProps.setPropertyValue("HoriOrientPosition",new Integer(5500));
+ oProps.setPropertyValue("VertOrientPosition",new Integer(4200));
+ oProps.setPropertyValue("Width",new Integer(4400));
+ oProps.setPropertyValue("Height",new Integer(4000));
+ } catch (Exception e) {
+ System.out.println("Couldn't set property 'GraphicURL'");
+ e.printStackTrace();
+ throw new StatusException
+ ("Couldn't set property 'GraphicURL'", e );
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding ObjRelation for XShape "
+ +"(get/setPosition won't work there)" );
+ tEnv.addObjRelation("NoPos", "SwXTextGraphicObject");
+ tEnv.addObjRelation("NoSetSize","SwXTextGraphicObject");
+ Object ImgMap = null;
+ //creating ObjectRelation for the property
+ // 'ImageMap' of 'TextGraphicObject'
+ try {
+ XMultiServiceFactory xDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface
+ (XMultiServiceFactory.class,xTextDoc);
+ ImgMap = xDocMSF.createInstance
+ ("com.sun.star.image.ImageMapRectangleObject");
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ tEnv.addObjRelation("IMGMAP",ImgMap);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ //object relation for text.BaseFrameProperties
+ tEnv.addObjRelation("TextFrame", xTextFrame);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextGraphicObject
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java
new file mode 100644
index 000000000000..76ab82f140e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextGraphicObjectsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SwXTextGraphicObjects extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdoc" );
+ xTextDoc = SOF.createTextDoc( null );;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oGObject = null;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ oGObject = SOF.createInstance
+ (xTextDoc,"com.sun.star.text.GraphicObject");
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create instance");
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", ex );
+ }
+
+ oObj = (XInterface) oGObject;
+
+ XText the_text = xTextDoc.getText();
+ XTextCursor the_cursor = the_text.createTextCursor();
+ XTextContent the_content = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+ log.println( "inserting graphic" );
+ try {
+ the_text.insertTextContent(the_cursor,the_content,true);
+ } catch (Exception e) {
+ System.out.println("Couldn't insert Content");
+ e.printStackTrace();
+ throw new StatusException("Couldn't insert Content", e );
+ }
+
+ log.println( "adding graphic" );
+ XPropertySet oProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ try {
+ String wat = util.utils.getFullTestURL("space-metal.jpg");
+ oProps.setPropertyValue("GraphicURL",wat);
+ oProps.setPropertyValue("HoriOrientPosition",new Integer(5500));
+ oProps.setPropertyValue("VertOrientPosition",new Integer(4200));
+ oProps.setPropertyValue("Width",new Integer(4400));
+ oProps.setPropertyValue("Height",new Integer(4000));
+ } catch (Exception e) {
+ System.out.println("Couldn't set property 'GraphicURL'");
+ e.printStackTrace();
+ throw new StatusException("Couldn't set property 'GraphicURL'", e );
+ }
+
+ XTextGraphicObjectsSupplier xTGS = (XTextGraphicObjectsSupplier)
+ UnoRuntime.queryInterface(XTextGraphicObjectsSupplier.class,
+ xTextDoc);
+ oObj = xTGS.getGraphicObjects();
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextGraphicObjects
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java
new file mode 100644
index 000000000000..490f6531e618
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.TextPortion
+ *
+ */
+public class SwXTextPortion extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface param = null;
+ XPropertySet paraP = null;
+ XPropertySet portP = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting Strings" );
+ log.println( "inserting ControlCharacter" );
+
+ try{
+ for (int i =0; i < 5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ oText.insertString( oCursor,
+ "The quick brown fox jumps over the lazy Dog: SwXParagraph\n",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ }
+ }catch(Exception e){
+ log.println("Couldn't insert Text");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't insert Text", e );
+ }
+
+ // Enumeration
+ XEnumerationAccess oEnumA = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, oText );
+ XEnumeration oEnum = oEnumA.createEnumeration();
+
+ int n = 0;
+ while ( (oEnum.hasMoreElements()) ) {
+ try {
+ param = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ log.println("Element Nr.: " + n );
+ } catch ( Exception e) {
+ log.println("Couldn't get Paragraph");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get Paragraph", e );
+ }
+ n++;
+ }
+
+ XEnumerationAccess oEnumP = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, param );
+ XEnumeration oEnum2 = oEnumP.createEnumeration();
+ try {
+ oObj = (XInterface)AnyConverter.toObject(
+ new Type(XInterface.class),oEnum2.nextElement());
+ } catch ( Exception e) {
+ log.println("Couldn't get TextPortion");
+ e.printStackTrace(log);
+ throw new StatusException( "Couldn't get TextPortion", e );
+ }
+
+ portP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ paraP = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, param);
+
+
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println("adding ObjRelation TRO for TextContent");
+ tEnv.addObjRelation("TRO", new Boolean(true));
+
+ log.println("adding ObjectRelation 'PARA' for CharacterProperties");
+ tEnv.addObjRelation("PARA", paraP);
+
+ log.println("adding ObjectRelation 'PORTION' for CharacterProperties");
+ tEnv.addObjRelation("PORTION", portP);
+
+ tEnv.addObjRelation("XTEXT", oText);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXTextPortion
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java
new file mode 100644
index 000000000000..da32557d1852
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.TextPortion
+ *
+ */
+public class SwXTextPortionEnumeration extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface param = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ log.println( "inserting Strings" );
+ log.println( "inserting ControlCharacter" );
+
+
+ try{
+ for (int i =0; i < 5; i++){
+ oText.insertString( oCursor,"Paragraph Number: " + i, false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ oText.insertString( oCursor,
+ "The quick brown fox jumps over the lazy Dog: SwXParagraph\n",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.LINE_BREAK, false );
+ oText.insertString( oCursor,
+ "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: SwXParagraph",
+ false);
+ oText.insertControlCharacter(
+ oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
+ }
+ }catch(Exception e){
+ log.println("Couldn't insert Text");
+ e.printStackTrace();
+ throw new StatusException( "Couldn't insert Text", e );
+ }
+
+ // Enumeration
+ XEnumerationAccess oEnumA = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, oText );
+ XEnumeration oEnum = oEnumA.createEnumeration();
+
+ int n = 0;
+ while ( (oEnum.hasMoreElements()) ) {
+ try {
+ param = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),oEnum.nextElement());
+ } catch ( Exception e) {
+ log.println("Couldn't get Paragraph");
+ e.printStackTrace();
+ throw new StatusException( "Couldn't get Paragraph", e );
+ }
+ n++;
+ }
+
+ XEnumerationAccess oEnumP = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, param );
+ XEnumeration oEnum2 = oEnumP.createEnumeration();
+
+ log.println( "creating a new environment for TextPortionEnumeration object" );
+ TestEnvironment tEnv = new TestEnvironment( oEnum2 );
+
+ log.println("adding ObjRelation ENUM for XEnumeration");
+ tEnv.addObjRelation("ENUM", oEnumP);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXTextPortionEnumeration
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextRange.java b/qadevOOo/tests/java/mod/_sw/SwXTextRange.java
new file mode 100644
index 000000000000..058e5f2f08da
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextRange.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+public class SwXTextRange extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XText aText = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+
+ // get the bodytext of textdocument here
+ log.println( "getting the TextRange of the text document" );
+ aText = xTextDoc.getText();
+ XTextCursor oCursor = aText.createTextCursor();
+
+ XInterface oObj = oCursor.getStart();
+
+ log.println( "creating a new environment for textrange object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ System.out.println("Implementation Name: "+utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextRange
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java b/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java
new file mode 100644
index 000000000000..cc49a1f4dcd7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.util.XSearchable;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XIndexAccess
+ *
+ */
+public class SwXTextRanges extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ for (int j =0; j < 5; j++){
+ try{
+ oText.insertString( oCursor,
+ "SwXTextRanges...SwXTextRanges...SwXTextRanges", false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ }
+ catch( Exception e ){
+ log.println( "EXCEPTION: " + e);
+ }
+ }
+
+ XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
+ (XSearchable.class, xTextDoc);
+ XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
+ xSDesc.setSearchString("SwXTextRanges");
+
+ oObj = oSearch.findAll(xSDesc);
+
+ log.println( "creating a new environment for textrange object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextRanges
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java b/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java
new file mode 100644
index 000000000000..ad72aeffee87
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.util.XSearchable;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.util.SearchDescriptor
+ * @see com.sun.star.util.XSearchDescriptor
+ *
+ */
+public class SwXTextSearch extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) {
+
+ 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" );
+
+ // create testobject here
+
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ for (int j =0; j < 5; j++){
+ try{
+ oText.insertString( oCursor,
+ "SwXTextSearch...SwXTextSearch...SwXTextSearch", false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false );
+ }
+ catch( Exception e ){
+ log.println( "EXCEPTION: " + e);
+ }
+ }
+
+ XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
+ (XSearchable.class, xTextDoc);
+ XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
+ xSDesc.setSearchString("SwXTextSearch");
+
+ oObj = xSDesc;
+
+ log.println( "creating a new environment for TextSearch object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextSearch
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSection.java b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java
new file mode 100644
index 000000000000..48b1d9407584
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextColumns;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextSection;
+import com.sun.star.text.XTextSectionsSupplier;
+import com.sun.star.text.XWordCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.XText
+ *
+ */
+
+public class SwXTextSection extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface oTS = null;
+ XTextSection xTS = null;
+ XText oText = null;
+ XTextColumns TC = null;
+ Object instance = null;
+
+ log.println( "creating a test environment" );
+
+ oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ try {
+ XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier)
+ UnoRuntime.queryInterface
+ ( XTextSectionsSupplier.class, xTextDoc );
+ XNameAccess oTSSuppName = oTSSupp.getTextSections();
+
+ //cleanup if necessary
+ if (oTSSuppName.hasByName("SwXTextSection")) {
+ XTextSection old = (XTextSection) AnyConverter.toObject(
+ new Type(XTextSection.class),
+ oTSSuppName.getByName("SwXTextSection"));
+ XComponent oldC = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class,old);
+ oldC.dispose();
+ oText.setString("");
+ }
+
+ //insert two sections parent and child
+ oTS = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.TextSection");
+ instance = oDocMSF.createInstance("com.sun.star.text.TextSection");
+ XTextContent oTSC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oTS);
+ oText.insertTextContent(oCursor, oTSC, false);
+ XWordCursor oWordC = (XWordCursor)
+ UnoRuntime.queryInterface(XWordCursor.class, oCursor);
+ oCursor.setString("End of TextSection");
+ oCursor.gotoStart(false);
+ oCursor.setString("Start of TextSection ");
+ oWordC.gotoEndOfWord(false);
+ XInterface oTS2 = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.TextSection");
+ oTSC = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, oTS2);
+ oText.insertTextContent(oCursor, oTSC, false);
+
+ XIndexAccess oTSSuppIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oTSSuppName);
+
+ log.println( "getting a TextSection with the XTextSectionSupplier()" );
+ xTS = (XTextSection) AnyConverter.toObject(
+ new Type(XTextSection.class),oTSSuppIndex.getByIndex(0));
+ XNamed xTSName = (XNamed)
+ UnoRuntime.queryInterface( XNamed.class, xTS);
+ xTSName.setName("SwXTextSection");
+ }
+ catch(Exception e){
+ System.out.println("Couldn't get Textsection " + e);
+ }
+
+ oObj = xTS;
+
+ log.println( "creating a new environment for TextSection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding InstDescriptor object" );
+ TableDsc tDsc = new TableDsc( 6, 4 );
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ tEnv.addObjRelation("TRO",new Boolean(true));
+
+ try {
+ TC = (XTextColumns) UnoRuntime.queryInterface(XTextColumns.class,
+ oDocMSF.createInstance("com.sun.star.text.TextColumns"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Couldn't create instance of service TextColumns", e );
+ }
+ tEnv.addObjRelation("TC",TC);
+
+ tEnv.addObjRelation("CONTENT", (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}// finish class SwXTextSection
+
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSections.java b/qadevOOo/tests/java/mod/_sw/SwXTextSections.java
new file mode 100644
index 000000000000..3abdf4380855
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSections.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextSectionsSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.XText
+ *
+ */
+public class SwXTextSections extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ XInterface oTS = null;
+ XNameAccess oTSSuppName = null;
+
+ XText oText = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+
+ oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+
+
+ log.println( "inserting TextSections" );
+
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ // First TextSection
+ try {
+ oTS = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.TextSection");
+ XTextContent oTSC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oTS);
+ oText.insertTextContent(oCursor, oTSC, false);
+ }
+ catch(Exception e){
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ // Second TextSection
+ try {
+ oTS = (XInterface) oDocMSF.createInstance
+ ("com.sun.star.text.TextSection");
+ XTextContent oTSC = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class, oTS);
+ oText.insertTextContent(oCursor, oTSC, false);
+ }
+ catch(Exception e){
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+
+ log.println( "try to get a TextSection with the XTextSectionSupplier()" );
+
+ try{
+ XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier)
+ UnoRuntime.queryInterface( XTextSectionsSupplier.class,
+ xTextDoc );
+ oTSSuppName = oTSSupp.getTextSections();
+ }
+ catch(Exception e){
+ System.out.println("Couldn't get Textsection " + e);
+ }
+
+
+ oObj = oTSSuppName;
+
+ log.println( "creating a new environment for TextSections object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextSection
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTable.java b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java
new file mode 100644
index 000000000000..ca7d048181c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+
+
+/**
+ * this class tests the implementation of listed interfaces
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.text.TextContent
+ * @see com.sun.star.text.XTextContent
+ * @see com.sun.star.text.XTextTable
+ */
+public class SwXTextTable extends TestCase {
+ SOfficeFactory SOF;
+ XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ this method creates the testenvironment
+ @param tParam TestParameters class which contains additional
+ test parameters
+ @param log PrintWriter class to log the test state and result
+
+ @return TestEnvironment class
+
+ @see TestParameters
+ @see PrintWriter
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ // creation of testobject here
+ XTextTable oObj = null;
+ TestEnvironment tEnv = null;
+ Object instance = null;
+
+ try {
+ oObj = SOF.createTextTable(xTextDoc);
+ instance = SOF.createTextTable(xTextDoc);
+ } catch (com.sun.star.uno.Exception uE) {
+ uE.printStackTrace(log);
+ throw new StatusException("Couldn't create testobj : " +
+ uE.getMessage(), uE);
+ }
+
+ int nRow = 6;
+ int nCol = 2;
+ oObj.initialize(nRow, nCol);
+
+ log.println("Creating instance...");
+ tEnv = new TestEnvironment(oObj);
+
+ if (SOF.getTableCollection(xTextDoc).getCount() == 0) {
+ try {
+ SOF.insertTextContent(xTextDoc, oObj);
+ } catch (com.sun.star.uno.Exception uE) {
+ uE.printStackTrace(log);
+ throw new StatusException("Couldn't create TextTable : " +
+ uE.getMessage(), uE);
+ }
+ }
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+
+ try {
+ props.setPropertyValue("ChartRowAsLabel", new Boolean(true));
+ props.setPropertyValue("ChartColumnAsLabel", new Boolean(true));
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ }
+
+
+ //Adding relation for util.XTextTable
+ tEnv.addObjRelation("NROW", new Integer(nRow));
+ tEnv.addObjRelation("NCOL", new Integer(nCol));
+
+ //Adding ObjRelation for XCellRangeData
+ Object[][] newData = new Object[6][];
+ Object[] line = new Object[2];
+ line[0] = new Double(1.5);
+ line[1] = new Double(2.5);
+ newData[0] = line;
+ newData[1] = line;
+ newData[2] = line;
+ newData[3] = line;
+ newData[4] = line;
+ newData[5] = line;
+ tEnv.addObjRelation("NewData", newData);
+
+ //Adding relation for util.XSortable
+ final PrintWriter finalLog = log;
+ final XTextTable oTable = oObj;
+ tEnv.addObjRelation("SORTCHECKER",
+ new ifc.util._XSortable.XSortChecker() {
+ PrintWriter out = finalLog;
+
+ public void setPrintWriter(PrintWriter log) {
+ out = log;
+ }
+
+ public void prepareToSort() {
+ oTable.getCellByName("A1").setValue(4);
+
+ XTextRange textRange = (XTextRange) UnoRuntime.queryInterface(
+ XTextRange.class,
+ oTable.getCellByName("A2"));
+ textRange.setString("b");
+ oTable.getCellByName("A3").setValue(3);
+ textRange = (XTextRange) UnoRuntime.queryInterface(
+ XTextRange.class,
+ oTable.getCellByName("A4"));
+ textRange.setString("a");
+ oTable.getCellByName("A5").setValue(23);
+ textRange = (XTextRange) UnoRuntime.queryInterface(
+ XTextRange.class,
+ oTable.getCellByName("A6"));
+ textRange.setString("ab");
+
+ }
+
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending) {
+ out.println("Sort checking...");
+
+ boolean res = false;
+ String[] value = new String[6];
+
+ for (int i = 0; i < 6; i++) {
+ XCell cell = oTable.getCellByName("A" + (i + 1));
+ XTextRange textRange = (XTextRange) UnoRuntime.queryInterface(
+ XTextRange.class, cell);
+ value[i] = textRange.getString();
+ }
+
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ String[] rightVal = { "3", "4", "23" };
+ String[] vals = { value[3], value[4], value[5] };
+ res = ValueComparer.equalValue(vals, rightVal);
+
+ if (!res) {
+ out.println("Expected: 3, 4, 23");
+ out.println("Getting: " + value[3] + ", " +
+ value[4] + ", " + value[5]);
+ }
+ } else {
+ String[] rightVal = { "23", "4", "3" };
+ String[] vals = { value[0], value[1], value[2] };
+ res = ValueComparer.equalValue(vals, rightVal);
+
+ if (!res) {
+ out.println("Expected: 23, 4, 3");
+ out.println("Getting: " + value[1] + ", " +
+ value[2] + ", " + value[3]);
+ }
+ }
+ } else {
+ if (isSortAscending) {
+ String[] rightVal = { "23", "3", "4", "a", "ab", "b" };
+ res = ValueComparer.equalValue(value, rightVal);
+
+ if (!res) {
+ out.println("Expected: 23, 3, 4, a, ab, b");
+ out.println("Getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] +
+ ", " + value[3] + ", " +
+ value[4] + ", " + value[5]);
+ }
+ } else {
+ String[] rightVal = { "b", "ab", "a", "4", "3", "23" };
+ res = ValueComparer.equalValue(value, rightVal);
+
+ if (!res) {
+ out.println("Expected: b, ab, a, 4, 3, 23");
+ out.println("Getting: " + value[0] + ", " +
+ value[1] + ", " + value[2] +
+ ", " + value[3] + ", " +
+ value[4] + ", " + value[5]);
+ }
+ }
+ }
+
+ if (res) {
+ out.println("Sorted correctly");
+ } else {
+ out.println("Sorted uncorrectly");
+ }
+
+ return res;
+ }
+ });
+
+ tEnv.addObjRelation("CONTENT",
+ (XTextContent) UnoRuntime.queryInterface(
+ XTextContent.class, instance));
+ tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor());
+
+ return tEnv;
+ }
+} // finish class SwXTextTable
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java
new file mode 100644
index 000000000000..386e297eaa52
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XTextTableCursor
+ *
+ */
+public class SwXTextTableCursor extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ 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" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ // create testobject here
+
+ XTextTable oTable = null;
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ SOF.insertTextContent(xTextDoc, oTable );
+ }
+ catch( com.sun.star.uno.Exception uE ) {
+ uE.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : "
+ + uE.getMessage(), uE);
+ }
+
+ oObj = oTable.createCursorByCellName("A1");
+
+ log.println( "creating a new environment for TextTableCursor object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ tEnv.addObjRelation("STYLENAME1", "Table");
+ tEnv.addObjRelation("STYLENAME2", "Text");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextTableCursor
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java
new file mode 100644
index 000000000000..a2ada4632548
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XTableRows;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class SwXTextTableRow extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XTextTable oTable = null;
+
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "Creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
+
+ try {
+ log.println("creating a texttable");
+ oTable = (XTextTable) SOF.createTextTable(xTextDoc,5,5);
+ } catch( Exception e ) {
+ e.printStackTrace(log);
+ }
+
+ XText oText = xTextDoc.getText();
+
+ XTextCursor oCursor = oText.createTextCursor();
+
+ try {
+ log.println("inserting texttable");
+ oText.insertTextContent(oCursor, oTable, false);
+ } catch (Exception e) {
+ log.println("Exception!");
+ }
+
+ try {
+ log.println("getting table row");
+ XTableRows oTRn = oTable.getRows();
+ XIndexAccess oIA = (XIndexAccess) UnoRuntime.queryInterface
+ (XIndexAccess.class,oTRn);
+ oObj = (XPropertySet) AnyConverter.toObject(
+ new Type(XPropertySet.class),oIA.getByIndex(1));
+ } catch( Exception e ) {
+ e.printStackTrace(log);
+ }
+
+ log.println( "creating a new environment for TextTableRow object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextTableRow
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTables.java b/qadevOOo/tests/java/mod/_sw/SwXTextTables.java
new file mode 100644
index 000000000000..377bd14be2ae
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTables.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.text.XTextTablesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XNameAccess
+ *
+ */
+public class SwXTextTables extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ int nRow = 4;
+ int nCol = 5;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ // create testobject here
+ TestEnvironment tEnv = null;
+ XTextTable oTable = null;
+ try {
+ oTable = SOF.createTextTable( xTextDoc );
+ SOF.insertTextContent(xTextDoc, oTable );
+ }
+ catch( Exception uE ) {
+ uE.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : "
+ + uE.getMessage(), uE);
+ }
+
+ // Number two
+ XTextTable oTable2 = null;
+ try {
+ oTable2 = SOF.createTextTable( xTextDoc );
+ SOF.insertTextContent(xTextDoc, oTable2 );
+ }
+ catch( Exception uE ) {
+ uE.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable two: "
+ + uE.getMessage(), uE);
+ }
+
+ XMultiServiceFactory msf = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ XTextTablesSupplier oTTSupp = (XTextTablesSupplier)
+ UnoRuntime.queryInterface(XTextTablesSupplier.class, msf);
+ oObj = oTTSupp.getTextTables();
+
+ if ( oTable != null ) {
+ log.println("Creating instance...");
+ tEnv = new TestEnvironment(oObj);
+ }
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation( "TEXTDOC", xTextDoc );
+ tEnv.addObjRelation( "ROW", new Integer( nRow ) );
+ tEnv.addObjRelation( "COL", new Integer( nCol ) );
+ try {
+ tEnv.addObjRelation( "INST", SOF.createTextTable( xTextDoc ));
+ }
+ catch( Exception uE ) {
+ uE.printStackTrace( log );
+ throw new StatusException("Couldn't create TextTable : "
+ + uE.getMessage(), uE);
+ }
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SwXTextTables
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextView.java b/qadevOOo/tests/java/mod/_sw/SwXTextView.java
new file mode 100644
index 000000000000..281ef9e2dfd2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextView.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.WrappedTargetException;
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.form.XForm;
+import com.sun.star.frame.XController;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.util.XSearchable;
+import com.sun.star.view.XSelectionSupplier;
+import util.FormTools;
+import util.WriterTools;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.text.XTextViewCursorSupplier
+ * @see com.sun.star.view.XControlAccess
+ * @see com.sun.star.view.XSelectionSupplier
+ * @see com.sun.star.view.XViewSettingsSupplier
+ *
+ */
+public class SwXTextView extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ boolean debug = false;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ debug = tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )throws StatusException {
+
+
+ // creation of testobject here
+ log.println( "creating a test environment" );
+
+ XController xContr = xTextDoc.getCurrentController();
+
+ TestEnvironment tEnv = new TestEnvironment(xContr);
+
+ util.dbg.getSuppServices(xContr);
+
+ SOfficeFactory SOF=SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ XTextFrame first =null;
+ XTextFrame second =null;
+
+ Object oFrame1 = null;
+ Object oFrame2 = null;
+ try {
+ XText oText = xTextDoc.getText();
+ XTextCursor oCursor = oText.createTextCursor();
+ oFrame1 = SOF.createInstance
+ (xTextDoc, "com.sun.star.text.TextFrame" );
+ first = (XTextFrame)UnoRuntime.queryInterface
+ ( XTextFrame.class, oFrame1);
+ oText.insertTextContent(oCursor,first, false);
+ first.getText().setString("Frame 1");
+ oFrame2 = SOF.createInstance(xTextDoc, "com.sun.star.text.TextFrame" );
+ second = (XTextFrame)UnoRuntime.queryInterface
+ ( XTextFrame.class, oFrame2);
+ oText.insertTextContent(oCursor,second, false);
+ second.getText().setString("Frame 2");
+ oText.insertString( oCursor,
+ "SwXTextRanges...SwXTextRanges...SwXTextRanges", false);
+ oText.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ oText.insertString( oCursor,
+ "bla...bla...", false);
+ } catch (Exception Ex ) {
+ Ex.printStackTrace(log);
+ throw new StatusException("Couldn't insert text table ", Ex);
+ }
+
+ XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
+ (XSearchable.class, xTextDoc);
+ XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
+ xSDesc.setSearchString("SwXTextRanges");
+ XIndexAccess textRanges1 = oSearch.findAll(xSDesc);
+
+ xSDesc.setSearchString("bla");
+ XIndexAccess textRanges2 = oSearch.findAll(xSDesc);
+
+ tEnv.addObjRelation("Selections", new Object[] {
+ oFrame1, oFrame2, textRanges1, textRanges2});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XServiceInfo serv1 = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, o1);
+ XServiceInfo serv2 = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, o2);
+
+ String implName1 = serv1.getImplementationName();
+ String implName2 = serv2.getImplementationName();
+ if (!implName1.equals(implName2)) {
+ return -1;
+ }
+
+ XIndexAccess indAc1 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o1);
+ XIndexAccess indAc2 = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, o2);
+
+ if (indAc1 != null && indAc2 != null) {
+ int c1 = indAc1.getCount();
+ int c2 = indAc2.getCount();
+ return c1 == c2 ? 0 : 1;
+ }
+
+ XText text1 = (XText)
+ UnoRuntime.queryInterface(XText.class, o1);
+ XText text2 = (XText)
+ UnoRuntime.queryInterface(XText.class, o2);
+
+ if (text1 != null && text2 != null) {
+ return text1.getString().equals(text2.getString()) ? 0 : 1;
+ }
+
+ return -1;
+ }
+ public boolean equals(Object obj) {
+ return compare(this, obj) == 0;
+ } });
+
+ XSelectionSupplier xsel = (XSelectionSupplier)
+ UnoRuntime.queryInterface(XSelectionSupplier.class,xContr);
+ try {
+ xsel.select(second);
+ } catch (Exception e) {
+ log.println("Couldn't select");
+ throw new StatusException( "Couldn't select", e );
+ }
+
+ tEnv.addObjRelation("DOCUMENT",xTextDoc);
+ XForm myForm = null;
+ String kindOfControl="CommandButton";
+ XShape aShape = null;
+ try{
+ log.println("adding contol shape '" + kindOfControl + "'");
+ aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ kindOfControl);
+ } catch (Exception e){
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create following control shape : '" +
+ kindOfControl + "': ", e);
+
+ }
+
+
+ log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ try {
+
+ XDrawPage xDP = WriterTools.getDrawPage(xTextDoc);
+ if (xDP == null)
+ log.println("ERROR: could not get DrawPage");
+
+ XNameContainer xForms = FormTools.getForms(xDP);
+ if (xForms == null)
+ log.println("ERROR: could not get Forms");
+
+ log.println("the draw page contains folowing elemtens:");
+ String[] elements = FormTools.getForms(WriterTools.getDrawPage(xTextDoc)).getElementNames();
+ for (int i = 0; i< elements.length; i++){
+ log.println("Element[" + i + "] :" + elements[i]);
+ }
+
+ myForm = (XForm) AnyConverter.toObject(new Type(XForm.class), xForms.getByName("Standard"));
+ if (myForm == null){
+ log.println("ERROR: could not get 'Standard' from drawpage!");
+ if (debug){
+ log.println("the draw page contains folowing elemtens:");
+// String[] elements = FormTools.getForms(WriterTools.getDrawPage(xTextDoc)).getElementNames();
+// for (int i = 0; i< elements.length; i++){
+// log.println("Element[" + i + "] :" + elements[i]);
+// }
+ }
+ }
+ else
+ tEnv.addObjRelation("XFormLayerAccess.XForm", myForm);
+ } catch (WrappedTargetException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ } catch (NoSuchElementException ex) {
+ log.println("ERROR: could not add ObjectRelation 'XFormLayerAccess.XForm': " + ex.toString());
+ }
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+} // finish class SwXTextView
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java
new file mode 100644
index 000000000000..26aed37d1702
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextViewCursorSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XPropertyState
+ * @see com.sun.star.document.XDocumentInsertable
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XPageCursor
+ * @see com.sun.star.text.XParagraphCursor
+ * @see com.sun.star.text.XSentenceCursor
+ * @see com.sun.star.text.XTextCursor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.text.XWordCursor
+ * @see com.sun.star.util.XSortable
+ * @see com.sun.star.view.XScreenCursor
+ *
+ */
+public class SwXTextViewCursor extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ 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" );
+
+ // create testobject here
+ oObj = xTextDoc.getCurrentController();
+
+ XTextViewCursorSupplier oTVCSupp = (XTextViewCursorSupplier)
+ UnoRuntime.queryInterface(XTextViewCursorSupplier.class, oObj);
+
+ oObj = oTVCSupp.getViewCursor();
+
+ log.println( "creating a new environment for TextViewCursor object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+ tEnv.addObjRelation("XTEXT", xTextDoc.getText());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXTextViewCursor
diff --git a/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java
new file mode 100644
index 000000000000..aaca842c3aab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.ViewSettings
+ *
+ */
+public class SwXViewSettings extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) {
+
+ 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" );
+
+ // create testobject here
+
+ oObj = xTextDoc.getCurrentController();
+ XViewSettingsSupplier oVSSupp = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class, oObj);
+
+ oObj = oVSSupp.getViewSettings();
+
+ log.println( "creating a new environment for ViewSettings object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+
+} // finish class SwXViewSettings
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java
new file mode 100644
index 000000000000..f59512b9234f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLContentExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLContentExporter extends TestCase {
+ XTextDocument xTextDoc;
+ ContentFilterChecker Filter;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLContentExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The text document is set as a source document for exporter
+ * created. A string inserted into document. This made
+ * for checking if this string is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ final String CONTENT = "XMLContentExporter";
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ Filter = new ContentFilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Writer.XMLContentExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xTextDoc);
+
+ // text added to the document
+ XSimpleText aText = xTextDoc.getText();
+ XTextCursor curs = (XTextCursor) aText.createTextCursor();
+ aText.insertString(curs, CONTENT, false);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag("office:document-content") ;
+ Filter.addTagEnclosed("office:body", "office:document-content") ;
+ Filter.addTagEnclosed("office:script", "office:document-content") ;
+ Filter.addTagEnclosed("office:body", "office:document-content") ;
+ Filter.addCharactersEnclosed(CONTENT, "text:p") ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"swriter: StarOffice XML (Writer)"}));
+ tEnv.addObjRelation("SourceDocument",xTextDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter) ;
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class ContentFilterChecker extends XMLTools.XMLTagsChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public ContentFilterChecker(PrintWriter log) {
+ super(log) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return checkTags();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java b/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java
new file mode 100644
index 000000000000..f42de3699f0e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Writer.XMLContentImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLContentImporter extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Writer.XMLContentImporter</code><p>
+ *
+ * The text document is set as a target document for importer.
+ * Imported XML-data contains only content tags including test text.
+ * After import text getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impText = "XMLContentImporter test." ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLContentImporter") ;
+ //XImporter imp = (XImporter) UnoRuntime.queryInterface
+ // (XImporter.class, oInt) ;
+ //imp.setTargetDocument(xTextDoc) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xTextDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-content",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text"
+ },
+ {"start", "office:body"},
+ {"start", "text:p"},
+ {"chars", impText},
+ {"end", "text:p"},
+ {"end", "office:body"},
+ {"end", "office:document-content"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final XTextDocument textDoc = (XTextDocument) UnoRuntime.queryInterface
+ (XTextDocument.class, xTextDoc) ;
+ final PrintWriter fLog = log ;
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ String docText = textDoc.getText().getString() ;
+ fLog.println("Document text returned = '" + docText + "'") ;
+ return impText.equals(docText) ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLExporter.java b/qadevOOo/tests/java/mod/_sw/XMLExporter.java
new file mode 100644
index 000000000000..66c55706f517
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLExporter.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ XTextDocument xTextDoc;
+ FilterChecker Filter;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The text document is set as a source document for exporter
+ * created. A string inserted into document. This made
+ * for checking if this string is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ final String TEST_STR = "XMLExporter";
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ Filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),Filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Writer.XMLExporter", new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xTextDoc);
+
+ XSimpleText aText = xTextDoc.getText();
+ XTextCursor curs = (XTextCursor) aText.createTextCursor();
+ aText.insertString(curs, TEST_STR, false);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag("office:document") ;
+ Filter.addTagEnclosed("office:meta", "office:document") ;
+ Filter.addTagEnclosed("office:settings", "office:document") ;
+ Filter.addTagEnclosed("office:script", "office:document") ;
+ Filter.addTagEnclosed("office:styles", "office:document") ;
+ Filter.addTagEnclosed("office:body", "office:document") ;
+ Filter.addCharactersEnclosed(TEST_STR, "text:p") ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"swriter: StarOffice XML (Writer)"}));
+ tEnv.addObjRelation("SourceDocument",xTextDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter) ;
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLTagsChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return checkTags() ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLImporter.java b/qadevOOo/tests/java/mod/_sw/XMLImporter.java
new file mode 100644
index 000000000000..7ffd6710bf96
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLImporter.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.document.XImporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Writer.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Writer.XMLImporter</code><p>
+ *
+ * The text document is set as a target document for importer.
+ * Imported tags contain tag including tag with test text.
+ * After import text getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLImporter");
+ XImporter xIm = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class,oObj);
+ xIm.setTargetDocument(xTextDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final String impText = "XMLImporter test." ;
+ String[][] xml = new String[][] {
+ {"start", "office:document" ,
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "office:class", "CDATA", "text",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text"},
+ {"start", "office:body" },
+ {"start", "text:p" },
+ {"chars", impText},
+ {"end", "text:p"},
+ {"end", "office:body"},
+ {"end", "office:document"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ tEnv.addObjRelation("TargetDocument",xTextDoc);
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ final XTextDocument textDoc = (XTextDocument) UnoRuntime.queryInterface
+ (XTextDocument.class, xTextDoc) ;
+ final PrintWriter fLog = log ;
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ String docText = textDoc.getText().getString() ;
+ fLog.println("Document text returned = '" + docText + "'") ;
+ return impText.equals(docText) ;
+ }
+ }) ;
+
+ return tEnv;
+
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
new file mode 100644
index 000000000000..ed1661d27b11
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLMetaExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLMetaExporter extends TestCase {
+
+ XTextDocument xTextDoc;
+ MetaFilterChecker Filter;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLMetaExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The text document is set as a source document for exporter
+ * created. The 'Title' metadata property is set to a value. This made
+ * for checking if this property is successfully exported within
+ * the document metadata.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters tParam, PrintWriter log ) throws StatusException {
+ final String TITLE = "Title for testing of XMLMetaExporter";
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ Filter = new MetaFilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Writer.XMLMetaExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xTextDoc);
+
+ //set some meta data
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xTextDoc) ;
+ XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ docInfo.setPropertyValue("Title", TITLE);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag("office:document-meta");
+ Filter.addTagEnclosed("office:meta", "office:document-meta");
+ Filter.addCharactersEnclosed(TITLE, "dc:title");
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"swriter: StarOffice XML (Writer)"}));
+ tEnv.addObjRelation("SourceDocument", xTextDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class MetaFilterChecker extends XMLTools.XMLTagsChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public MetaFilterChecker(PrintWriter log) {
+ super(log) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return checkTags();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
new file mode 100644
index 000000000000..6deab9672dc9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Writer.XMLMetaImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLMetaImporter extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Writer.XMLMetaImporter</code><p>
+ *
+ * The text document is set as a target document for importer.
+ * Imported XML-data contains only meta tags including
+ * title tag with test name.
+ * After import title name getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impTitle = "XMLMetaImporter test." ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLMetaImporter") ;
+ //XImporter imp = (XImporter) UnoRuntime.queryInterface
+ // (XImporter.class, oInt) ;
+ //imp.setTargetDocument(xTextDoc) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xTextDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-meta" ,
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"},
+ {"start", "office:meta"} ,
+ {"start", "dc:title"},
+ {"chars", impTitle},
+ {"end", "dc:title"},
+ {"end", "office:meta"},
+ {"end", "office:document-meta"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xTextDoc) ;
+ final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String) docInfo.getPropertyValue("Title") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java
new file mode 100644
index 000000000000..fbea9eb7b3fe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.frame.XController;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLSettingsExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLSettingsExporter extends TestCase {
+
+ XTextDocument xTextDoc;
+ SettingsFilterChecker Filter;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLSettingsExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The text document is set as a source document for exporter
+ * created. New document zoom is set as one of the 'View' settings. This made
+ * for checking if this setting is successfully exported within
+ * the document settings.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ final short ZOOM = 50;
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ Filter = new SettingsFilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Writer.XMLSettingsExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xTextDoc);
+
+ //set some settings
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class,
+ xController);
+ XPropertySet xPropSet = xViewSetSup.getViewSettings();
+ xPropSet.setPropertyValue("ZoomValue", new Short(ZOOM));
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag( new XMLTools.Tag("office:document-settings") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:settings"),
+ new XMLTools.Tag("office:document-settings") );
+ Filter.addCharactersEnclosed(
+ String.valueOf(ZOOM),
+ new XMLTools.Tag("config:config-item",
+ "config:name", "ZoomFactor") );
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"swriter: StarOffice XML (Writer)"}));
+ tEnv.addObjRelation("SourceDocument",xTextDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter);
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class SettingsFilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public SettingsFilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java
new file mode 100644
index 000000000000..8529b08338bf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Writer.XMLSettingsImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLSettingsImporter extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Writer.XMLSettingsImporter</code><p>
+ *
+ * The text document is set as a target document for importer.
+ * Imported XML-data contains only settings tags including
+ * title tag with test zoom factor.
+ * After import zoom factor getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final short impZoom = 50 ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLSettingsImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xTextDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-settings",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:config", "CDATA", "http://openoffice.org/2001/config",
+ "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
+ },
+ {"start", "office:settings"},
+ {"start", "config:config-item-set",
+ "config:name", "CDATA", "view-settings"
+ },
+ {"start", "config:config-item-map-indexed",
+ "config:name", "CDATA", "Views"},
+ {"start", "config:config-item-map-entry"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "ZoomFactor",
+ "config:type", "CDATA", "short"
+ },
+ {"chars", String.valueOf(impZoom)},
+ {"end", "config:config-item"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "ZoomType",
+ "config:type", "CDATA", "short"
+ },
+ {"chars", "0"},
+ {"end", "config:config-item"},
+ {"end", "config:config-item-map-entry"},
+ {"end", "config:config-item-map-indexed"},
+ {"end", "config:config-item-set"},
+ {"end", "office:settings"},
+ {"end", "office:document-settings"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+ XController xController = xTextDoc.getCurrentController();
+ XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier)
+ UnoRuntime.queryInterface(XViewSettingsSupplier.class, xController);
+ final XPropertySet xPropSet = xViewSetSup.getViewSettings();
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ Short gValue = (Short)
+ xPropSet.getPropertyValue("ZoomValue");
+ logF.println("ZoomValue property value = " + gValue) ;
+ return impZoom == gValue.shortValue() ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception while checking import :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java
new file mode 100644
index 000000000000..0d7772a82f13
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnotesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Calc.XMLStylesExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLStylesExporter extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Calc.XMLStylesExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The text document is set as a source document for exporter
+ * created. Footnote property 'Prefix' is set to a new value. This made
+ * for checking if this property value is successfully exported within
+ * the document styles.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters tParam, PrintWriter log ) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log) ;
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Writer.XMLStylesExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface
+ (XExporter.class,oObj);
+ xEx.setSourceDocument(xTextDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Cheching Head Tag existance and that property has changed
+ filter.addTag(new XMLTools.Tag ("office:document-styles"));
+ filter.addTag(new XMLTools.Tag ("text:footnotes-configuration",
+ "style:num-prefix","New Property")) ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Obtain Footnotes properties
+ XFootnotesSupplier supp = (XFootnotesSupplier) UnoRuntime.queryInterface
+ (XFootnotesSupplier.class, xTextDoc);
+ XPropertySet set = supp.getFootnoteSettings();
+
+ // Change property "Prefix"
+ try {
+ set.setPropertyValue("Prefix","New Property");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't change property value", e );
+ }
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"swriter: StarOffice XML (Writer)"}));
+ tEnv.addObjRelation("SourceDocument",xTextDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,false) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java
new file mode 100644
index 000000000000..c8bde32a1564
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XFootnotesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Writer.XMLStylesImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLStylesImporter extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Writer.XMLStylesImporter</code><p>
+ *
+ * The text document is set as a target document for importer.
+ * Imported XML-data contains only style tags including
+ * title tag with test prefix.
+ * After import prefixes getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impPrefix = "Prefix" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLStylesImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xTextDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-styles",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:style", "CDATA", "http://openoffice.org/2000/style",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text"
+ },
+ {"start", "office:styles"},
+ {"start", "text:footnotes-configuration",
+ "style:num-prefix", "CDATA", impPrefix},
+ {"end", "text:footnotes-configuration"},
+ {"end", "office:styles"},
+ {"end", "office:document-styles"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ XFootnotesSupplier supp = (XFootnotesSupplier) UnoRuntime.queryInterface
+ (XFootnotesSupplier.class, xTextDoc);
+ final XPropertySet set = supp.getFootnoteSettings();
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String prefix = (String) set.getPropertyValue("Prefix");
+ logF.println("Prefix returned = '" + prefix + "'") ;
+ return impPrefix.equals(prefix) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/package.html b/qadevOOo/tests/java/mod/_sw/package.html
new file mode 100644
index 000000000000..e8be03da8143
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'sw'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java b/qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java
new file mode 100644
index 000000000000..5b7f2fde1521
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._sysdtrans;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.XInterface;
+
+public class SystemClipboard extends TestCase {
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.datatransfer.clipboard.SystemClipboard");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (Exception e) {
+ log.println("Unexpected exception : " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sysdtrans/package.html b/qadevOOo/tests/java/mod/_sysdtrans/package.html
new file mode 100644
index 000000000000..2ab5aeaca58a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sysdtrans/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'sysdtrans'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java b/qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java
new file mode 100644
index 000000000000..5feb03fc795e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._syssh;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.XInterface;
+
+public class SystemShellExecute extends TestCase {
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.system.SystemShellExecute");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (Exception e) {
+ log.println("Unexpected exception : " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_tcv/TypeConverter.java b/qadevOOo/tests/java/mod/_tcv/TypeConverter.java
new file mode 100644
index 000000000000..917203287636
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tcv/TypeConverter.java
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._tcv;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+public class TypeConverter extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.script.Converter" );
+ }
+ catch( Exception e ) {
+ log.println("Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class TypeConverter
+
diff --git a/qadevOOo/tests/java/mod/_tcv/package.html b/qadevOOo/tests/java/mod/_tcv/package.html
new file mode 100644
index 000000000000..7db1f329e77c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tcv/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'tcv'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java b/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java
new file mode 100644
index 000000000000..a55fe9a2d064
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._tdmgr;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+
+public class TypeDescriptionManager extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, xMSF);
+ // get context
+ XComponentContext xContext = (XComponentContext)
+ UnoRuntime.queryInterface(XComponentContext.class,
+ xProp.getPropertyValue("DefaultContext"));
+ // get the type description manager from context
+ oInterface = xContext.getValueByName("/singletons/" +
+ "com.sun.star.reflection.theTypeDescriptionManager");
+ }
+ catch( Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Object relation for XHierarchicalNameAccess ifc
+ // Name of the existing object
+ tEnv.addObjRelation("ElementName", "com.sun.star.container.XNameAccess") ;
+ tEnv.addObjRelation("SearchString", "com.sun.star.loader");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class TypeDescriptionManager
+
diff --git a/qadevOOo/tests/java/mod/_tdmgr/package.html b/qadevOOo/tests/java/mod/_tdmgr/package.html
new file mode 100644
index 000000000000..4bd4217bedba
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tdmgr/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'tdmgr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java b/qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java
new file mode 100644
index 000000000000..824068f05b36
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._text;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.text.DefaultNumberingProvider</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::text::XDefaultNumberingProvider</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.text._DefaultNumberingProvider
+* @see ifc.text._XDefaultNumberingProvider
+*/
+public class DefaultNumberingProvider extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.DefaultNumberingProvider</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ("com.sun.star.text.DefaultNumberingProvider" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java
new file mode 100644
index 000000000000..ae39ac3ddb2d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleButton extends lib.TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Printer Settings' dialog using document dispatch provider
+ * running in a separate thread. Finds active top window (the dialog
+ * window) and finds accessible button 'OK' walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ DiagThread psDiag = new DiagThread(xTextDoc, msf);
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'OK' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Opens new writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+
+ /**
+ * Thread for opening modal dialog 'Print Settings'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:Zoom";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter
+ // we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
new file mode 100644
index 000000000000..f6f04297bdbf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible compoent of
+ * check box in 'InsertTable' dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleCheckBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static DiagThread psDiag = null;
+
+ /**
+ * Opens 'Insert Table' dialog using document dispatch provider
+ * running in a separate thread. Finds active top window (the dialog
+ * window) and finds first accessible check box walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+ log.println("Creating text document");
+
+ if (xTextDoc == null) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ XInterface oObj = null;
+
+ log.println("getting toolkit");
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ log.println("Opening Dialog in second thread");
+
+ psDiag = new DiagThread(xTextDoc, msf);
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ log.println("Getting the active TopWindow");
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.CHECK_BOX);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'Cancel' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ log.println("closing dialog");
+ action.doAccessibleAction(0);
+ log.println("interrupting corresponding Thread");
+ psDiag.interrupt();
+ log.println("closing the document");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ log.println("reinitialize the variable");
+ xTextDoc = null;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+ }
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ }
+
+ /**
+ * Thread for opening modal dialog 'Insert Table'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:InsertTable";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
new file mode 100644
index 000000000000..755a5ce05007
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of the 'Font' combo box in Format->Character... dislog box. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleComboBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens CharacterStyle dialog and
+ * finds AccessibleComboBox walking through the
+ * accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ DiagThread psDiag = new DiagThread(xTextDoc,
+ (XMultiServiceFactory) Param.getMSF());
+ psDiag.start();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Cancel");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGE_TAB_LIST);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ try {
+ xAccSel.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+ util.utils.shortWait(Param.getInt("ShortWait"));
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
+ "AccessibleComboBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes the dialog using accessible button 'Cancel' found in
+ * <code>createTestEnvironment()</code>.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" closing dialog ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer doc
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+
+ /**
+ * Thread for opening modal dialog 'Character style'.
+ */
+ public class DiagThread extends Thread {
+ public XTextDocument xTextDoc = null;
+ public XMultiServiceFactory msf = null;
+
+ public DiagThread(XTextDocument xTextDoc, XMultiServiceFactory msf) {
+ this.xTextDoc = xTextDoc;
+ this.msf = msf;
+ }
+
+ public void run() {
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Opening PrinterSetupDialog
+ try {
+ String aSlotID = ".uno:FontDialog";
+ XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class,
+ msf.createInstance(
+ "com.sun.star.util.URLTransformer"));
+
+ // Because it's an in/out parameter we must use an array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = aSlotID;
+ xParser.parseStrict(aParseURL);
+
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+
+ if (xDispatcher != null) {
+ xDispatcher.dispatch(aURL, null);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't open dialog");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java
new file mode 100644
index 000000000000..df78b827624e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of the URL locator combo box located in the left upper corner
+ * of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleDropDownComboBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+
+ /**
+ * Finds AccessibleDropDownComboBox walking through the
+ * accessible component tree of a writer document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) Param.getMSF(),
+ xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.COMBO_BOX,
+ "", "AccessibleDropDownComboBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction editAction = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ editAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes writer document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
new file mode 100644
index 000000000000..fd61a5c67396
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by style list box
+ * on toolbar of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleDropDownListBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds AccessibleDropDownListBox walking through the
+ * accessible component tree of a writer document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) Param.getMSF(),
+ xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.COMBO_BOX,
+ "", "AccessibleDropDownListBox");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction acomp = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ acomp.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't perform action 0", e);
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ DesktopTools.dockStylist((XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes writer document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
new file mode 100644
index 000000000000..d9f5282b2612
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by edit field
+ * of 'Insert Hyperlink' dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEditableText</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEditableText
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleEditableText
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleEdit extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds first accessible edit field and
+ * button 'Close' (for closing this dialog when disposing)
+ * walking through the accessible component tree.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleEditableText edText = (XAccessibleEditableText) UnoRuntime.queryInterface(
+ XAccessibleEditableText.class,
+ oObj);
+ edText.setText("AccessibleEdit");
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ // buttonAccComp.grabFocus();
+ // acomp.grabFocus();
+ edText.setText("firing event ...");
+ edText.setText("firing event ... 2");
+ edText.setText("AccessibleEdit");
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("XAccessibleEditableText.hasAttr", Boolean.FALSE);
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
new file mode 100644
index 000000000000..5fafb21fbe53
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XFixedText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accesible component
+ * of the fixed text label in 'Hyperlink' Dialog. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleFixedText extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XWindow xWinDlg = null;
+
+ /**
+ * Creates a new dialog adds fixed text control to it and
+ * displays it. Then the text's accessible component is
+ * obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+ XControlModel dlgModel = null;
+
+ XControl txtControl = null;
+ XControlModel txtModel = null;
+
+ try {
+ dlgModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialogModel"));
+
+ XControl dlgControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+
+ dlgControl.setModel(dlgModel);
+
+ txtModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+
+ txtControl = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlFixedText"));
+
+ txtControl.setModel(txtModel);
+
+ XFixedText xFT = (XFixedText) UnoRuntime.queryInterface(
+ XFixedText.class, txtControl);
+ xFT.setText("FxedText");
+
+ XControlContainer ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class,
+ dlgControl);
+
+ ctrlCont.addControl("Text", txtControl);
+
+ xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ dlgControl);
+
+ xWinDlg.setVisible(true);
+
+ xWinDlg.setPosSize(0, 0, 200, 100, PosSize.SIZE);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error creating dialog :");
+ e.printStackTrace(log);
+ }
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWinDlg);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.LABEL);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XWindow xWin = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ txtControl);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xWin.setEnable(false);
+ xWin.setEnable(true);
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+ xWinDlg.dispose();
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java
new file mode 100644
index 000000000000..cc8e718f965a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+public class AccessibleList extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that list box is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) msf.createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ log.println("# Getting the ListBox");
+
+ XAccessibleContext parent = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PANEL,
+ "",
+ "com.sun.star.comp.toolkit.AccessibleListBox");
+
+ log.println("# Getting the first child");
+
+ try {
+ oObj = parent.getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
new file mode 100644
index 000000000000..8be8462e9064
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component
+ * of 'File type' list box situated in 'Insert Hyperlink'
+ * dialog on tab 'New Document'. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleListBox extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that list box is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
+ "com.sun.star.comp.toolkit.AccessibleListBox");
+
+ Object list = at.getAccessibleObjectForRole(at.SearchedAccessible,
+ AccessibleRole.LIST);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ list);
+ final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ action);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp1.grabFocus();
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java
new file mode 100644
index 000000000000..97b2ce338ffb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component
+ * of 'File type' list box item situated in 'Insert Hyperlink'
+ * dialog on tab 'New Document'. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleListItem extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Opens 'Insert Hyperlink' dialog using document dispatch provider.
+ * Finds active top window (the dialog
+ * window) and finds button 'Close' (for closing this dialog when
+ * disposing) walking through the accessible component tree.
+ * Then the TREE component is found and the 'New Document' tab is
+ * selected to make list box visible. After that listbox item is obtained.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) msf.createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
+ "Close");
+ action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ // Selecting 'New Document' tab
+ try {
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+ xAccSel.selectAccessibleChild(3);
+ shortWait();
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ throw new StatusException("Can't switch to required tab", e);
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.LIST_ITEM,"Spr");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Closes dialog using action of button 'Close'
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println(" Closing dialog ... ");
+
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Couldn't close dialog");
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Dialog already disposed");
+ }
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
new file mode 100644
index 000000000000..d9da588e290a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component of
+ * main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleText
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenu extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds accessible component with role <code>MENU</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMultiServiceFactory msf = (XMultiServiceFactory) Param.getMSF();
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+
+ shortWait();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext menubar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+ XInterface oObj = null;
+ Object menu2 = null;
+
+ try {
+ oObj = menubar.getAccessibleChild(2);
+ menu2 = menubar.getAccessibleChild(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction act1 = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+ final XAccessibleAction act2 = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, menu2);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ act2.doAccessibleAction(0);
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+
+ act1.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly", "Can't change or select Text in Menu");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Object already disposed");
+ }
+ }
+
+ /**
+ * Creates a new writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
new file mode 100644
index 000000000000..b0fcb29cfa32
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented accessible component of
+ * menu bar of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenuBar extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+
+ /**
+ * Finds accessible component with role <code>MENUBAR</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU_BAR);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ System.out.println("Grabbing focus ... ");
+ acomp.grabFocus();
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(false));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
new file mode 100644
index 000000000000..af41ba44b645
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of a menu item in main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleValue
+ * @see ifc.accessibility._XAccessibleAction
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleText
+ */
+public class AccessibleMenuItem extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Finds first accessible component with role <code>MENUITEM</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext MenuBar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+
+ try {
+ //activate Edit-Menu
+ XAccessible Menu = MenuBar.getAccessibleChild(1);
+ XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, Menu);
+ act.doAccessibleAction(0);
+ shortWait();
+
+
+ //get a menue-item
+ oObj = Menu.getAccessibleContext().getAccessibleChild(11);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+
+ //oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENUITEM);
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface(
+ XAccessibleText.class, oObj);
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in MenuBarItem");
+
+ tEnv.addObjRelation("Destroy", new Boolean(true));
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
new file mode 100644
index 000000000000..77d5cf198b7a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+/**
+ * Test for object which is represented by accessible component
+ * of a menu separator in main menu of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleMenuSeparator extends TestCase {
+ private static XTextDocument xTextDoc = null;
+ private static XAccessibleAction action = null;
+ private static XMultiServiceFactory msf = null;
+
+ /**
+ * Finds first accessible component with role <code>SEPARATOR</code>
+ * and implementation name <code>AccessibleMenuSeparator</code>
+ * walking through the accessible component tree of a document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext MenuBar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.MENU_BAR);
+ XAccessibleAction act = null;
+ XInterface oObj = null;
+
+ try {
+ //activate Edit-Menu
+ XAccessible Menu = MenuBar.getAccessibleChild(1);
+ act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, Menu);
+ act.doAccessibleAction(0);
+
+ shortWait();
+
+
+ //get a menue-separator
+ oObj = Menu.getAccessibleContext().getAccessibleChild(3);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleAction aAct = act;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ aAct.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ msf = (XMultiServiceFactory) Param.getMSF();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java
new file mode 100644
index 000000000000..bc6b4d057dca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+public class AccessiblePopupMenu extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static Point point;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+
+ log.println("release the popup menu");
+ try {
+ Robot rob = new Robot();
+ int x = point.X;
+ int y = point.Y;
+ rob.mouseMove(x, y);
+ rob.mousePress(InputEvent.BUTTON1_MASK);
+ rob.mouseRelease(InputEvent.BUTTON1_MASK);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait(tParam);
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class, oObj);
+
+ point = window.getLocationOnScreen();
+ Rectangle rect = window.getBounds();
+
+ try {
+ Robot rob = new Robot();
+ int x = point.X + (rect.Width / 2);
+ int y = point.Y + (rect.Height / 2);
+ rob.mouseMove(x, y);
+ rob.mousePress(InputEvent.BUTTON3_MASK);
+ rob.mouseRelease(InputEvent.BUTTON3_MASK);
+ } catch (java.awt.AWTException e) {
+ log.println("couldn't press mouse button");
+ }
+
+ shortWait(tParam);
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ try {
+ xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getTopWindow(0));
+
+ xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get Window");
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ final XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ sel.selectAccessibleChild(2);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ private void shortWait(TestParameters tParam) {
+ util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT));
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
new file mode 100644
index 000000000000..20812b1db4cb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
@@ -0,0 +1,310 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleText
+ */
+public class AccessibleRadioButton extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton;
+
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes a Hyperlink dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing HyperlinkDialog");
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException de) {
+ log.println("Already disposed");
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document, opens a hypelink dialog, selects a first item
+ * in IconChoiceCtrl.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.RADIOBUTTON</code> with the name <code>
+ * "Internet"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}:
+ * the text of the component </li>
+ * <li> <code>'XAccessibleValue.anotherFromGroup'</code> for
+ * {@link ifc.accessibility._XAccessibleValue}:
+ * <code>'FTP'</code> button </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ util.utils.shortWait(2000);
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening HyperlinkDialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:HyperlinkDialog";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ util.utils.shortWait(2000);
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ util.utils.shortWait(2000);
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext iconChoiceCtrl = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.TREE,
+ "IconChoiceControl");
+
+ XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ iconChoiceCtrl);
+
+ try {
+ sel.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ }
+
+ at.printAccessibleTree(log,xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIO_BUTTON,
+ "Web");
+
+ XAccessibleContext anotherButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIO_BUTTON,
+ "FTP");
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this component");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ acomp.grabFocus();
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Web");
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in AccessibleRadioButton");
+
+ XAccessibleValue anotherButtonValue = (XAccessibleValue) UnoRuntime.queryInterface(
+ XAccessibleValue.class,
+ anotherButton);
+
+ tEnv.addObjRelation("XAccessibleValue.anotherFromGroup",
+ anotherButtonValue);
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
new file mode 100644
index 000000000000..009fdefd2aaa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleScrollBar extends TestCase {
+ private static XDesktop the_Desk;
+ private static XComponent xDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR);
+
+ final XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, oObj);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ act.doAccessibleAction(1);
+ } catch (Exception e) {
+ }
+ }
+ });
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java
new file mode 100644
index 000000000000..0f6cca0ed753
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleStatusBar extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ final XWindow xWindow =
+ UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.STATUS_BAR);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ Rectangle newPosSize = xWindow.getPosSize();
+ newPosSize.Width = newPosSize.Width - 20;
+ newPosSize.Height = newPosSize.Height - 20;
+ newPosSize.X = newPosSize.X + 20;
+ newPosSize.Y = newPosSize.Y + 20;
+ xWindow.setPosSize(
+ newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java
new file mode 100644
index 000000000000..ad682c79d974
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleValue
+ * @see ifc.accessibility.XAccessibleAction
+ */
+public class AccessibleStatusBarItem extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.SCROLLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+ XInterface secondItem = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ XAccessibleContext statusbar = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.STATUS_BAR);
+
+ try {
+ oObj = statusbar.getAccessibleChild(6);
+ secondItem = statusbar.getAccessibleChild(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "Can't change or select Text in StatusBarItem");
+ tEnv.addObjRelation("XAccessibleText", secondItem);
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XTextDocument doc = xTextDoc;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ doc.getText().setString("AccessibleStatusBarItem");
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java
new file mode 100644
index 000000000000..615fd7e52a89
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleSelection;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleSelection
+ */
+public class AccessibleTabControl extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes an InsertFields dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document, opens an InsertField dialog.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETABLIST</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * selects items </li>
+ * <li> <code>'XAccessibleSelection.multiSelection'</code>
+ * of type <code>Boolean</code> for
+ * {@link ifc.accessibility._XAccessibleSelection}:
+ * indicates that component supports single selection mode.</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening InsertField dialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:InsertField";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGE_TAB_LIST);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleSelection selection = (XAccessibleSelection) (XAccessibleSelection) UnoRuntime.queryInterface(
+ XAccessibleSelection.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ selection.selectAccessibleChild(1);
+ selection.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected",
+ new Boolean(true));
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(500);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java
new file mode 100644
index 000000000000..6d458de73581
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ */
+public class AccessibleTabPage extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+ private static XAccessibleAction accCloseButton = null;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Closes an InsertFields dialog, disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ shortWait();
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close dialog " + e.getMessage());
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document, opens an InsertField dialog.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PAGETAB</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ try {
+ if (accCloseButton != null) {
+ log.println("closing InsertFields Dialog");
+ accCloseButton.doAccessibleAction(0);
+ shortWait();
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("Couldn't close dialog " + e.getMessage());
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ shortWait();
+
+ XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XController secondController = aModel1.getCurrentController();
+
+ XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
+ XDispatchProvider.class,
+ secondController);
+
+ XURLTransformer urlTransf = null;
+
+ try {
+ XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.util.URLTransformer");
+ urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
+ XURLTransformer.class, transf);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create URLTransformer", e);
+ }
+
+ XDispatch getting = null;
+ log.println("opening InsertField dialog");
+
+ URL[] url = new URL[1];
+ url[0] = new URL();
+ url[0].Complete = ".uno:InsertField";
+ urlTransf.parseStrict(url);
+ getting = aProv.queryDispatch(url[0], "", 0);
+
+ PropertyValue[] noArgs = new PropertyValue[0];
+ getting.dispatch(url[0], noArgs);
+
+ shortWait();
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, oObj);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSH_BUTTON,
+ "Close");
+
+ accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class, closeButton);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly", "toolkit.AccessibleTabPage");
+ tEnv.addObjRelation("LimitedBounds", "toolkit.AccessibleTabPage");
+
+ XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ oObj);
+ final Point point = accComp.getLocationOnScreen();
+
+ shortWait();
+
+ XInterface xEventInt = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables");
+ final XAccessibleComponent eventAccComp = (XAccessibleComponent) UnoRuntime.queryInterface(
+ XAccessibleComponent.class,
+ xEventInt);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ eventAccComp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
new file mode 100644
index 000000000000..ed352e6e7183
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ */
+public class AccessibleToolBox extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.TOOLBAR</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}:
+ * grabs focus
+ * </li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ XMultiServiceFactory msf = (XMultiServiceFactory) tParam.getMSF();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(msf);
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XInterface oObj = null;
+
+ XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc).
+ getCurrentController().getFrame().getContainerWindow();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TOOL_BAR);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ XAccessible acc = at.getAccessibleObject(oObj);
+ XAccessible child = null;
+
+ try {
+ child = acc.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+
+ util.dbg.printInterfaces(child);
+
+ final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ child);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ action.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("Couldn't fire event");
+ }
+ }
+ });
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
new file mode 100644
index 000000000000..f4e25f0f590a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleAction
+ * @see ifc.accessibility.XAccessibleText
+ * @see ifc.accessibility.XAccessibleValue
+ */
+public class AccessibleToolBoxItem extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ closeDoc();
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentContainerWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.TOGGLE_BUTTON,
+ "Bold");
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EditOnly",
+ "This method isn't supported in this dialog");
+
+ tEnv.addObjRelation("LimitedBounds", "yes");
+
+ final XAccessibleAction oAction = (XAccessibleAction) UnoRuntime.queryInterface(
+ XAccessibleAction.class,
+ oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ oAction.doAccessibleAction(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ }
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Bold");
+
+ return tEnv;
+ }
+
+ protected void closeDoc() {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java
new file mode 100644
index 000000000000..9dce17e1407b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li><code>
+ * ::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleContext
+ * @see com.sun.star.accessibility.XAccessibleComponent
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see com.sun.star.accessibility.XAccessibleAction
+ * @see com.sun.star.accessibility.XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleValue
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ * @see ifc.accessibility._XAccessibleComponent
+ * @see ifc.accessibility.XAccessibleExtendedComponent
+ * @see ifc.accessibility.XAccessibleAction
+ * @see ifc.accessibility.XAccessibleText
+ * @see ifc.accessibility.XAccessibleValue
+ */
+public class AccessibleWindow extends TestCase {
+ private static XDesktop the_Desk;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
+ DesktopTools.createDesktop(
+ (XMultiServiceFactory) Param.getMSF()));
+ }
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup(TestParameters Param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+ }
+
+ /**
+ * Creates a text document.
+ * Then obtains an accessible object with
+ * the role <code>AccessibleRole.PUSHBUTTON</code> and with the name
+ * <code>"Bold"</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'EventProducer'</code> for
+ * {@link ifc.accessibility._XAccessibleEventBroadcaster}</li>
+ * <li> <code>'XAccessibleText.Text'</code> for
+ * {@link ifc.accessibility._XAccessibleText}: the name of button</li>
+ * </ul>
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see com.sun.star.awt.Toolkit
+ * @see com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ log.println("creating a test environment");
+
+ if (xTextDoc != null) {
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ ;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ XInterface toolkit = null;
+
+ try {
+ log.println("creating a text document");
+ xTextDoc = SOF.createTextDoc(null);
+ toolkit = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+
+ XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
+ xTextDoc);
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(
+ (XMultiServiceFactory) tParam.getMSF(),
+ aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
+ XExtendedToolkit.class, toolkit);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ XWindow xWin = (XWindow) UnoRuntime.queryInterface(
+ XWindow.class, tk.getActiveTopWindow());
+ Rectangle newPosSize = xWin.getPosSize();
+ newPosSize.Width = newPosSize.Width - 20;
+ newPosSize.Height = newPosSize.Height - 20;
+ newPosSize.X = newPosSize.X + 20;
+ newPosSize.Y = newPosSize.Y + 20;
+ xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, PosSize.POSSIZE);
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java
new file mode 100644
index 000000000000..1dbe1cf66cd2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class MutableTreeDataModel extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XInterface oObj = null;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.tree.MutableTreeDataModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for MutableTreeDataModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "toolkit.MutableTreeDataModel");
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("XTreeDataModelListenerEvent", new XTreeDataModelListenerEvent());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ public class XTreeDataModelListenerEvent implements ifc.awt.tree._XTreeDataModel.XTreeDataModelListenerEvent{
+
+ public void fireEvent(){
+
+ XMutableTreeDataModel xModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class, oObj);
+ XMutableTreeNode node = xModel.createNode("EventNode", true);
+ try {
+ xModel.setRoot(node);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("ERROR: could not preform event: " + ex.toString());
+ ex.printStackTrace();
+ }
+
+ }
+ }
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
new file mode 100644
index 000000000000..6382c7c3e1e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import ifc.awt.tree._XMutableTreeNode.XMutableTreeNodeCreator;
+
+import java.io.PrintWriter;
+import lib.Status;
+import lib.StatusException;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.PropertyName;
+import util.utils;
+
+
+public class MutableTreeNode extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XInterface oObj = null;
+ private static XMutableTreeDataModel mXTreeDataModel;
+ private static XMultiServiceFactory mxMSF;
+ private static PrintWriter log;
+ private static boolean debug = false;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ this.log = log;
+ debug = tParam.getBool(PropertyName.DEBUG_IS_ACTIVE);
+ mxMSF = (XMultiServiceFactory) tParam.getMSF();
+// log.println("creating a textdocument");
+// xTextDoc = WriterTools.createTextDoc(mxMSF);
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XMutableTreeNode xNode;
+
+ try {
+ mXTreeDataModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class,
+ mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel"));
+ } catch (com.sun.star.uno.Exception ex) {
+ throw new StatusException(Status.failed("ERROR: could not create instance of" +
+ " 'com.sun.star.awt.tree.MutableTreeDataModel'"));
+ }
+
+ xNode = mXTreeDataModel.createNode("UnoTreeControl", false);
+
+ String sDisplayValue = "UnoTreeControl";
+ String sExpandedGraphicURL = "private:graphicrepository/sd/res/triangle_down.png";
+ String sCollapsedGraphicURL = "private:graphicrepository/sd/res/triangle_right.png";
+ String sNodeGraphicURL = "private:graphicrepository/sw/imglst/nc20010.png";
+
+ xNode.setDisplayValue( sDisplayValue);
+ xNode.setDataValue(sDisplayValue);
+ xNode.setExpandedGraphicURL(sExpandedGraphicURL);
+ xNode.setCollapsedGraphicURL(sCollapsedGraphicURL);
+ xNode.setNodeGraphicURL(sNodeGraphicURL);
+ xNode.setHasChildrenOnDemand(true);
+
+ fillNode(xNode);
+
+ TestEnvironment tEnv = new TestEnvironment(xNode);
+
+ tEnv.addObjRelation("OBJNAME", "toolkit.MutableTreeDataModel");
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("XTreeNode_DisplayValue", sDisplayValue);
+ tEnv.addObjRelation("XTreeNode_ExpandedGraphicURL", sExpandedGraphicURL);
+ tEnv.addObjRelation("XTreeNode_CollapsedGraphicURL", sCollapsedGraphicURL);
+ tEnv.addObjRelation("XTreeNode_NodeGraphicURL", sNodeGraphicURL);
+
+ tEnv.addObjRelation("XMutableTreeNode_NodeToAppend",
+ mXTreeDataModel.createNode("XMutableTreeNode_NodeToAppend", true));
+
+ tEnv.addObjRelation("XMutableTreeNodeCreator", new XMutableTreeNodeCreator(){
+ public XMutableTreeNode createNode(String name){
+ return mXTreeDataModel.createNode(name, true);
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ private void fillNode( XMutableTreeNode xNode ){
+
+ if( xNode.getChildCount() == 0 )
+ {
+ String sParentPath = (String) xNode.getDataValue();
+
+ String officeUserPath = utils.getOfficeUserPath(mxMSF);
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sA = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+
+
+ dirlist(officeUserPath, xNode);
+ }
+ }
+
+ private void dirlist(String dir, XMutableTreeNode xNode){
+
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sfa = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+ XMutableTreeNode xChildNode = null;
+ try {
+ xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir));
+ xChildNode.setDataValue(dir);
+ boolean test = sfa.isFolder(dir);
+ if (sfa.isFolder(dir)){
+ xChildNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xChildNode.setCollapsedGraphicURL("private:graphicrepository/sd/res/triangle_right.png");
+ String[] children = sfa.getFolderContents(dir, true);
+ if (children != null){
+ for (int i=0; i<children.length; i++) {
+ // Get filename of file or directory
+ String filename = children[i];
+ dirlist( filename , xChildNode);
+ }
+ }
+ }
+ else{
+ xChildNode.setNodeGraphicURL( "private:graphicrepository/sw/imglst/nc20010.png");
+ }
+ } catch (CommandAbortedException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+
+ try {
+ xNode.appendChild( xChildNode );
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+ }
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabController.java b/qadevOOo/tests/java/mod/_toolkit/TabController.java
new file mode 100644
index 000000000000..bcba3d88c00f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabController.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XTabControllerModel;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XForm;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class TabController extends TestCase {
+ private static XTextDocument xTextDoc = null;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XControl xCtrl1 = null;
+ XTabControllerModel tabCtrlModel = null;
+ XControlContainer aCtrlContainer = null;
+
+
+ // create object relations
+ FormTools.insertForm(xTextDoc,
+ FormTools.getForms(WriterTools.getDrawPage(
+ xTextDoc)), "MyForm");
+
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel model = aShape.getControl();
+ XControlAccess access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ try {
+ xCtrl1 = access.getControl(model);
+ } catch (Exception e) {
+ }
+
+ XForm form = null;
+
+ try {
+ form = (XForm) AnyConverter.toObject(new Type(XForm.class),
+ (FormTools.getForms(
+ WriterTools.getDrawPage(
+ xTextDoc)))
+ .getByName("MyForm"));
+ } catch (Exception e) {
+ log.println("Couldn't get Form");
+ e.printStackTrace(log);
+ }
+
+ tabCtrlModel = (XTabControllerModel) UnoRuntime.queryInterface(
+ XTabControllerModel.class, form);
+
+ aCtrlContainer = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, xCtrl1.getContext());
+
+ // create object
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.TabController");
+ } catch (Exception e) {
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ String objName = "TabController";
+ tEnv.addObjRelation("OBJNAME", "toolkit." + objName);
+ tEnv.addObjRelation("MODEL", tabCtrlModel);
+ tEnv.addObjRelation("CONTAINER", aCtrlContainer);
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
new file mode 100644
index 000000000000..d3fd2693605b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class TabControllerModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters param, PrintWriter log) {
+ log.println("disposing xTextDoc");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ log.println("inserting some ControlShapes");
+
+ XControlShape shape1 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 1000,
+ "CommandButton");
+ XControlShape shape2 = FormTools.createControlShape(xTextDoc, 5000,
+ 3500, 7500, 5000,
+ "TextField");
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.TabControllerModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create " +
+ "TabControllerModel", e);
+ }
+
+ log.println("creating a new environment for TabControllerModel");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.TabController");
+ tEnv.addObjRelation("Model1", shape1.getControl());
+ tEnv.addObjRelation("Model2", shape2.getControl());
+
+
+ //Object Relation for XPersistObject
+ tEnv.addObjRelation("noPS", new Boolean(true));
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class TabControllerModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java
new file mode 100644
index 000000000000..a8bfc06720e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+/**
+* Test for <code>com.sun.star.awt.Toolkit</code> service.
+*/
+public class Toolkit extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+ util.DesktopTools.closeDoc(xTextDoc);
+ ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates <code>com.sun.star.awt.Toolkit</code> service.
+ */
+ public TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XWindow win = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 15000, 10000,
+ "CommandButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+ XController cntrlr = (XController) UnoRuntime.queryInterface(
+ XController.class,
+ xTextDoc.getCurrentController());
+
+ //now get the toolkit
+ try {
+ win = cntrlr.getFrame().getContainerWindow();
+
+
+ //win = (XWindow) UnoRuntime.queryInterface(XWindow.class, ctrl) ;
+ the_win = the_access.getControl(the_Model).getPeer();
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.Toolkit");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e);
+ }
+
+ XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ log.println(" creating a new environment for toolkit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ tEnv.addObjRelation("WINPEER", the_win);
+
+ tEnv.addObjRelation("XModel", xModel);
+
+
+ // adding relation for XDataTransferProviderAccess
+ tEnv.addObjRelation("XDataTransferProviderAccess.XWindow", win);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class Toolkit
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java
new file mode 100644
index 000000000000..8c7028134d64
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlButton extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ButtonControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java
new file mode 100644
index 000000000000..4159f6106d9c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlButtonModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlButtonModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create object", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlButtonModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Button");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlButtonModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java
new file mode 100644
index 000000000000..c079ed8ac6ac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XCheckBox;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCheckBox extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CheckBox",
+ "UnoControlCheckBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the CheckBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get CheckBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get CheckBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlCheckBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // adding object relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener();
+ XCheckBox check = (XCheckBox) UnoRuntime.queryInterface(
+ XCheckBox.class, oObj);
+ check.addItemListener(listener);
+ tEnv.addObjRelation("TestItemListener", listener);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCheckBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java
new file mode 100644
index 000000000000..a30435534417
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCheckBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlCheckBoxModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create object", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlCheckBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.CheckBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCheckBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java
new file mode 100644
index 000000000000..4240274d66c4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+public class UnoControlComboBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ComboBox",
+ "UnoControlComboBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ComboBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ComboBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ComboBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlComboBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlComboBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java
new file mode 100644
index 000000000000..e24744546411
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlComboBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlComboBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlComboBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ComboBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlComboBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java
new file mode 100644
index 000000000000..57eddf415d74
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java
@@ -0,0 +1,252 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlContainer extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+ private static XControl xCtrl;
+ private static XControl xCtrl1;
+ private static XControl xCtrl2;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println("creating a textdocument");
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) param.getMSF());
+ } catch (Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ // create Object Relations -------------------------------------------
+ XInterface oObj = null;
+ XControlShape shape = null;
+ XControlModel model = null;
+ XControlAccess access = null;
+ XWindow anotherWindow = null;
+
+ // for XControl
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+
+ XControlContainer ctrlCont = null;
+
+ XGraphics aGraphic = null;
+
+
+ // create 3 XControls
+ // create first XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "TextField");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+
+ // create second XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "TextField");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl1 = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+
+ // create third XControl
+ shape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
+ 10000, "CommandButton");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) shape);
+ model = shape.getControl();
+ access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class, xTextDoc.getCurrentController());
+
+ try {
+ xCtrl2 = access.getControl(model);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XControl", e);
+ }
+
+ // create XToolkit, XWindowPeer, XDevice
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CommandButton",
+ "UnoControlButton");
+
+ WriterTools.getDrawPage(xTD2).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTD2.getCurrentController());
+
+ //get the ButtonControl for the needed Object relations
+ try {
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+
+ XDevice aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ButtonControl", e);
+ }
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+ // finished create Object Relations -----------------------------------
+ // create the UnoControlContainer
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlContainer");
+
+ XControl xCtrl = (XControl) UnoRuntime.queryInterface(
+ XControl.class, oObj);
+ xCtrl.setModel(the_Model);
+
+ ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, oObj);
+ ctrlCont.addControl("jupp", access.getControl(aShape.getControl()));
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create UnoControlContainer", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlContainer object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oObj);
+ Rectangle ps = xWindow.getPosSize();
+ xWindow.setPosSize(ps.X+10, ps.Y+10, ps.Width+10, ps.Height+10, PosSize.POSSIZE);
+
+ String objName = "UnoControlContainer";
+ tEnv.addObjRelation("OBJNAME", "toolkit." + objName);
+
+
+ // Object relation for XContainer
+ tEnv.addObjRelation("XContainer.Container", ctrlCont);
+ tEnv.addObjRelation("INSTANCE", xCtrl);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ // Object Relation for XControlContainer
+ tEnv.addObjRelation("CONTROL1", xCtrl1);
+ tEnv.addObjRelation("CONTROL2", xCtrl2);
+
+
+ // Object Relation for XControl
+ tEnv.addObjRelation("CONTEXT", xTD2);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java
new file mode 100644
index 000000000000..847ed1e0c17f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlContainerModel extends TestCase {
+ public TestEnvironment createTestEnvironment(TestParameters param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlContainerModel");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create " +
+ "UnoControlContainerModel", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlContainer object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.ControlContainer");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
new file mode 100644
index 000000000000..064d9914b786
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCurrencyField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "CurrencyField",
+ "UnoControlCurrencyField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the CurrencyFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get CurrencyFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get CurrencyFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlCurrencyField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCurrencyField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java
new file mode 100644
index 000000000000..606a8ac631be
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlCurrencyFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlCurrencyFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for " +
+ "UnoControlCurrencyFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.CurrencyField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlCurrencyFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java
new file mode 100644
index 000000000000..bb0c947e58e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlDateField extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XTextDocument xTD2;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ xTD2 = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ util.DesktopTools.closeDoc(xTD2);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XWindow anotherWindow = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DateField",
+ "UnoControlDateField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the DateFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get DateFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get DateFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlDateField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ try {
+ XController aController = xTD2.getCurrentController();
+ XFrame aFrame = aController.getFrame();
+ anotherWindow = aFrame.getComponentWindow();
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create XWindow", e);
+ }
+
+
+ // Object Relation for XWindow
+ tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlDateField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java
new file mode 100644
index 000000000000..9a4cee1ab823
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlDateFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDateFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlDateFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.DateField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlDateFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java
new file mode 100644
index 000000000000..37464599ff6b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTabController;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.SOfficeFactory;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlDialog</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::awt::XWindow</code></li>
+* <li> <code>com::sun::star::awt::XDialog</code></li>
+* <li> <code>com::sun::star::awt::XControl</code></li>
+* <li> <code>com::sun::star::awt::XTopWindow</code></li>
+* <li> <code>com::sun::star::awt::XControlContainer</code></li>
+* <li> <code>com::sun::star::awt::XView</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.awt.XWindow
+* @see com.sun.star.awt.XDialog
+* @see com.sun.star.awt.XControl
+* @see com.sun.star.awt.XTopWindow
+* @see com.sun.star.awt.XControlContainer
+* @see com.sun.star.awt.XView
+* @see ifc.lang._XComponent
+* @see ifc.awt._XWindow
+* @see ifc.awt._XDialog
+* @see ifc.awt._XControl
+* @see ifc.awt._XTopWindow
+* @see ifc.awt._XControlContainer
+* @see ifc.awt._XView
+*/
+public class UnoControlDialog extends TestCase {
+ private static XWindow xWinDlg = null;
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates a Dialog Control and Model instance defines Model
+ * for Control, adds to Dialog a button, sets its size and
+ * sets the dialog visible. <p>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();
+ XControlModel dlgModel = null;
+
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+
+ XControl butControl = null;
+ XControl butControl1 = null;
+ XControl butControl2 = null;
+ XTabController tabControl1 = null;
+ XTabController tabControl2 = null;
+
+ XControlContainer ctrlCont = null;
+
+ if (xWinDlg != null) {
+ xWinDlg.dispose();
+ }
+
+ try {
+ dlgModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialogModel"));
+
+ XControl dlgControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+
+ dlgControl.setModel(dlgModel);
+
+ XControlModel butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl.setModel(butModel);
+
+
+ // creating additional controls for XUnoControlContainer
+ tabControl1 = (XTabController) UnoRuntime.queryInterface(
+ XTabController.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.TabController"));
+
+ tabControl2 = (XTabController) UnoRuntime.queryInterface(
+ XTabController.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.TabController"));
+
+
+ // creating additional controls for XControlContainer
+ butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl1 = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl1.setModel(butModel);
+
+ butModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel"));
+
+ butControl2 = (XControl) UnoRuntime.queryInterface(XControl.class,
+ xMSF.createInstance(
+ "com.sun.star.awt.UnoControlButton"));
+
+ butControl2.setModel(butModel);
+
+ ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer.class, dlgControl);
+
+ xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ dlgControl);
+
+ xWinDlg.setVisible(true);
+
+ xWinDlg.setPosSize(10, 10, 220, 110, PosSize.SIZE);
+
+ the_win = dlgControl.getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(220, 220);
+ aGraphic = aDevice.createGraphics();
+
+ oObj = dlgControl;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error creating dialog :");
+ e.printStackTrace(log);
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", dlgModel);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", dlgModel);
+
+ tEnv.addObjRelation("INSTANCE", butControl);
+ tEnv.addObjRelation("XContainer.Container", ctrlCont);
+
+
+ // adding relations for XUnoControlContainer
+ tEnv.addObjRelation("TABCONTROL1", tabControl1);
+ tEnv.addObjRelation("TABCONTROL2", tabControl2);
+
+
+ // adding relations for XControlContainer
+ tEnv.addObjRelation("CONTROL1", butControl1);
+ tEnv.addObjRelation("CONTROL2", butControl2);
+
+ XWindow forObjRel = xTextDoc.getCurrentController().getFrame()
+ .getComponentWindow();
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println("Disposing dialog ...");
+ xWinDlg.dispose();
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java
new file mode 100644
index 000000000000..3f17f765d2dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlDialogModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlDialogModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlDialogModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlDialogModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlDialogModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlDialogModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XInterface dialogModel = null;
+ String _buttonName = "MyButton";
+ String _labelName = "MyLabel";
+ String _labelPrefix = "MyLabelPrefix";
+ XMultiServiceFactory xMultiServiceFactory = null;
+
+ try {
+ dialogModel = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDialogModel");
+
+ // create the dialog model and set the properties
+ XPropertySet xPSetDialog = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, dialogModel);
+ xPSetDialog.setPropertyValue("PositionX", new Integer(100));
+ xPSetDialog.setPropertyValue("PositionY", new Integer(100));
+ xPSetDialog.setPropertyValue("Width", new Integer(150));
+ xPSetDialog.setPropertyValue("Height", new Integer(100));
+ xPSetDialog.setPropertyValue("Title",
+ new String("Runtime Dialog Demo"));
+
+
+ // get the service manager from the dialog model
+ xMultiServiceFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ dialogModel);
+
+ // create the button model and set the properties
+ Object buttonModel = xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlButtonModel");
+ XPropertySet xPSetButton = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, buttonModel);
+ xPSetButton.setPropertyValue("PositionX", new Integer(50));
+ xPSetButton.setPropertyValue("PositionY", new Integer(30));
+ xPSetButton.setPropertyValue("Width", new Integer(50));
+ xPSetButton.setPropertyValue("Height", new Integer(14));
+ xPSetButton.setPropertyValue("Name", _buttonName);
+ xPSetButton.setPropertyValue("TabIndex", new Short((short) 0));
+ xPSetButton.setPropertyValue("Label", new String("Click Me"));
+
+ // create the label model and set the properties
+ Object labelModel = xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel");
+ XPropertySet xPSetLabel = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, labelModel);
+ xPSetLabel.setPropertyValue("PositionX", new Integer(40));
+ xPSetLabel.setPropertyValue("PositionY", new Integer(60));
+ xPSetLabel.setPropertyValue("Width", new Integer(100));
+ xPSetLabel.setPropertyValue("Height", new Integer(14));
+ xPSetLabel.setPropertyValue("Name", _labelName);
+ xPSetLabel.setPropertyValue("TabIndex", new Short((short) 1));
+ xPSetLabel.setPropertyValue("Label", _labelPrefix);
+
+ // insert the control models into the dialog model
+ XNameContainer xNameCont = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer.class,
+ dialogModel);
+ xNameCont.insertByName(_buttonName, buttonModel);
+ xNameCont.insertByName(_labelName, labelModel);
+
+ // create the dialog control and set the model
+ XControl dialog = (XControl) UnoRuntime.queryInterface(
+ XControl.class,
+ ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlDialog"));
+ XControl xControl = (XControl) UnoRuntime.queryInterface(
+ XControl.class, dialog);
+ XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface(
+ XControlModel.class,
+ dialogModel);
+ xControl.setModel(xControlModel);
+ } catch (Exception e) {
+ throw new StatusException("Could no create test object", e);
+ }
+
+ oObj = dialogModel;
+
+ log.println("creating a new environment for object");
+
+ XMultiServiceFactory oMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ try {
+ // XNameReplace
+ tEnv.addObjRelation("INSTANCE1",
+ xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+
+
+ //XContainer
+ tEnv.addObjRelation("INSTANCE",
+ xMultiServiceFactory.createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel"));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Could not add object relations 'INSTANCEn'");
+ e.printStackTrace(log);
+ }
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Dialog");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
new file mode 100644
index 000000000000..80750544d649
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlEdit extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "TextField",
+ "UnoControlEdit");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the EditControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get EditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get EditControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlEdit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlEdit
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java
new file mode 100644
index 000000000000..0f05e3725cd9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlEditModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlEditModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlEditModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Edit");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlEditModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java
new file mode 100644
index 000000000000..c326ee873cb4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFileControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "FileControl",
+ "UnoControlFileControl");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the FileControlControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get FileControlControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FileControlControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFileControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFileControl
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java
new file mode 100644
index 000000000000..cefb7d072d13
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFileControlModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFileControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFileControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FileControl");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFileControlModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java
new file mode 100644
index 000000000000..4deaef81360d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlFixedLineModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlFixedLineModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlFixedLineModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlFixedLineModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlFixedLineModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlFixedLineModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFixedLineModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FixedLine");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
new file mode 100644
index 000000000000..14d3c8f2b73f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFixedText extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "FixedText",
+ "UnoControlFixedText");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the FixedTextControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get FixedTextControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get FixedTextControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFixedText object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFixedText
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java
new file mode 100644
index 000000000000..195dbdfb6984
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFixedTextModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFixedTextModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFixedTextModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.FixedText");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFixedTextModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java
new file mode 100644
index 000000000000..4511f65323e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFormattedField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DatabaseFormattedField",
+ "UnoControlFormattedField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, the_Model);
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the EditControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+
+ xPS.setPropertyValue("Spin", new Boolean(true));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get EditControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get EditControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlEdit object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java
new file mode 100644
index 000000000000..035196df0ab9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlFormattedFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlFormattedFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlFormattedFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.vcl.controlmodel.FormattedField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlFormattedFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java
new file mode 100644
index 000000000000..97d81ec52427
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlGroupBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "GroupBox",
+ "UnoControlGroupBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the GroupBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get GroupBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get GroupBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlGroupBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlGroupBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java
new file mode 100644
index 000000000000..3bb46d8baaf2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlGroupBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlGroupBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlGroupBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.GroupBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlGroupBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java
new file mode 100644
index 000000000000..efe32e3423f0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlImageControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "DatabaseImageControl",
+ "UnoControlImageControl");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, the_Model);
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ImageControlControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+
+ String imgUrl = util.utils.getFullTestURL("poliball.gif");
+
+ xPS.setPropertyValue("ImageURL", imgUrl);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get ImageControlControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ImageControlControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlImageControl object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlImageControl
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java
new file mode 100644
index 000000000000..be142c1ebc58
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlImageControlModel extends TestCase {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlImageControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlImageControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ImageControl");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlImageControlModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java
new file mode 100644
index 000000000000..4e919ba14698
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XListBox;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlListBox extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ListBox",
+ "UnoControlListBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ListBoxControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ListBoxControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ListBoxControl", e);
+ }
+
+ log.println("creating a new environment for UnoControlListBox object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ // adding object relation for XItemListener
+ ifc.awt._XItemListener.TestItemListener listener =
+ new ifc.awt._XItemListener.TestItemListener();
+ XListBox list = (XListBox) UnoRuntime.queryInterface(XListBox.class,
+ oObj);
+ list.addItemListener(listener);
+ tEnv.addObjRelation("TestItemListener", listener);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBox
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java
new file mode 100644
index 000000000000..785527f631c2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlListBoxModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlListBoxModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlListBoxModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ListBox");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java
new file mode 100644
index 000000000000..ac836abbaab7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+import com.sun.star.view.XControlAccess;
+
+
+public class UnoControlNumericField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ try {
+ XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xTextDoc);
+ closer.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ log.println("couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ log.println("couldn't close document");
+ }
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "NumericField",
+ "UnoControlNumericField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the NumericFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get NumericFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get NumericFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlNumericField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ tEnv.addObjRelation("XTextComponent.onlyNumbers", "");
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlNumericField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java
new file mode 100644
index 000000000000..79746cc576ef
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlNumericFieldModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlNumericFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlNumericFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.NumericField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlNumericFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java
new file mode 100644
index 000000000000..b89817e89c11
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlPatternField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "PatternField",
+ "UnoControlPatternField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the PatternFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get PatternFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get PatternFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlPatternField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlPatternField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java
new file mode 100644
index 000000000000..11ebe24aac59
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlPatternFieldModel extends TestCase {
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlPatternFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlPatternFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.PatternField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlPatternFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java
new file mode 100644
index 000000000000..d582c08c2c57
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlProgressBarModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlProgressBarModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlProgressBarModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlProgressBarModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlProgressBarModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlProgressBarModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlProgressBarModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ProgressBar");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
new file mode 100644
index 000000000000..3dea66cdb65f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlRadioButton extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "RadioButton",
+ "UnoControlRadioButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the RadioButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get RadioButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get RadioButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlRadioButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlRadioButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java
new file mode 100644
index 000000000000..0db72e0d2db5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlRadioButtonModel extends TestCase {
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlRadioButtonModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlRadioButtonModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.RadioButton");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlRadioButtonModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java
new file mode 100644
index 000000000000..0ca3e0e7eb82
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.awt.UnoControlScrollBarModel</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::awt::UnoControlScrollBarModel</code></li>
+* <li> <code>com::sun::star::io::XPersistObject</code></li>
+* <li> <code>com::sun::star::lang::XComponent</code></li>
+* <li> <code>com::sun::star::beans::XPropertySet</code></li>
+* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.awt.UnoControlScrollBarModel
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.lang.XComponent
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XMultiPropertySet
+* @see ifc.awt._UnoControlScrollBarModel
+* @see ifc.io._XPersistObject
+* @see ifc.lang._XComponent
+* @see ifc.beans._XPropertySet
+* @see ifc.beans._XMultiPropertySet
+*/
+public class UnoControlScrollBarModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlScrollBarModel</code>.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'OBJNAME'</code> for
+ * {@link ifc.io._XPersistObject} </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlScrollBarModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ScrollBar");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
new file mode 100644
index 000000000000..9547f723414e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoControlTimeField extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "TimeField",
+ "UnoControlTimeField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the TimeFieldControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get TimeFieldControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get TimeFieldControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlTimeField object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape", aShape);
+
+ // Adding relation for XTextListener
+ ifc.awt._XTextListener.TestTextListener listener =
+ new ifc.awt._XTextListener.TestTextListener();
+ XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
+ XTextComponent.class, oObj);
+ textComp.addTextListener(listener);
+ tEnv.addObjRelation("TestTextListener", listener);
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlTimeField
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java
new file mode 100644
index 000000000000..4b47fe41b475
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoControlTimeFieldModel extends TestCase {
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlTimeFieldModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for UnoControlTimeFieldModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.TimeField");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlTimeFieldModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java
new file mode 100644
index 000000000000..640365fdb855
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoScrollBarControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+
+ log.println("maximize the window size");
+ XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
+ XFrame xFrame = xModel.getCurrentController().getFrame();
+ XWindow xWin = xFrame.getContainerWindow();
+
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ Dimension dim = tk.getScreenSize();
+
+ Rectangle newPosSize = xWin.getPosSize();
+ newPosSize.Width = new Double(dim.getWidth()).intValue();
+ newPosSize.Height = new Double(dim.getHeight()).intValue();
+ newPosSize.X = 0;
+ newPosSize.Y = 0;
+
+ xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width,
+ newPosSize.Height, com.sun.star.awt.PosSize.POSSIZE);
+
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "ScrollBar",
+ "UnoControlScrollBar");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the ScrollBarControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get ScrollBarControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get ScrollBarControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlScrollBar object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding Object-Relation for XScrollBar
+ tEnv.addObjRelation("Document", xTextDoc);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java
new file mode 100644
index 000000000000..a4ba99c437ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XControlAccess;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoSpinButtonControl extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) Param.getMSF());
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XWindowPeer the_win = null;
+ XToolkit the_kit = null;
+ XDevice aDevice = null;
+ XGraphics aGraphic = null;
+ XControl aControl = null;
+
+ //Insert a ControlShape and get the ControlModel
+ XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
+ 4500, 15000,
+ 10000,
+ "SpinButton",
+ "UnoControlSpinButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ XControlModel the_Model = aShape.getControl();
+
+ XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
+ 4500, 5000, 10000,
+ "TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
+
+ XControlModel the_Model2 = aShape2.getControl();
+
+ //Try to query XControlAccess
+ XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
+ XControlAccess.class,
+ xTextDoc.getCurrentController());
+
+ //get the SpinButtonControl for the needed Object relations
+ try {
+ oObj = the_access.getControl(the_Model);
+ aControl = the_access.getControl(the_Model2);
+ the_win = the_access.getControl(the_Model).getPeer();
+ the_kit = the_win.getToolkit();
+ aDevice = the_kit.createScreenCompatibleDevice(200, 200);
+ aGraphic = aDevice.createGraphics();
+ } catch (Exception e) {
+ log.println("Couldn't get SpinButtonControl");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get SpinButtonControl", e);
+ }
+
+ log.println(
+ "creating a new environment for UnoControlSpinButton object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding Object-Relation for XScrollBar
+ tEnv.addObjRelation("Document", xTextDoc);
+
+
+ //Adding ObjRelation for XView
+ tEnv.addObjRelation("GRAPHICS", aGraphic);
+
+
+ //Adding ObjRelation for XControl
+ tEnv.addObjRelation("CONTEXT", xTextDoc);
+ tEnv.addObjRelation("WINPEER", the_win);
+ tEnv.addObjRelation("TOOLKIT", the_kit);
+ tEnv.addObjRelation("MODEL", the_Model);
+
+ XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
+ aControl);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
+
+ tEnv.addObjRelation("Document", xTextDoc);
+
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java
new file mode 100644
index 000000000000..7cf20b8e0656
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControlModel.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.utils;
+
+
+public class UnoSpinButtonControlModel extends TestCase {
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.awt.UnoControlSpinButtonModel</code>.
+ */
+ public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log)
+ throws StatusException {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.UnoControlSpinButtonModel");
+ } catch (Exception e) {
+ }
+
+ log.println("creating a new environment for object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME",
+ "com.sun.star.awt.UnoControlSpinButtonModel");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java
new file mode 100644
index 000000000000..4a8dc03800e9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XDialog;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.tree.XMutableTreeDataModel;
+import com.sun.star.awt.tree.XMutableTreeNode;
+import com.sun.star.awt.tree.XTreeControl;
+import com.sun.star.awt.tree.XTreeNode;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.PropertyName;
+import util.SOfficeFactory;
+import util.UITools;
+import util.utils;
+
+
+public class UnoTreeControl extends TestCase {
+ private static XTextDocument xTextDoc;
+ private static XMutableTreeDataModel mXTreeDataModel;
+ private static XMultiServiceFactory mxMSF;
+ private static PrintWriter log;
+ private static boolean debug = false;
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ this.log = log;
+ debug = Param.getBool(PropertyName.DEBUG_IS_ACTIVE);
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a textdocument");
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+// log.println(" disposing xTextDoc ");
+//
+// util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ String sTreeControlName = "UnoTreeControl-Test";
+ mxMSF = (XMultiServiceFactory) Param.getMSF();
+ XInterface oObj = null;
+ XMutableTreeNode xNode = null;
+
+ try {
+
+ mXTreeDataModel = (XMutableTreeDataModel )
+ UnoRuntime.queryInterface(XMutableTreeDataModel.class,
+ mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel"));
+
+ xNode = mXTreeDataModel.createNode("UnoTreeControl", false);
+
+ xNode.setDataValue( "UnoTreeControl");
+ xNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xNode.setCollapsedGraphicURL( "private:graphicrepository/sd/res/triangle_right.png");
+
+ fillNode(xNode);
+
+ mXTreeDataModel.setRoot(xNode);
+
+ XControlModel xDialogModel = (XControlModel)
+ UnoRuntime.queryInterface(XControlModel.class,
+ mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel"));
+
+ XPropertySet xDialogPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel);
+ xDialogPropertySet.setPropertyValue( "PositionX", new Integer(50) );
+ xDialogPropertySet.setPropertyValue( "PositionY", new Integer(50) );
+ xDialogPropertySet.setPropertyValue( "Width", new Integer(256) );
+ xDialogPropertySet.setPropertyValue( "Height", new Integer(256) );
+ xDialogPropertySet.setPropertyValue( "Title", "Tree Control Test");
+
+ XMultiServiceFactory xDialogMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel);
+
+ XControlModel xTreeControlModel = (XControlModel)
+ UnoRuntime.queryInterface(XControlModel.class,
+ xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel"));
+
+ XPropertySet XTreeControlModelSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel);
+
+ XTreeControlModelSet.setPropertyValue( "SelectionType",com.sun.star.view.SelectionType.NONE);
+ XTreeControlModelSet.setPropertyValue( "PositionX", new Integer(3 ));
+ XTreeControlModelSet.setPropertyValue( "PositionY", new Integer(3 ));
+ XTreeControlModelSet.setPropertyValue( "Width", new Integer(253));
+ XTreeControlModelSet.setPropertyValue( "Height", new Integer(253) );
+ XTreeControlModelSet.setPropertyValue( "DataModel", mXTreeDataModel );
+ XTreeControlModelSet.setPropertyValue( "ShowsRootHandles",new Boolean (false));
+ XTreeControlModelSet.setPropertyValue( "ShowsHandles", new Boolean (false));
+ XTreeControlModelSet.setPropertyValue( "RootDisplayed", new Boolean (true));
+ XTreeControlModelSet.setPropertyValue( "Editable", new Boolean (true ));
+
+ XNameContainer xDialogModelContainer = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, xDialogModel);
+
+ xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel);
+
+ XControl xDialogControl = (XControl)
+ UnoRuntime.queryInterface(XControl.class,
+ mxMSF.createInstance("com.sun.star.awt.UnoControlDialog"));
+
+ xDialogControl.setModel( xDialogModel );
+
+ XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class,
+ mxMSF.createInstance("com.sun.star.awt.Toolkit" ));
+
+ xDialogControl.createPeer( xToolkit, null );
+
+ // get the peers of the sub controls from the dialog peer container
+ XControlContainer xDialogContainer = (XControlContainer)
+ UnoRuntime.queryInterface(XControlContainer.class ,xDialogControl);
+
+ XTreeControl xTreeControl = (XTreeControl)
+ UnoRuntime.queryInterface(XTreeControl.class, xDialogContainer.getControl( sTreeControlName ));
+
+ xTreeControl.expandNode(xNode);
+ oObj = xTreeControl;
+
+ XDialog xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xDialogControl);
+
+ execurteDialog aDialog = new execurteDialog(xDialog);
+
+ aDialog.start();
+
+// xDialog.execute();
+
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("XTreeControl_Node", xNode);
+
+ //com.sun.star.view.XSelectionSupplier
+ try {
+
+ System.out.println("count of children: " + xNode.getChildCount());
+ tEnv.addObjRelation("Selections", new Object[]{xNode.getChildAt(0), xNode});
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("ERROR: could not add object relation 'Selections' because 'xNode.getChildAt(1) failed: " +
+ ex.toString());
+ }
+
+ tEnv.addObjRelation("Comparer",
+ new Comparator() {
+ public int compare(Object o1, Object o2) {
+ XMutableTreeNode xNode1 = (XMutableTreeNode) UnoRuntime.queryInterface(
+ XMutableTreeNode.class, o1);
+ XTreeNode xNode2a = null;
+ try {
+ xNode2a = (XTreeNode) AnyConverter.toObject(new Type(XTreeNode.class), o2);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+
+ XMutableTreeNode xNode2 = (XMutableTreeNode) UnoRuntime.queryInterface(
+ XMutableTreeNode.class, xNode2a);
+
+ if (((String) xNode1.getDataValue()).equals((String)xNode2.getDataValue())) {
+ return 0;
+ }
+
+ return -1;
+ }
+ });
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ private void fillNode( XMutableTreeNode xNode ){
+
+ if( xNode.getChildCount() == 0 )
+ {
+ String sParentPath = (String) xNode.getDataValue();
+
+ String officeUserPath = utils.getOfficeUserPath(mxMSF);
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sA = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+
+
+ dirlist(officeUserPath, xNode);
+ }
+ }
+
+ private void dirlist(String dir, XMutableTreeNode xNode){
+
+ Object fileacc = null;
+ try {
+ fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+ XSimpleFileAccess sfa = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
+ XMutableTreeNode xChildNode = null;
+ try {
+ xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir));
+ xChildNode.setDataValue(dir);
+ boolean test = sfa.isFolder(dir);
+ if (sfa.isFolder(dir)){
+ xChildNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
+ xChildNode.setCollapsedGraphicURL("private:graphicrepository/sd/res/triangle_right.png");
+ String[] children = sfa.getFolderContents(dir, true);
+ if (children != null){
+ for (int i=0; i<children.length; i++) {
+ // Get filename of file or directory
+ String filename = children[i];
+ dirlist( filename , xChildNode);
+ }
+ }
+ }
+ else{
+ xChildNode.setNodeGraphicURL( "private:graphicrepository/sw/imglst/nc20010.png");
+ }
+ } catch (CommandAbortedException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.uno.Exception ex) {
+ ex.printStackTrace();
+ }
+
+ try {
+ xNode.appendChild( xChildNode );
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private class execurteDialog extends Thread{
+ private XDialog mXDialog;
+
+ public execurteDialog(XDialog xDialog){
+ mXDialog = xDialog;
+ }
+
+ public void run() {
+ mXDialog.endExecute();
+ }
+ }
+
+
+} // finish class UnoControlRadioButton
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java
new file mode 100644
index 000000000000..5f6fecef11b6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeModel.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package mod._toolkit;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.WriterTools;
+import util.utils;
+
+
+public class UnoTreeModel extends TestCase {
+ private static XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a textdocument");
+ xTextDoc = WriterTools.createTextDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xTextDoc ");
+
+ util.DesktopTools.closeDoc(xTextDoc);
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
+ PrintWriter log) {
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
+ "com.sun.star.awt.tree.TreeControlModel");
+ } catch (Exception e) {
+ }
+
+ log.println(
+ "creating a new environment for TreeControlModel object");
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("OBJNAME", "com.sun.star.awt.tree.TreeControlModel");
+ System.out.println("ImplementationName: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class UnoControlListBoxModel
diff --git a/qadevOOo/tests/java/mod/_toolkit/package.html b/qadevOOo/tests/java/mod/_toolkit/package.html
new file mode 100644
index 000000000000..371cdbc777fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'toolkit'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_typeconverter.uno/TypeConverter.java b/qadevOOo/tests/java/mod/_typeconverter.uno/TypeConverter.java
new file mode 100644
index 000000000000..e6bd253e2447
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_typeconverter.uno/TypeConverter.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._typeconverter.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+public class TypeConverter extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.script.Converter" );
+ }
+ catch( Exception e ) {
+ log.println("Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class TypeConverter
+
diff --git a/qadevOOo/tests/java/mod/_typeconverter.uno/package.html b/qadevOOo/tests/java/mod/_typeconverter.uno/package.html
new file mode 100644
index 000000000000..7db1f329e77c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_typeconverter.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'tcv'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_typemgr.uno/TypeDescriptionManager.java b/qadevOOo/tests/java/mod/_typemgr.uno/TypeDescriptionManager.java
new file mode 100644
index 000000000000..ce278a2095f2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_typemgr.uno/TypeDescriptionManager.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._typemgr.uno;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+public class TypeDescriptionManager extends TestCase {
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, xMSF);
+ // get context
+ XComponentContext xContext = (XComponentContext)
+ UnoRuntime.queryInterface(XComponentContext.class,
+ xProp.getPropertyValue("DefaultContext"));
+ // get the type description manager from context
+ oInterface = xContext.getValueByName("/singletons/" +
+ "com.sun.star.reflection.theTypeDescriptionManager");
+ }
+ catch( Exception e ) {
+ log.println("Introspection Service not available" );
+ }
+ oObj = (XInterface) oInterface;
+
+
+
+ log.println( " creating a new environment for Introspection object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Object relation for XHierarchicalNameAccess ifc
+ // Name of the existing object
+ tEnv.addObjRelation("ElementName", "com.sun.star.container.XNameAccess") ;
+ tEnv.addObjRelation("SearchString", "com.sun.star.loader");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class TypeDescriptionManager
+
diff --git a/qadevOOo/tests/java/mod/_typemgr.uno/package.html b/qadevOOo/tests/java/mod/_typemgr.uno/package.html
new file mode 100644
index 000000000000..4bd4217bedba
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_typemgr.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'tdmgr'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java b/qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java
new file mode 100644
index 000000000000..fcf8a696d5e1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.ContentProviderFactory</code>. <p>
+*/
+public class UcbContentProviderProxyFactory extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.ContentProviderFactory</code>.
+ */
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UcbContentProviderProxyFactory" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class UcbContentProviderProxyFactory
+
diff --git a/qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java b/qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java
new file mode 100644
index 000000000000..aa22b68d851c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+public class UcbPropertiesManager extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UcbPropertiesManager" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class UcbPropertiesManager
+
diff --git a/qadevOOo/tests/java/mod/_ucb/UcbStore.java b/qadevOOo/tests/java/mod/_ucb/UcbStore.java
new file mode 100644
index 000000000000..2e0489037ff4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbStore.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.Store</code>. <p>
+*/
+public class UcbStore extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.Store</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.comp.ucb.UcbStore" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class UcbStore
+
diff --git a/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java b/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java
new file mode 100644
index 000000000000..9f886179647e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.UniversalContentBroker</code>. <p>
+*/
+public class UniversalContentBroker extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucb.UniversalContentBroker</code>.
+ */
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj);
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+
+ tEnv.addObjRelation("CONTENT1",
+ "vnd.sun.star.webdav://localhost/davhome/");
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class UniversalContentBroker
+
diff --git a/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java b/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java
new file mode 100644
index 000000000000..6dccbf02020d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucpchelp;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class CHelpContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object aUCB = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.HelpContentProvider" );
+ aUCB = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB);
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+ tEnv.addObjRelation("CONTENT1", "vnd.sun.star.help://swriter?System=WIN&Language=de&Query=text&HitCount=120&Scope=Heading");
+ tEnv.addObjRelation("CONTENT2",
+ util.utils.getFullTestURL("SwXTextEmbeddedObject.sdw"));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class FileProvider
+
diff --git a/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java
new file mode 100644
index 000000000000..b5b3395cb8bb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucpdav;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Creates a <code>com.sun.star.ucb.WebDAVContentProvider</code> instance.
+ */
+public class WebDAVContentProvider extends TestCase {
+ /**
+ * Creates a <code>com.sun.star.ucb.WebDAVContentProvider</code> instance
+ * and adds a <code>XContentIdentifierFactory</code> instance as a "FACTORY"
+ * relation for <code>XContentProviderTest</code>.
+ */
+ public TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface xInt;
+
+ log.println("creating WebDAVContentProvider instance");
+ try {
+ xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.ucb.WebDAVContentProvider");
+ } catch (Exception e) {
+ log.println("Unexpected exception " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ log.println("creating XContentIdentifierFactory");
+ XContentIdentifierFactory xCIF;
+
+ try {
+ xCIF = (XContentIdentifierFactory)UnoRuntime.queryInterface(
+ XContentIdentifierFactory.class,
+ xMSF.createInstance(
+ "com.sun.star.comp.ucb.UniversalContentBroker"));
+ } catch (Exception e) {
+ log.println("Unexpected exception " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ tEnv.addObjRelation("FACTORY", xCIF);
+
+ tEnv.addObjRelation("CONTENT1",
+ "vnd.sun.star.webdav://localhost/davhome/");
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java b/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java
new file mode 100644
index 000000000000..1258ec52be1a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucpfile;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class FileProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.FileProvider" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj);
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+ tEnv.addObjRelation("CONTENT1",
+ util.utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF()));
+ tEnv.addObjRelation("CONTENT2",
+ util.utils.getFullTestURL("SwXTextEmbeddedObject.sdw"));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class FileProvider
+
diff --git a/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java b/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java
new file mode 100644
index 000000000000..bb80761d6725
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucpftp;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class FTPContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object aUCB = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.ucb.FTPContentProvider" );
+ aUCB = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB);
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+ util.dbg.printInterfaces(oObj);
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+ tEnv.addObjRelation("CONTENT1","ftp:///ftp.sun.com");
+ tEnv.addObjRelation("CONTENT2","ftp:///ftp.openoffice.org");
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class FileProvider
+
diff --git a/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java
new file mode 100644
index 000000000000..ce1901254d7f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucphier;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class HierarchyContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object ucb = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.HierarchyContentProvider" );
+ ucb = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb);
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+ tEnv.addObjRelation("CONTENT1","vnd.sun.star.hier:/");
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class HierarchyContentProvider
+
diff --git a/qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java b/qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java
new file mode 100644
index 000000000000..a54f1bc8a151
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucphier;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Creates <code>HierarchyDataSource</code> implementation of
+ * <code>ucphier</code> module.
+ *
+ * @see ifc.lang._XMultiServiceFactory
+ */
+public class HierarchyDataSource extends TestCase {
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ oInterface = xMSF.createInstance(
+ "com.sun.star.ucb.DefaultHierarchyDataSource");
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java b/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java
new file mode 100644
index 000000000000..021cdadc7cc3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucppkg;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class PackageContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object ucb = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.PackageContentProvider" );
+ ucb = xMSF.createInstance
+ ( "com.sun.star.comp.ucb.UniversalContentBroker" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb);
+
+ System.out.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //Adding ObjRelation for XContentProvider
+ tEnv.addObjRelation("FACTORY",CIF);
+ tEnv.addObjRelation("CONTENT1",
+ "vnd.sun.star.pkg://file:%2F%2F%2Fe:%2Fmy.xsw/");
+ tEnv.addObjRelation("CONTENT2",
+ "vnd.sun.star.pkg://file:%2F%2F%2Fe:%2Fyour.xsw/");
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class PackageContentProvider
+
diff --git a/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java b/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java
new file mode 100644
index 000000000000..d17b4f5be065
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.ucb.RemoteAccessContentProvider</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::ucb::XContentProvider</code></li>
+* <li> <code>com::sun::star::ucb::XFileIdentifierConverter</code></li>
+* <li> <code>com::sun::star::ucb::XContentIdentifierFactory</code></li>
+* <li> <code>com::sun::star::ucb::XParameterizedContentProvider</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see com.sun.star.ucb.XContentProvider
+* @see com.sun.star.ucb.XFileIdentifierConverter
+* @see com.sun.star.ucb.XContentIdentifierFactory
+* @see com.sun.star.ucb.XParameterizedContentProvider
+* @see ifc.ucb._XContentProvider
+* @see ifc.ucb._XFileIdentifierConverter
+* @see ifc.ucb._XContentIdentifierFactory
+* @see ifc.ucb._XParameterizedContentProvider
+*/
+public class ContentProvider extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.ucprmt.ContentProvider</code>. <p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'FACTORY'</code> for
+ * {@link ifc.ucb._XContentProvider} factory for
+ * content identifiers. Here it is
+ * <code>UniversalContentBroker</code> service.</li>
+ * <li> <code>'CONTENT1'</code> for
+ * {@link ifc.ucb._XContentProvider}: suitable
+ * content URL for this provider </li>
+ * <li> <code>'CONTENT2'</code> for
+ * {@link ifc.ucb._XContentProvider}: another suitable
+ * content URL for this provider </li>
+ * </ul>
+ */
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XContentIdentifierFactory cntIDFac = null ;
+
+ try {
+ oObj = (XInterface) xMSF.createInstance
+ ("com.sun.star.ucb.RemoteAccessContentProvider");
+ cntIDFac = (XContentIdentifierFactory) UnoRuntime.queryInterface
+ (XContentIdentifierFactory.class, oObj) ;
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ if (oObj == null) {
+ log.println("!!! Object wasn't created !!!") ;
+ throw new StatusException(Status.failed
+ ("!!! Object wasn't created !!!")) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XContentProvider
+ tEnv.addObjRelation("FACTORY", cntIDFac) ;
+ tEnv.addObjRelation("CONTENT1","vnd.sun.star.wfs:///user/work");
+ tEnv.addObjRelation("CONTENT2","vnd.sun.star.wfs:///user/config");
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java b/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java
new file mode 100644
index 000000000000..5dba0063dd75
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XRemoteContentProviderAcceptor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ProviderAcceptor extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.ucb.RemoteContentProviderAcceptor");
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //adding ObjRelation for XRemoteContentProviderAcceptor
+ XRemoteContentProviderAcceptor xRCPA = (XRemoteContentProviderAcceptor)
+ UnoRuntime.queryInterface(XRemoteContentProviderAcceptor.class,oObj);
+
+ tEnv.addObjRelation("RCPA",xRCPA);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java b/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java
new file mode 100644
index 000000000000..af878cdf1755
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import java.io.PrintWriter;
+
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class ProxyProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ XContentIdentifierFactory cntIDFac = null ;
+
+ try {
+ oObj = (XInterface) xMSF.createInstance
+ ("com.sun.star.ucb.RemoteProxyContentProvider");
+ cntIDFac = (XContentIdentifierFactory) UnoRuntime.queryInterface
+ (XContentIdentifierFactory.class, oObj) ;
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ if (oObj == null) {
+ log.println("!!! Object wasn't created !!!") ;
+ throw new StatusException(Status.failed
+ ("!!! Object wasn't created !!!")) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XContentProvider
+ tEnv.addObjRelation("FACTORY", cntIDFac) ;
+ tEnv.addObjRelation("CONTENT1","vnd.sun.star.pkg:///user/work");
+ tEnv.addObjRelation("CONTENT1","vnd.sun.star.wfs://");
+
+ tEnv.addObjRelation("NoCONTENT",new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java b/qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java
new file mode 100644
index 000000000000..4dec44420321
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._uui;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+* Test for object which is represented by service
+* <code>com.sun.star.uui.InteractionHandler</code>. <p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>com::sun::star::task::XInteractionHandler</code></li>
+* </ul>
+* This object test <b> is NOT </b> designed to be run in several
+* threads concurently.
+* @see ifc.task._XInteractionHandler
+*/
+public class UUIInteractionHandler extends TestCase {
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.uui.InteractionHandler</code>.
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
+ oInterface = xMSF.createInstance
+ ( "com.sun.star.uui.InteractionHandler" );
+ }
+ catch( com.sun.star.uno.Exception e ) {
+ log.println("Can't create an object." );
+ throw new StatusException( "Can't create an object", e );
+ }
+
+ oObj = (XInterface) oInterface;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_uuresolver.uno/UnoUrlResolver.java b/qadevOOo/tests/java/mod/_uuresolver.uno/UnoUrlResolver.java
new file mode 100644
index 000000000000..46758c6e3d22
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uuresolver.uno/UnoUrlResolver.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._uuresolver.uno;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+public class UnoUrlResolver extends TestCase {
+
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.UnoUrlResolver");
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+ Object oBFctr = xMSF.createInstance(
+ "com.sun.star.bridge.BridgeFactory");
+ tEnv.addObjRelation("BRIDGEFACTORY", oBFctr);
+
+ Object oAcctr = xMSF.createInstance(
+ "com.sun.star.connection.Acceptor") ;
+ tEnv.addObjRelation("ACCEPTOR", oAcctr);
+
+ int port = util.utils.getNextFreePort(20004);
+ tEnv.addObjRelation("PORT", new Integer(port));
+
+ return tEnv;
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_uuresolver.uno/package.html b/qadevOOo/tests/java/mod/_uuresolver.uno/package.html
new file mode 100644
index 000000000000..31e2a677b04f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uuresolver.uno/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'uuresolver'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java b/qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java
new file mode 100644
index 000000000000..ebea2c62b679
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._uuresolver;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.XInterface;
+
+public class UnoUrlResolver extends TestCase {
+
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+
+ try {
+ XInterface xInt = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.UnoUrlResolver");
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+ Object oBFctr = xMSF.createInstance(
+ "com.sun.star.bridge.BridgeFactory");
+ tEnv.addObjRelation("BRIDGEFACTORY", oBFctr);
+
+ Object oAcctr = xMSF.createInstance(
+ "com.sun.star.connection.Acceptor") ;
+ tEnv.addObjRelation("ACCEPTOR", oAcctr);
+
+ String os = System.getProperty("OS");
+ System.out.println("OS: " + os);
+ int port = 20004;
+ if (os.equalsIgnoreCase("wntmsci"))
+ port = 20004;
+ if (os.equalsIgnoreCase("unxsols"))
+ port = 20004;
+ if (os.equalsIgnoreCase("unxsoli"))
+ port = 30004;
+ if (os.equalsIgnoreCase("unxlngi"))
+ port = 20006;
+
+ tEnv.addObjRelation("PORT", new Integer(port));
+
+ return tEnv;
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_uuresolver/package.html b/qadevOOo/tests/java/mod/_uuresolver/package.html
new file mode 100644
index 000000000000..31e2a677b04f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uuresolver/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'uuresolver'.</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java
new file mode 100644
index 000000000000..93d9de99b214
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLContentExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLContentExporter extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLContentExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The chart document is set as a source document for exporter
+ * created. A new 'main title' is set for chart. This made
+ * for checking if this title is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String exportStr = "XMLContentExporter" ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Chart.XMLContentExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xChartDoc);
+
+ Object oTitle = xChartDoc.getTitle() ;
+ XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oTitle) ;
+ xTitleProp.setPropertyValue("String", exportStr) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ filter.addTag(new XMLTools.Tag("office:document-content")) ;
+ filter.addTagEnclosed(new XMLTools.Tag("office:body"),
+ new XMLTools.Tag("office:document-content"));
+ filter.addCharactersEnclosed(exportStr,
+ new XMLTools.Tag("chart:title")) ;
+
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"schart: StarOffice XML (Chart)"}));
+ tEnv.addObjRelation("SourceDocument",xChartDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check() ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java
new file mode 100644
index 000000000000..4801b2a4c893
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLContentImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLContentImporter extends TestCase {
+ XComponent comp ;
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New chart document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ comp = xChartDoc;
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ comp = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLContentImporter</code><p>
+ *
+ * The chart document is set as a target document for importer.
+ * Imported XML-data contains the tag which specifies the title
+ * of a chart.
+ * After import title name getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impValue = "XMLContentImporter_test" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ final XPropertySet xTitleProp ;
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Chart.XMLContentImporter") ;
+
+
+ Object oTitle = xChartDoc.getTitle() ;
+ xTitleProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oTitle) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-content",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
+ "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table",
+ "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg",
+ "office:class", "CDATA", "chart"
+ ,"office:version", "CDATA", "1.0"
+ },
+ {"start", "office:body"},
+ {"start", "chart:chart"},
+ {"start", "chart:title"},
+ {"start", "text:p"},
+ {"chars", impValue},
+ {"end", "text:p"},
+ {"end", "chart:title"},
+ {"end", "chart:chart"},
+ {"end", "office:body"},
+ {"end", "office:document-content"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String)
+ xTitleProp.getPropertyValue("String") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impValue.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println
+ ("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java
new file mode 100644
index 000000000000..ccea9da56f1b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The chart document is set as a source document for exporter
+ * created. A new 'main title' is set for chart. This made
+ * for checking if this title is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String exportStr = "XMLExporter test." ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Chart.XMLExporter", new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xChartDoc);
+
+ Object oTitle = xChartDoc.getTitle() ;
+ XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oTitle) ;
+ xTitleProp.setPropertyValue("String", exportStr) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ filter.addTag(new XMLTools.Tag("office:document")) ;
+ filter.addTagEnclosed(new XMLTools.Tag("office:meta"),
+ new XMLTools.Tag("office:document"));
+ filter.addTagEnclosed(new XMLTools.Tag("office:body"),
+ new XMLTools.Tag("office:document"));
+ filter.addCharactersEnclosed(exportStr,
+ new XMLTools.Tag("chart:title")) ;
+
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"schart: StarOffice XML (Chart)"}));
+ tEnv.addObjRelation("SourceDocument",xChartDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check() ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java
new file mode 100644
index 000000000000..52b3b3ce03d8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+ XComponent comp ;
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New chart document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ comp = xChartDoc;
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ comp = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLImporter</code><p>
+ *
+ * The chart document is set as a target document for importer.
+ * Imported XML-data contains the tag which specifies the title
+ * of a chart.
+ * After import title name getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impValue = "XMLImporter_test" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ final XPropertySet xTitleProp ;
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Chart.XMLImporter") ;
+
+ Object oTitle = xChartDoc.getTitle() ;
+ xTitleProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oTitle) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
+ "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table",
+ "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg",
+ "office:class", "CDATA", "chart"
+ ,"office:version", "CDATA", "1.0"
+ },
+ {"start", "office:body"},
+ {"start", "chart:chart"},
+ {"start", "chart:title"},
+ {"start", "text:p"},
+ {"chars", impValue},
+ {"end", "text:p"},
+ {"end", "chart:title"},
+ {"end", "chart:chart"},
+ {"end", "office:body"},
+ {"end", "office:document-content"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String)
+ xTitleProp.getPropertyValue("String") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impValue.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println
+ ("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java
new file mode 100644
index 000000000000..ce399da29702
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLStylesExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLStylesExporter extends TestCase {
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLStylesExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * Existing of some tags checked in XML data exported.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Chart.XMLStylesExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xChartDoc);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+
+ filter.addTag(new XMLTools.Tag("office:document-styles")) ;
+ filter.addTagEnclosed(new XMLTools.Tag("office:styles"),
+ new XMLTools.Tag("office:document-styles"));
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"schart: StarOffice XML (Chart)"}));
+ tEnv.addObjRelation("SourceDocument",xChartDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check() ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java
new file mode 100644
index 000000000000..01f89d61ad68
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Chart.XMLStylesImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLStylesImporter extends TestCase {
+ XComponent comp ;
+ XChartDocument xChartDoc = null;
+
+ /**
+ * New chart document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xChartDoc = SOF.createChartDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ comp = xChartDoc;
+ }
+
+ /**
+ * Close document
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ if( xChartDoc!=null ) {
+ log.println( " closing xChartDoc" );
+ util.DesktopTools.closeDoc(xChartDoc);
+ xChartDoc = null;
+ comp = null;
+ }
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Chart.XMLStylesImporter</code><p>
+ *
+ * The chart document is set as a target document for importer.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Chart.XMLStylesImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", comp) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-styles",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
+ "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart",
+ "xmlns:style", "CDATA", "http://openoffice.org/2000/style",
+ "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg",
+ "office:class", "CDATA", "chart",
+ "office:version", "CDATA", "1.0"
+ },
+ {"start", "office:styles"},
+ {"end", "office:styles"},
+ {"end", "office:document-styles"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ logF.println("No ways to check styles import were not found.");
+ logF.println(" TRUE returned.");
+ return true ;
+/* } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+*/ }
+ }) ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java
new file mode 100644
index 000000000000..b0f38f3d741c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLContentExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLContentExporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLContentExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The draw document is set as a source document for exporter
+ * created. Then a new page (Slide) created in this document and
+ * both two pages renamed to 'NewSlide1' and 'NewSlide2'. After this
+ * filter checks that new tags exist in the XML output.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ // Adding tags for checking existance of head tag and other tags
+ filter.addTag(new XMLTools.Tag("office:document-content"));
+ filter.addTag(new XMLTools.Tag("office:body"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag("draw:page"),
+ new XMLTools.Tag("office:body"));
+ filter.addTag(new XMLTools.Tag("draw:page","draw:name","NewSlide1"));
+ filter.addTag(new XMLTools.Tag("draw:page","draw:name","NewSlide2"));
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Draw.XMLContentExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ //xEx.setSourceDocument(xDrawDoc);
+
+ XDrawPagesSupplier supp = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages set = supp.getDrawPages();
+
+ // This is an XML-export BUG (new slide named "NewSlide2"
+ // can not be exported to XML)
+ set.insertNewByIndex(1);
+
+ XDrawPage page1 = (XDrawPage)
+ UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0));
+ XNamed NPage1 = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class,page1);
+ NPage1.setName("NewSlide1");
+ XDrawPage page2 = (XDrawPage)
+ UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1));
+ XNamed NPage2 = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class,page2);
+ NPage2.setName("NewSlide2");
+ xEx.setSourceDocument(xDrawDoc);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"sdraw: StarOffice XML (Draw)"}));
+ tEnv.addObjRelation("SourceDocument",xDrawDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java
new file mode 100644
index 000000000000..96d68e2218cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLContentImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLContentImporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLContentImporter</code><p>
+ *
+ * The Draw document is set as a target document for importer.
+ * Imported XML-data contains only content tags including pages
+ * named 'NewSlide1' and 'NewSlide2'.
+ * Pages getting from target document is checked after import
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLContentImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xDrawDoc) ;
+
+ // New XML document generated to be imported to Draw document
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing",
+ "office:class", "CDATA", "drawing"
+ ,"office:version", "CDATA", "1.0"
+ },
+ {"start", "office:body"},
+ {"start", "draw:page",
+ "draw:name", "CDATA", "NewSlide1",
+ "draw:master-page-name", "CDATA", "Default"},
+ {"end", "draw:page"},
+ {"start", "draw:page", "draw:name", "CDATA", "NewSlide2",
+ "draw:master-page-name", "CDATA", "Default"},
+ {"end","draw:page"},
+ {"end", "draw:page"},
+ {"end", "office:body"},
+ {"end", "office:document"}};
+
+ // adding relation for XDocumentHandler
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml);
+
+ //save to log content before import
+ final PrintWriter fLog = log;
+
+ // Checking target document after import
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ XDrawPagesSupplier supp = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xDrawDoc);
+ final XDrawPages xPages = supp.getDrawPages();
+ XNamed[] pageArray = new XNamed[ xPages.getCount() ];
+ for (int i=0; i < xPages.getCount(); i++) {
+ try {
+ pageArray[i] = (XNamed) UnoRuntime.queryInterface
+ (XNamed.class, xPages.getByIndex(i));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(fLog) ;
+ throw new StatusException
+ ("Can't get page name by index.", e) ;
+ }
+ }
+ fLog.println("Slide names after import:");
+ for ( int i = 0; i < xPages.getCount(); i++ ) {
+ if ((pageArray[i].getName().equals("NewSlide1"))
+ || (pageArray[i].getName().equals("NewSlide2"))) {
+ fLog.println(" " + pageArray[i].getName());
+ }
+ else {
+ fLog.println("Error: some imported values are not exist in target document!");
+ return false;
+ }
+ }
+ return true;
+ }
+ });
+
+ return tEnv;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java
new file mode 100644
index 000000000000..996fc2c7c062
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The draw document is set as a source document for exporter
+ * created. Then a new page (Slide) created in this document and
+ * both two pages renamed to 'NewSlide1' and 'NewSlide2'. After this
+ * filter checks that new tags exist in the XML output.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ // Adding tags for checking existance of head tag and other tags
+ filter.addTag(new XMLTools.Tag("office:document"));
+ filter.addTag(new XMLTools.Tag("office:body"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag("draw:page"),
+ new XMLTools.Tag("office:body"));
+ filter.addTag(new XMLTools.Tag("draw:page","draw:name","NewSlide1"));
+ filter.addTag(new XMLTools.Tag("draw:page","draw:name","NewSlide2"));
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Draw.XMLExporter", new Object[] {arg});
+
+
+ XDrawPagesSupplier supp = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
+ XDrawPages set = supp.getDrawPages();
+
+ // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML)
+ set.insertNewByIndex(1);
+
+ XDrawPage page1 = (XDrawPage)
+ UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0));
+ XNamed NPage1 = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class,page1);
+ NPage1.setName("NewSlide1");
+ XDrawPage page2 = (XDrawPage)
+ UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1));
+ XNamed NPage2 = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class,page2);
+ NPage2.setName("NewSlide2");
+
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xDrawDoc);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"sdraw: StarOffice XML (Draw)"}));
+ tEnv.addObjRelation("SourceDocument",xDrawDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java
new file mode 100644
index 000000000000..93d3d3787ef2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLImporter</code><p>
+ *
+ * The Draw document is set as a target document for importer.
+ * Imported XML-data contains only content tags including pages
+ * named 'NewSlide1' and 'NewSlide2'.
+ * Pages getting from target document are checked after import.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Draw.XMLImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xDrawDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing",
+ "office:class", "CDATA", "drawing"
+ ,"office:version", "CDATA", "1.0"
+ },
+ {"start", "office:body"},
+ {"start", "draw:page",
+ "draw:name", "CDATA", "NewSlide1",
+ "draw:master-page-name", "CDATA", "Default"},
+ {"end", "draw:page"},
+ {"start", "draw:page",
+ "draw:name", "CDATA", "NewSlide2",
+ "draw:master-page-name", "CDATA", "Default"},
+ {"end","draw:page"},
+ {"end", "draw:page"},
+ {"end", "office:body"},
+ {"end", "office:document"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ //save to log content before import
+ final PrintWriter fLog = log;
+
+ // Checking target document after import
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ XDrawPagesSupplier supp = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xDrawDoc);
+ final XDrawPages xPages = supp.getDrawPages();
+ XNamed[] pageArray = new XNamed[ xPages.getCount() ];
+ for (int i=0; i < xPages.getCount(); i++) {
+ try {
+ pageArray[i] = (XNamed) UnoRuntime.queryInterface
+ (XNamed.class, xPages.getByIndex(i));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(fLog) ;
+ throw new StatusException
+ ("Can't get page name by index.", e) ;
+ }
+ }
+ fLog.println("Slide names after import:");
+ for ( int i = 0; i < xPages.getCount(); i++ ) {
+ if ((pageArray[i].getName().equals("NewSlide1"))
+ || (pageArray[i].getName().equals("NewSlide2"))) {
+ fLog.println(" " + pageArray[i].getName());
+ }
+ else {
+ fLog.println("Error: some imported values are not exist in target document!");
+ return false;
+ }
+ }
+ return true;
+ }
+ });
+
+ return tEnv;
+ } // end of getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
new file mode 100644
index 000000000000..b572027f3857
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLMetaExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLMetaExporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLMetaExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The draw document is set as a source document for exporter
+ * created. Set title of document to 'XMLMetaExporter'.
+ * This made for checking if this title is successfully exported within
+ * the document meta information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String TITLE = "XMLMetaExporter";
+
+ FilterChecker filter = new FilterChecker(log) ;
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Draw.XMLMetaExporter", new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class, oObj);
+ xEx.setSourceDocument(xDrawDoc);
+
+ //set some meta data
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
+ xDrawDoc) ;
+ XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ docInfo.setPropertyValue("Title", TITLE);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Checking Head Tag existance and that property has changed
+ filter.addTag(new XMLTools.Tag ("office:document-meta"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag("office:meta"),
+ new XMLTools.Tag("office:document-meta") );
+ filter.addTagEnclosed(
+ new XMLTools.Tag("dc:title"),
+ new XMLTools.Tag("office:meta") );
+ filter.addCharactersEnclosed( TITLE,
+ new XMLTools.Tag("dc:title") );
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"sdraw: StarOffice XML (Draw)"}));
+ tEnv.addObjRelation("SourceDocument", xDrawDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
new file mode 100644
index 000000000000..ff76e821a1b9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLMetaImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLMetaImporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Draw document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLMetaImporter</code><p>
+ *
+ * The draw document is set as a target document for importer.
+ * Imported XML-data contains only meta tags including
+ * title tag with test name.
+ * After import title name getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Draw.XMLMetaImporter") ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xDrawDoc) ;
+
+ final String impTitle = "XMLMetaImporter" ;
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-meta",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:meta", "CDATA", "http://openoffice.org/2000/meta",
+ "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"
+ },
+ {"start", "office:meta"},
+ {"start", "dc:title"},
+ {"chars", impTitle},
+ {"end", "dc:title"},
+ {"end", "office:meta"},
+ {"end", "office:document-meta"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ //set some meta data
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xDrawDoc);
+ final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo());
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String) docInfo.getPropertyValue
+ ("Title") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java
new file mode 100644
index 000000000000..a1f70a0223fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLSettingsExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLSettingsExporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>om.sun.star.comp.Draw.XMLSettingsExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The draw document is set as a source document for exporter
+ * created. Property 'IsLayerMode' set to true.
+ * This made for checking if this property is successfully exported within
+ * the document styles information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ FilterChecker filter = new FilterChecker(log) ;
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Draw.XMLSettingsExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class, oObj);
+ xEx.setSourceDocument(xDrawDoc);
+
+ //set some settings
+ XModel xDrawModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+ XController xController = xDrawModel.getCurrentController();
+ XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+ xPropSet.setPropertyValue("IsLayerMode", new Boolean("true"));
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Checking Head Tag existance and that property has changed
+ filter.addTag(new XMLTools.Tag ("office:document-settings"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag ("office:settings"),
+ new XMLTools.Tag ("office:document-settings") );
+ filter.addTagEnclosed(
+ new XMLTools.Tag ("config:config-item-set"),
+ new XMLTools.Tag ("office:settings") );
+ filter.addTagEnclosed(
+ new XMLTools.Tag ("config:config-item-map-indexed"),
+ new XMLTools.Tag ("config:config-item-set") );
+ filter.addCharactersEnclosed( "true",
+ new XMLTools.Tag( "config:config-item",
+ "config:name",
+ "IsLayerMode" ));
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"sdraw: StarOffice XML (Draw)"}));
+ tEnv.addObjRelation("SourceDocument", xDrawDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java
new file mode 100644
index 000000000000..30ea302140c0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLSettingsImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLSettingsImporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text draw destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLSettingsImporter</code><p>
+ *
+ * The draw document is set as a target document for importer.
+ * Imported XML-data contains only settings tags including
+ * tag with property 'IsLayerMode'.
+ * After import property 'IsLayerMode' getting from target
+ * document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLSettingsImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xDrawDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-settings",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:config", "CDATA", "http://openoffice.org/2001/config"},
+ {"start", "office:settings"},
+ {"start", "config:config-item-set",
+ "config:name", "CDATA", "view-settings"},
+ {"start", "config:config-item-map-indexed",
+ "config:name", "CDATA", "Views"},
+ {"start", "config:config-item-map-entry"},
+ {"start", "config:config-item",
+ "config:name", "CDATA", "IsLayerMode",
+ "config:type", "CDATA", "boolean"},
+ {"chars", "true"},
+ {"end", "config:config-item"},
+ {"end", "config:config-item-map-entry"},
+ {"end", "config:config-item-map-indexed"},
+ {"end", "config:config-item-set"},
+ {"end", "office:settings"},
+ {"end", "office:document-settings"} };
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml);
+ final PrintWriter logF = log;
+ XModel xDrawModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+ XController xController = xDrawModel.getCurrentController();
+ final XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ Boolean value = (Boolean)
+ xPropSet.getPropertyValue("IsLayerMode");
+ logF.println("'IsLayerMode' property value is '"
+ + value + "'");
+ return value.booleanValue() == true;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception while checking import :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java
new file mode 100644
index 000000000000..bd4180571506
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLStylesExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLStylesExporter extends TestCase {
+ XComponent xDrawDoc = null;
+ protected static int counter = 0;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLStylesExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The draw document is set as a source document for exporter
+ * created. New style is added to the style family 'graphics' with unique name
+ * every time. This made for checking if this style is successfully exported
+ * within the document styles information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log) ;
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+ final String STYLE_NAME = "New style" + counter++ ;
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Draw.XMLStylesExporter", new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xDrawDoc);
+
+ //obtain style families
+ XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xDrawDoc);
+ XNameAccess StyleFamilies = styleSup.getStyleFamilies();
+ //obtain all style family names
+ String[] styleFamiliesNames = StyleFamilies.getElementNames();
+ String styleFamilyName = styleFamiliesNames[0];
+ //obtain style family with name[0]
+ Object objectStyle = StyleFamilies.getByName(styleFamilyName);
+ XNameContainer xStyleFamilyName = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, objectStyle);
+ //creat new style
+ Object SC = SOF.createInstance(xDrawDoc, "com.sun.star.style.Style");
+ XStyle Style = (XStyle) UnoRuntime.queryInterface(XStyle.class,SC);
+ //add new style to style familiy with name[0]
+ xStyleFamilyName.insertByName(STYLE_NAME,Style);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Checking Head Tag existance and that property has changed
+ filter.addTag(new XMLTools.Tag ("office:document-styles"));
+ filter.addTag(new XMLTools.Tag ("office:styles"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag("style:style"),
+ new XMLTools.Tag("office:styles") );
+ filter.addTag(new XMLTools.Tag("style:style", "style:name", STYLE_NAME));
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"sdraw: StarOffice XML (Draw)"}));
+ tEnv.addObjRelation("SourceDocument",xDrawDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java
new file mode 100644
index 000000000000..2466d4dcfa7e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Draw.XMLStylesImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLStylesImporter extends TestCase {
+ XComponent xDrawDoc = null;
+
+ /**
+ * New draw document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a drawdocument" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Text draw destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Draw.XMLStylesImporter</code><p>
+ *
+ * The draw document is set as a target document for importer.
+ * Imported XML-data contains only styles tags including
+ * tag with new style.
+ * After import checked existing of this new style in style
+ * collection obtained from target document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLStylesImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xDrawDoc) ;
+
+ final String impStyleName = "New style for test XMLStylesImporter";
+ final String impFamilyName = "graphics";
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-styles",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:style", "CDATA", "http://openoffice.org/2000/style"},
+ {"start", "office:styles"},
+ {"start", "style:style",
+ "style:name", "CDATA", impStyleName,
+ "style:family", "CDATA", impFamilyName},
+ {"end", "style:style"},
+ {"end", "office:styles"},
+ {"end", "office:document"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log;
+ //obtain style families
+ XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface (XStyleFamiliesSupplier.class, xDrawDoc) ;
+ final XNameAccess StyleFamilies = styleSup.getStyleFamilies();
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ Object objectStyle =
+ StyleFamilies.getByName(impFamilyName);
+ XNameContainer StyleFamilyName = (XNameContainer)
+ UnoRuntime.queryInterface
+ (XNameContainer.class, objectStyle);
+ boolean hasStyle =
+ StyleFamilyName.hasByName(impStyleName);
+ logF.println("Does style with name '" + impStyleName
+ + "' exist? " + String.valueOf(hasStyle) );
+ return hasStyle;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception while checking import :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
new file mode 100644
index 000000000000..defe48794929
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLContentExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLContentExporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xImpressDoc " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLContentExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The impress document is set as a source document for exporter
+ * created. The existing draw page is gotten a new name. This made
+ * for checking if this new name is successfully exported within
+ * the document content.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ final String expPageName = "XMLContentExporter" ;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Impress.XMLContentExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xImpressDoc);
+
+ // assigning a draw page a new name
+ XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xImpressDoc) ;
+ XDrawPages xPages = xPagesSup.getDrawPages() ;
+ XNamed xPageName = (XNamed) UnoRuntime.queryInterface
+ (XNamed.class, xPages.getByIndex(0)) ;
+ xPageName.setName(expPageName) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags required to be in XML data exported.
+ filter.addTag(new XMLTools.Tag("office:document-content")) ;
+ filter.addTagEnclosed(new XMLTools.Tag("office:body"),
+ new XMLTools.Tag("office:document-content")) ;
+ filter.addTagEnclosed(
+ new XMLTools.Tag("draw:page", "draw:name", expPageName),
+ new XMLTools.Tag("office:body")) ;
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"simpress: StarOffice XML (Impress)"}));
+ tEnv.addObjRelation("SourceDocument",xImpressDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+
+ log.println("Implementation Name: "+util.utils.getImplName(oObj));
+
+ return tEnv;
+
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check() ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
new file mode 100644
index 000000000000..8de42bcb3bdb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLContentImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLContentImporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New chart document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLContentImporter</code><p>
+ *
+ * The chart document is set as a target document for importer.
+ * Imported XML-data contains the tag with a new page which has
+ * some name.
+ * After import page name getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam,PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impPageName = "XMLImporterPage" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLContentImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xImpressDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:presentation", "CDATA", "http://openoffice.org/2000/presentation",
+ "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg",
+ "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing",
+ "office:class", "CDATA", "presentation"
+ ,"office:version", "CDATA", "1.0"
+ },
+ {"start", "office:body"},
+ {"start", "draw:page",
+ "draw:name", "CDATA", impPageName,
+ "draw:master-page-name", "CDATA", "Default"
+ },
+ {"start", "presentation:notes"},
+ {"start", "draw:page-thumbnail",
+ "draw:style-name", "CDATA", "gr1",
+ "draw:layer", "CDATA", "layout",
+ "svg:width", "CDATA", "12.768cm",
+ "svg:height", "CDATA", "9.576cm",
+ "svg:x", "CDATA", "4.411cm",
+ "svg:y", "CDATA", "2.794cm",
+ "presentation:class", "CDATA", "page",
+ "draw:page-number", "CDATA", "1"
+ },
+ {"end", "draw:page-thumbnail"},
+ {"start", "draw:text-box",
+ "presentation:style-name", "CDATA", "Default-notes",
+ "draw:layer", "CDATA", "layout",
+ "svg:width", "CDATA", "15.021cm",
+ "svg:height", "CDATA", "10.63cm",
+ "svg:x", "CDATA", "3.292cm",
+ "svg:y", "CDATA", "13.299cm",
+ "presentation:class", "CDATA", "notes",
+ "presentation:placeholder", "CDATA", "true"
+ },
+ {"end", "draw:text-box"},
+ {"end", "presentation:notes"},
+ {"end", "draw:page"},
+ {"end", "office:body"},
+ {"end", "office:document"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xImpressDoc) ;
+ XDrawPages xPages = xPagesSup.getDrawPages() ;
+ XNamed xPageName = (XNamed) UnoRuntime.queryInterface
+ (XNamed.class, xPages.getByIndex(0)) ;
+ String gName = xPageName.getName() ;
+ logF.println("Page name returned = '" + gName + "'") ;
+ return impPageName.equals(gName) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
+
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
new file mode 100644
index 000000000000..18fab3f93505
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLExporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New impress document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xImpressDoc " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The impress document is set as a source document for exporter
+ * created. A new draw page with specific name created. This made
+ * for checking if this draw page is successfully exported within
+ * the document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ FilterChecker Filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), Filter);
+
+ final String NAME = "XMLExporter";
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Impress.XMLExporter", new Object[] {arg});
+
+ //get draw pages
+ XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPages drawPages = drawPagesSupplier.getDrawPages();
+ //insert new draw page
+ XDrawPage newDrawPage = drawPages.insertNewByIndex(0);
+ //set specific test name
+ XNamed newPageNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, newDrawPage);
+ newPageNamed.setName(NAME);
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xImpressDoc);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // adding tags which must be contained in XML output
+ Filter.addTag( new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("office:body"),
+ new XMLTools.Tag("office:document") );
+ Filter.addTagEnclosed(
+ new XMLTools.Tag("draw:page", "draw:name", NAME),
+ new XMLTools.Tag("office:body") );
+
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"simpress: StarOffice XML (Impress)"}));
+ tEnv.addObjRelation("SourceDocument",xImpressDoc);
+ tEnv.addObjRelation("XFilter.Checker", Filter) ;
+
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
new file mode 100644
index 000000000000..4028f0661400
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLImporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New impress document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Impress document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLImporter</code><p>
+ *
+ * The impress document is set as a target document for importer.
+ * Imported tags contain page with the specific name.
+ * After import existence of the page with this specific
+ * name is checked in the target document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLImporter") ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xImpressDoc) ;
+
+ final String impName = "XMLImporter";
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing"
+ },
+ {"start", "office:body"},
+ {"start", "draw:page",
+ "draw:name", "CDATA", impName },
+ {"end", "draw:page"},
+ {"end", "office:body"},
+ {"end", "office:document"} };
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml);
+
+ //get draw pages
+ XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPages drawPages = drawPagesSupplier.getDrawPages();
+ final XNameAccess xNamePages = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, drawPages);
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ return xNamePages.hasByName(impName);
+ }
+ } );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
new file mode 100644
index 000000000000..fd7a4f871c76
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLMetaExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLMetaExporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New impress document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Impress document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( "disposing xImpressDoc " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLMetaExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The impress document is set as a source document for exporter
+ * created. A meta property 'Title' is set to specific value. This made
+ * for checking if this value is successfully exported within
+ * the document meta information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class), filter);
+ final String NAME = "XMLMetaExporter";
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Impress.XMLMetaExporter",
+ new Object[]{arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xImpressDoc);
+
+ //change title name
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xImpressDoc) ;
+ XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ docInfo.setPropertyValue("Title", NAME);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Checking tags existance and changed property value
+ filter.addTag(new XMLTools.Tag ("office:document-meta"));
+ filter.addTagEnclosed(
+ new XMLTools.Tag("office:meta"),
+ new XMLTools.Tag("office:document-meta") );
+ filter.addTagEnclosed(
+ new XMLTools.Tag("dc:title"),
+ new XMLTools.Tag("office:meta") );
+ filter.addCharactersEnclosed(
+ NAME,
+ new XMLTools.Tag ("dc:title") );
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"simpress: StarOffice XML (Impress)"}));
+ tEnv.addObjRelation("SourceDocument", xImpressDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter) ;
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, true);
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
new file mode 100644
index 000000000000..7c69de6e1df4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLMetaImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLMetaImporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New impress document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Impress document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLMetaImporter</code><p>
+ *
+ * The impress document is set as a target document for importer.
+ * Imported XML-data contains only meta tags including title tag
+ * with test title name. After import title name getting from
+ * target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam,PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impTitle = "XMLImporter_test" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLMetaImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xImpressDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-meta" ,
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"},
+ {"start", "office:meta"} ,
+ {"start", "dc:title"},
+ {"chars", impTitle},
+ {"end", "dc:title"},
+ {"end", "office:meta"},
+ {"end", "office:document-meta"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
+ UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xImpressDoc) ;
+ final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, infoSup.getDocumentInfo()) ;
+ final PrintWriter logF = log ;
+
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ try {
+ String title = (String)
+ docInfo.getPropertyValue("Title") ;
+ logF.println("Title returned = '" + title + "'") ;
+ return impTitle.equals(title) ;
+ } catch (com.sun.star.uno.Exception e) {
+ logF.println("Exception occured while checking filter :") ;
+ e.printStackTrace(logF) ;
+ return false ;
+ }
+ }
+ } );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
new file mode 100644
index 000000000000..69a3a45eda39
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLSettingsExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLSettingsExporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New text document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xImpressDoc " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLSettingsExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The Impress document is set as a source document for exporter
+ * created. Then setting 'IsLayerMode' is changed to a new value.
+ * After this filter checks that value has changed in the XML output.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+ final boolean NewDataValue;
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Impress.XMLSettingsExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xImpressDoc);
+
+ //set some settings
+ XModel xImpressModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+ XController xController = xImpressModel.getCurrentController();
+ XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+ NewDataValue = ! ((Boolean) xPropSet.getPropertyValue
+ ("IsLayerMode")).booleanValue();
+ xPropSet.setPropertyValue("IsLayerMode",
+ new Boolean (NewDataValue));
+
+/* XViewDataSupplier xViewDataSupp = (XViewDataSupplier)
+ UnoRuntime.queryInterface(XViewDataSupplier.class, xImpressDoc);
+ XIndexAccess xViewData = xViewDataSupp.getViewData();
+ PropertyValue[] xData = (PropertyValue[]) xViewData.getByIndex(0);
+ NewDataValue = ! ((Boolean) xData[1].Value).booleanValue();
+ xData[1].Value = new Boolean(NewDataValue);
+ XIndexReplace xViewDataReplacable = (XIndexReplace)
+ UnoRuntime.queryInterface(XIndexReplace.class, xViewData);
+ xViewDataReplacable.replaceByIndex(0,xData);
+*/
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // Adding tags for checking existance of head tag and other tags
+ filter.addTagEnclosed(new XMLTools.Tag("office:settings"),
+ new XMLTools.Tag("office:document-settings"));
+ filter.addTagEnclosed(new XMLTools.Tag("config:config-item-set"),
+ new XMLTools.Tag("office:settings"));
+ filter.addTagEnclosed(new XMLTools.Tag("config:config-item-map-indexed"),
+ new XMLTools.Tag("config:config-item-set"));
+ filter.addTagEnclosed(new XMLTools.Tag("config:config-item-map-entry"),
+ new XMLTools.Tag("config:config-item-map-indexed"));
+ filter.addTagEnclosed(new XMLTools.Tag("config:config-item"),
+ new XMLTools.Tag("config:config-item-map-entry"));
+ filter.addCharactersEnclosed(String.valueOf(NewDataValue),
+ new XMLTools.Tag("config:config-item","config:name","IsLayerMode"));
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"simpress: StarOffice XML (Impress)"}));
+ tEnv.addObjRelation("SourceDocument",xImpressDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log,false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
new file mode 100644
index 000000000000..114d20670f03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLSettingsImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLSettingsImporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New impress document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Impress document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLStylesImporter</code><p>
+ *
+ * The Impress document is set as a target document for importer.
+ * Value of a property "IsLayerMode" has imported as 'true' to a target
+ * document. After import property value getting from target document
+ * is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLSettingsImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xImpressDoc) ;
+
+ // adding relation for XDocumentHandler
+ String[][] xml = new String[][] {
+ {"start", "office:document-settings",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
+ "xmlns:presentation", "CDATA",
+ "http://openoffice.org/2000/presentation",
+ "xmlns:config", "CDATA", "http://openoffice.org/2001/config",
+ "office:version", "CDATA", "1.0"},
+ {"start", "office:settings"},
+ {"start", "config:config-item-map-indexed", "config:name",
+ "CDATA", "Views"},
+ {"start", "config:config-item-map-entry"},
+ {"start","config:config-item", "config:name", "CDATA",
+ "IsLayerMode"},
+ {"chars", "true"},
+ {"end", "config:config-item"},
+ {"end", "config:config-item-map-entry"},
+ {"end", "config:config-item-map-indexed"},
+ {"end", "office:settings"},
+ {"end", "office:document-settings"}} ;
+
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+
+ // get property before import
+ XModel xImpressModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+ XController xController = xImpressModel.getCurrentController();
+ final XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, xController);
+ try {
+ log.println("Property \"IsLayerMode\" before import is " +
+ xPropSet.getPropertyValue("IsLayerMode"));
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't create component.", e);
+ }
+ final PrintWriter logF = log;
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ Boolean propValue;
+ try {
+ propValue = (Boolean) xPropSet.getPropertyValue
+ ("IsLayerMode");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(logF);
+ throw new StatusException
+ ("Can't get property value.", e);
+ }
+ logF.println("Property \"IsLayerMode\" after import is "
+ + propValue);
+ if ( propValue.booleanValue() == true ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ });
+
+ return tEnv;
+ } // end of getTestEnvironment
+
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
new file mode 100644
index 000000000000..aeca441c26e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLStylesExporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::ExportFilter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::XExporter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.ExportFilter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XExporter
+ * @see com.sun.star.beans.XPropertySet
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._ExportFilter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ */
+public class XMLStylesExporter extends TestCase {
+ XComponent xImpressDoc = null;
+ protected static int counter = 0;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xImpressDoc " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLStylesExporter</code> with
+ * argument which is an implementation of <code>XDocumentHandler</code>
+ * and which can check if required tags and character data is
+ * exported. <p>
+ * The Impress document is set as a source document for exporter
+ * created. New style 'NewStyle' added to style family "Graphics".
+ * This made for checking if this style is successfully exported within
+ * the document styles information.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} interface </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+ XInterface oObj = null;
+ FilterChecker filter = new FilterChecker(log);
+ Any arg = new Any(new Type(XDocumentHandler.class),filter);
+
+ String newName = "NewGraphicsStyle" + counter++;
+ // Adding tags for checking existance of head tag and property value
+ filter.addTag(new XMLTools.Tag("office:document-styles"));
+ filter.addTag(new XMLTools.Tag("office:styles"));
+ filter.addTag(new XMLTools.Tag("style:style","style:name", newName));
+
+ try {
+ oObj = (XInterface) xMSF.createInstanceWithArguments(
+ "com.sun.star.comp.Impress.XMLStylesExporter",
+ new Object[] {arg});
+ XExporter xEx = (XExporter)
+ UnoRuntime.queryInterface(XExporter.class,oObj);
+ xEx.setSourceDocument(xImpressDoc);
+
+ // Obtaining and changing property values
+ XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface
+ (XStyleFamiliesSupplier.class, xImpressDoc) ;
+ XNameAccess styleFamilies = styleSup.getStyleFamilies();
+ String[] styleFamiliesNames = styleFamilies.getElementNames();
+ XNameContainer StyleFamilyName = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class,
+ styleFamilies.getByName(styleFamiliesNames[0]));
+ Object SC = SOF.createInstance
+ (xImpressDoc, "com.sun.star.style.Style");
+ XStyle StylePage = (XStyle)
+ UnoRuntime.queryInterface(XStyle.class,SC);
+ StyleFamilyName.insertByName(newName, StylePage);
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ // create testobject here
+ log.println( "creating a new environment" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("MediaDescriptor", XMLTools.createMediaDescriptor(
+ new String[] {"FilterName"},
+ new Object[] {"simpress: StarOffice XML (Impress)"}));
+ tEnv.addObjRelation("SourceDocument",xImpressDoc);
+ tEnv.addObjRelation("XFilter.Checker", filter);
+ return tEnv;
+ }
+
+ /**
+ * This class checks the XML for tags and data required and returns
+ * checking result to <code>XFilter</code> interface test. All
+ * the information about errors occured in XML data is written
+ * to log specified.
+ * @see ifc.document._XFilter
+ */
+ protected class FilterChecker extends XMLTools.XMLChecker
+ implements ifc.document._XFilter.FilterChecker {
+
+ /**
+ * Creates a class which will write information
+ * into log specified.
+ */
+ public FilterChecker(PrintWriter log) {
+ super(log, false) ;
+ }
+ /**
+ * <code>_XFilter.FilterChecker</code> interface method
+ * which returns the result of XML checking.
+ * @return <code>true</code> if the XML data exported was
+ * valid (i.e. all necessary tags and character data exists),
+ * <code>false</code> if some errors occured.
+ */
+ public boolean checkFilter() {
+ return check();
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
new file mode 100644
index 000000000000..8635b1bdd0ad
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+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.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.comp.Impress.XMLStylesImporter</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li><code>com::sun::star::lang::XInitialization</code></li>
+ * <li><code>com::sun::star::document::XImporter</code></li>
+ * <li><code>com::sun::star::document::XFilter</code></li>
+ * <li><code>com::sun::star::document::ImportFilter</code></li>
+ * <li><code>com::sun::star::beans::XPropertySet</code></li>
+ * <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
+
+ * </ul>
+ * @see com.sun.star.lang.XInitialization
+ * @see com.sun.star.document.XImporter
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.ImportFilter
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.xml.sax.XDocumentHandler
+ * @see ifc.lang._XInitialization
+ * @see ifc.document._XImporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XExporter
+ * @see ifc.beans._XPropertySet
+ * @see ifc.xml.sax._XDocumentHandler
+ */
+public class XMLStylesImporter extends TestCase {
+ XComponent xImpressDoc = null;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating an impress document" );
+ xImpressDoc = SOF.createImpressDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.comp.Impress.XMLStylesImporter</code><p>
+ *
+ * The Impress document is set as a target document for importer.
+ * Imported XML-data contains only style tags including tag
+ * with new style name.
+ * After import style names getting from target document is checked.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'XDocumentHandler.XMLData'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'XDocumentHandler.ImportChecker'</code> for
+ * {@link ifc.xml.sax._XDocumentHandler} interface </li>
+ * <li> <code>'TargetDocument'</code> for
+ * {@link ifc.document._XImporter} interface </li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInt = null ;
+ final String impValue = "XMLImporter_test" ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLStylesImporter") ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ oObj = (XInterface) oInt ;
+
+ // create testobject here
+ log.println( "creating a new environment for Paragraph object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation
+ tEnv.addObjRelation("TargetDocument", xImpressDoc) ;
+
+ String[][] xml = new String[][] {
+ {"start", "office:document-styles",
+ "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
+ "xmlns:style", "CDATA", "http://openoffice.org/2000/style",
+ "xmlns:fo", "CDATA", "http://www.w3.org/1999/XSL/Format",
+ "xmlns:table", "CDATA", "http://openoffice.org/2000/table"},
+ {"start", "office:styles"},
+ {"start", "style:style",
+ "style:name", "CDATA", impValue,
+ "style:family", "CDATA", "graphics",
+ "style:parent-style-name", "CDATA", "standard"},
+ {"end", "style:style"},
+ {"end", "office:styles"},
+ {"end", "office:document-styles"}} ;
+
+ // adding relation for XDocumentHandler
+ tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
+ XNameAccess styles = null ;
+ try {
+ XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xImpressDoc);
+ XNameAccess oStyleFamilies = sup.getStyleFamilies();
+ Object family = oStyleFamilies.getByName("graphics") ;
+ styles = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, family) ;
+ log.println("Styles before:") ;
+ String[] names = styles.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ }
+ final XNameAccess stylesF = styles ;
+ final PrintWriter logF = log ;
+ tEnv.addObjRelation("XDocumentHandler.ImportChecker",
+ new ifc.xml.sax._XDocumentHandler.ImportChecker() {
+ public boolean checkImport() {
+ logF.println("Styles after:") ;
+ String[] names = stylesF.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ logF.println(" " + names[i]) ;
+ }
+ return stylesF.hasByName(impValue) ;
+ }
+ }) ;
+
+ return tEnv;
+ } // end of getTestEnvironment
+
+}
+